diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-09-27 11:29:21 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-09-27 11:29:21 +0000 |
commit | 19059cb0dd50a89416148c073d0d2ea6e8ca365a (patch) | |
tree | 028028e684aed87f3c41a446d4ee8a0ba7b8ab76 /sys/arch/sparc64 | |
parent | c2bd7cb5ca2e18a027e782e271ab53a456179132 (diff) |
Store the target CPU in "struct intrhand" and use it in intr_barrier().
Also use it wherever we configure the hardware to direct interrupts to the
right CPU.
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r-- | sys/arch/sparc64/dev/cbus.c | 5 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/ebus_mainbus.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/vbus.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/vpci.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc64/include/intr.h | 3 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/intr.c | 9 |
6 files changed, 17 insertions, 12 deletions
diff --git a/sys/arch/sparc64/dev/cbus.c b/sys/arch/sparc64/dev/cbus.c index 5ae55eb735b..b99e87f8e24 100644 --- a/sys/arch/sparc64/dev/cbus.c +++ b/sys/arch/sparc64/dev/cbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cbus.c,v 1.14 2015/01/25 21:42:13 kettenis Exp $ */ +/* $OpenBSD: cbus.c,v 1.15 2015/09/27 11:29:20 kettenis Exp $ */ /* * Copyright (c) 2008 Mark Kettenis * @@ -187,8 +187,9 @@ cbus_intr_establish(bus_space_tag_t t, bus_space_tag_t t0, int ihandle, evcount_attach(&ih->ih_count, "unknown", NULL); ih->ih_ack = cbus_intr_ack; + ih->ih_cpu = cpus; - err = hv_vintr_settarget(devhandle, devino, cpus->ci_upaid); + err = hv_vintr_settarget(devhandle, devino, ih->ih_cpu->ci_upaid); if (err != H_EOK) { printf("hv_vintr_settarget: %d\n", err); return (NULL); diff --git a/sys/arch/sparc64/dev/ebus_mainbus.c b/sys/arch/sparc64/dev/ebus_mainbus.c index 58e18357c1e..8eb2084241f 100644 --- a/sys/arch/sparc64/dev/ebus_mainbus.c +++ b/sys/arch/sparc64/dev/ebus_mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ebus_mainbus.c,v 1.8 2012/08/17 20:41:27 kettenis Exp $ */ +/* $OpenBSD: ebus_mainbus.c,v 1.9 2015/09/27 11:29:20 kettenis Exp $ */ /* * Copyright (c) 2007 Mark Kettenis @@ -277,7 +277,7 @@ ebus_mainbus_intr_establish(bus_space_tag_t t, bus_space_tag_t t0, int ihandle, intr_establish(ih->ih_pil, ih); ih->ih_ack = ebus_mainbus_intr_ack; - err = hv_intr_settarget(sysino, cpus->ci_upaid); + err = hv_intr_settarget(sysino, ih->ih_cpu->ci_upaid); if (err != H_EOK) return (NULL); diff --git a/sys/arch/sparc64/dev/vbus.c b/sys/arch/sparc64/dev/vbus.c index 72e8ff49f49..35f65a96b0a 100644 --- a/sys/arch/sparc64/dev/vbus.c +++ b/sys/arch/sparc64/dev/vbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vbus.c,v 1.7 2014/07/12 18:44:43 tedu Exp $ */ +/* $OpenBSD: vbus.c,v 1.8 2015/09/27 11:29:20 kettenis Exp $ */ /* * Copyright (c) 2008 Mark Kettenis * @@ -207,7 +207,7 @@ vbus_intr_establish(bus_space_tag_t t, bus_space_tag_t t0, int ihandle, intr_establish(ih->ih_pil, ih); ih->ih_ack = vbus_intr_ack; - err = hv_intr_settarget(sysino, cpus->ci_upaid); + err = hv_intr_settarget(sysino, ih->ih_cpu->ci_upaid); if (err != H_EOK) return (NULL); diff --git a/sys/arch/sparc64/dev/vpci.c b/sys/arch/sparc64/dev/vpci.c index 0633a7cfded..354eb340572 100644 --- a/sys/arch/sparc64/dev/vpci.c +++ b/sys/arch/sparc64/dev/vpci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vpci.c,v 1.18 2014/12/09 06:58:29 doug Exp $ */ +/* $OpenBSD: vpci.c,v 1.19 2015/09/27 11:29:20 kettenis Exp $ */ /* * Copyright (c) 2008 Mark Kettenis <kettenis@openbsd.org> * @@ -562,7 +562,7 @@ vpci_intr_establish(bus_space_tag_t t, bus_space_tag_t t0, int ihandle, intr_establish(ih->ih_pil, ih); ih->ih_ack = vpci_intr_ack; - err = hv_intr_settarget(sysino, cpus->ci_upaid); + err = hv_intr_settarget(sysino, ih->ih_cpu->ci_upaid); if (err != H_EOK) return (NULL); diff --git a/sys/arch/sparc64/include/intr.h b/sys/arch/sparc64/include/intr.h index eecb162590e..16b3913506f 100644 --- a/sys/arch/sparc64/include/intr.h +++ b/sys/arch/sparc64/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.17 2015/09/13 11:47:59 kettenis Exp $ */ +/* $OpenBSD: intr.h,v 1.18 2015/09/27 11:29:20 kettenis Exp $ */ /* $NetBSD: intr.h,v 1.8 2001/01/14 23:50:30 thorpej Exp $ */ /*- @@ -57,6 +57,7 @@ struct intrhand { void (*ih_ack)(struct intrhand *); struct evcount ih_count; /* # of interrupts */ const void *ih_bus; /* parent bus */ + struct cpu_info *ih_cpu; /* target */ char ih_name[32]; /* device name */ }; diff --git a/sys/arch/sparc64/sparc64/intr.c b/sys/arch/sparc64/sparc64/intr.c index 9fd896bd523..ce0affe9906 100644 --- a/sys/arch/sparc64/sparc64/intr.c +++ b/sys/arch/sparc64/sparc64/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.53 2015/09/13 11:47:59 kettenis Exp $ */ +/* $OpenBSD: intr.c,v 1.54 2015/09/27 11:29:20 kettenis Exp $ */ /* $NetBSD: intr.c,v 1.39 2001/07/19 23:38:11 eeh Exp $ */ /* @@ -200,6 +200,7 @@ intr_establish(int level, struct intrhand *ih) ih->ih_pil = level; /* XXXX caller should have done this before */ ih->ih_pending = 0; /* XXXX caller should have done this before */ ih->ih_next = NULL; + ih->ih_cpu = cpus; if (ih->ih_clr) ih->ih_ack = intr_ack; else @@ -313,9 +314,11 @@ intr_establish(int level, struct intrhand *ih) } void -intr_barrier(void *ih) +intr_barrier(void *cookie) { - sched_barrier(NULL); + struct intrhand *ih = cookie; + + sched_barrier(ih->ih_cpu); } void * |