summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/amd64/intr.c47
-rw-r--r--sys/arch/amd64/amd64/vector.S13
-rw-r--r--sys/arch/amd64/include/intr.h10
-rw-r--r--sys/arch/amd64/include/pci_machdep.h11
-rw-r--r--sys/arch/amd64/isa/isa_machdep.c4
-rw-r--r--sys/arch/amd64/pci/pci_machdep.c9
-rw-r--r--sys/arch/arm/include/pci_machdep.h4
-rw-r--r--sys/arch/hppa/include/pci_machdep.h4
-rw-r--r--sys/arch/hppa64/include/pci_machdep.h4
-rw-r--r--sys/arch/i386/pci/pci_machdep.h4
-rw-r--r--sys/arch/landisk/include/pci_machdep.h4
-rw-r--r--sys/arch/sparc64/include/pci_machdep.h4
12 files changed, 47 insertions, 71 deletions
diff --git a/sys/arch/amd64/amd64/intr.c b/sys/arch/amd64/amd64/intr.c
index eb9ff1ee477..b03a0232407 100644
--- a/sys/arch/amd64/amd64/intr.c
+++ b/sys/arch/amd64/amd64/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.21 2008/12/06 14:36:49 tedu Exp $ */
+/* $OpenBSD: intr.c,v 1.22 2008/12/06 19:59:38 tedu Exp $ */
/* $NetBSD: intr.c,v 1.3 2003/03/03 22:16:20 fvdl Exp $ */
/*
@@ -79,8 +79,6 @@ struct pic softintr_pic = {
NULL,
};
-int intr_biglock_wrap(void *);
-
/*
* Fill in default interrupt table (in case of spurious interrupt
* during configuration of kernel), setup interrupt control unit
@@ -355,17 +353,13 @@ found:
void *
intr_establish(int legacy_irq, struct pic *pic, int pin, int type, int level,
- int (*handler)(void *), void *arg, char *what, int flags)
+ int (*handler)(void *), void *arg, char *what)
{
struct intrhand **p, *q, *ih;
struct cpu_info *ci;
int slot, error, idt_vec;
struct intrsource *source;
struct intrstub *stubp;
- int mpsafe = 0;
-
- if (level >= IPL_SCHED || (flags & INTR_ESTABLISH_MPSAFE))
- mpsafe = 1;
#ifdef DIAGNOSTIC
if (legacy_irq != -1 && (legacy_irq < 0 || legacy_irq > 15))
@@ -450,14 +444,6 @@ intr_establish(int legacy_irq, struct pic *pic, int pin, int type, int level,
ih->ih_pin = pin;
ih->ih_cpu = ci;
ih->ih_slot = slot;
-#ifdef MULTIPROCESSOR
- if (!mpsafe) {
- ih->ih_wrapped_fun = handler;
- ih->ih_wrapped_arg = arg;
- ih->ih_fun = intr_biglock_wrap;
- ih->ih_arg = ih;
- }
-#endif
evcount_attach(&ih->ih_count, what, (void *)&ih->ih_pin,
&evcount_intr);
@@ -553,21 +539,6 @@ intr_disestablish(struct intrhand *ih)
simple_unlock(&ci->ci_slock);
}
-#ifdef MULTIPROCESSOR
-int
-intr_biglock_wrap(void *v)
-{
- struct intrhand *ih = v;
- int ret;
-
- __mp_lock(&kernel_lock);
- ret = (*ih->ih_wrapped_fun)(ih->ih_wrapped_arg);
- __mp_unlock(&kernel_lock);
-
- return (ret);
-}
-#endif
-
#define CONCAT(x,y) __CONCAT(x,y)
/*
@@ -653,6 +624,20 @@ cpu_intr_init(struct cpu_info *ci)
#ifdef MULTIPROCESSOR
void
+x86_intlock(struct intrframe iframe)
+{
+ if (iframe.if_ppl < IPL_SCHED)
+ __mp_lock(&kernel_lock);
+}
+
+void
+x86_intunlock(struct intrframe iframe)
+{
+ if (iframe.if_ppl < IPL_SCHED)
+ __mp_unlock(&kernel_lock);
+}
+
+void
x86_softintlock(void)
{
__mp_lock(&kernel_lock);
diff --git a/sys/arch/amd64/amd64/vector.S b/sys/arch/amd64/amd64/vector.S
index 511af4d5ac4..cf34dd0d87a 100644
--- a/sys/arch/amd64/amd64/vector.S
+++ b/sys/arch/amd64/amd64/vector.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: vector.S,v 1.15 2008/12/06 04:31:24 tedu Exp $ */
+/* $OpenBSD: vector.S,v 1.16 2008/12/06 19:59:38 tedu Exp $ */
/* $NetBSD: vector.S,v 1.5 2004/06/28 09:13:11 fvdl Exp $ */
/*
@@ -381,6 +381,14 @@ IDTVEC(resume_lapic_ltimer)
INTRFASTEXIT
#endif /* NLAPIC > 0 */
+#ifdef MULTIPROCESSOR
+#define LOCK_KERNEL movq %rsp, %rdi; call _C_LABEL(x86_intlock)
+#define UNLOCK_KERNEL movq %rsp, %rdi; call _C_LABEL(x86_intunlock)
+#else
+#define LOCK_KERNEL
+#define UNLOCK_KERNEL
+#endif
+
#define voidop(num)
@@ -421,6 +429,7 @@ IDTVEC(intr_/**/name/**/num) ;\
sti ;\
incl CPUVAR(IDEPTH) ;\
movq IS_HANDLERS(%r14),%rbx ;\
+ LOCK_KERNEL ;\
6: \
movl IH_LEVEL(%rbx),%r12d ;\
cmpl %r13d,%r12d ;\
@@ -438,12 +447,14 @@ IDTVEC(intr_/**/name/**/num) ;\
testq %rbx,%rbx ;\
jnz 6b ;\
5: \
+ UNLOCK_KERNEL ;\
cli ;\
unmask(num) /* unmask it in hardware */ ;\
late_ack(num) ;\
sti ;\
jmp _C_LABEL(Xdoreti) /* lower spl and do ASTs */ ;\
7: \
+ UNLOCK_KERNEL ;\
cli ;\
orl $(1 << num),CPUVAR(IPENDING) ;\
level_mask(num) ;\
diff --git a/sys/arch/amd64/include/intr.h b/sys/arch/amd64/include/intr.h
index 740ffb0ec5d..86c63ceb283 100644
--- a/sys/arch/amd64/include/intr.h
+++ b/sys/arch/amd64/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.14 2008/12/06 04:31:24 tedu Exp $ */
+/* $OpenBSD: intr.h,v 1.15 2008/12/06 19:59:38 tedu Exp $ */
/* $NetBSD: intr.h,v 1.2 2003/05/04 22:01:56 fvdl Exp $ */
/*-
@@ -91,8 +91,6 @@ struct intrsource {
struct intrhand {
int (*ih_fun)(void *);
void *ih_arg;
- int (*ih_wrapped_fun)(void *);
- void *ih_wrapped_arg;
int ih_level;
struct intrhand *ih_next;
int ih_pin;
@@ -208,10 +206,8 @@ void intr_calculatemasks(struct cpu_info *);
int intr_allocate_slot_cpu(struct cpu_info *, struct pic *, int, int *);
int intr_allocate_slot(struct pic *, int, int, int, struct cpu_info **, int *,
int *);
-
-#define INTR_ESTABLISH_MPSAFE 0x01
void *intr_establish(int, struct pic *, int, int, int, int (*)(void *),
- void *, char *, int);
+ void *, char *);
void intr_disestablish(struct intrhand *);
void cpu_intr_init(struct cpu_info *);
int intr_find_mpmapping(int bus, int pin, int *handle);
@@ -223,6 +219,8 @@ int x86_fast_ipi(struct cpu_info *, int);
void x86_broadcast_ipi(int);
void x86_multicast_ipi(int, int);
void x86_ipi_handler(void);
+void x86_intlock(struct intrframe);
+void x86_intunlock(struct intrframe);
void x86_softintlock(void);
void x86_softintunlock(void);
void x86_setperf_ipi(struct cpu_info *);
diff --git a/sys/arch/amd64/include/pci_machdep.h b/sys/arch/amd64/include/pci_machdep.h
index cfd04020f47..0218c28f898 100644
--- a/sys/arch/amd64/include/pci_machdep.h
+++ b/sys/arch/amd64/include/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.7 2008/12/06 04:31:24 tedu Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.8 2008/12/06 19:59:38 tedu Exp $ */
/* $NetBSD: pci_machdep.h,v 1.1 2003/02/26 21:26:11 fvdl Exp $ */
/*
@@ -93,13 +93,8 @@ void pci_conf_write(pci_chipset_tag_t, pcitag_t, int,
pcireg_t);
int pci_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
const char *pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t);
-
-void *pci_intr_establish_flags(pci_chipset_tag_t, pci_intr_handle_t,
- int, int (*)(void *), void *, char *, int);
-#define pci_intr_establish(t,h,l,f,a,w) \
- pci_intr_establish_flags(t,h,l,f,a,w,0)
-#define pci_intr_establish_mpsafe(t,h,l,f,a,w) \
- pci_intr_establish_flags(t,h,l,f,a,w,INTR_ESTABLISH_MPSAFE)
+void *pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t,
+ int, int (*)(void *), void *, char *);
void pci_intr_disestablish(pci_chipset_tag_t, void *);
void pci_decompose_tag(pci_chipset_tag_t, pcitag_t,
int *, int *, int *);
diff --git a/sys/arch/amd64/isa/isa_machdep.c b/sys/arch/amd64/isa/isa_machdep.c
index 552e540057b..bd41ffc5bae 100644
--- a/sys/arch/amd64/isa/isa_machdep.c
+++ b/sys/arch/amd64/isa/isa_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isa_machdep.c,v 1.16 2008/12/06 17:46:52 tedu Exp $ */
+/* $OpenBSD: isa_machdep.c,v 1.17 2008/12/06 19:59:38 tedu Exp $ */
/* $NetBSD: isa_machdep.c,v 1.22 1997/06/12 23:57:32 thorpej Exp $ */
#define ISA_DMA_STATS
@@ -330,7 +330,7 @@ isa_intr_establish(isa_chipset_tag_t ic, int irq, int type, int level,
KASSERT(pic);
return intr_establish(irq, pic, pin, type, level, ih_fun,
- ih_arg, ih_what, 0);
+ ih_arg, ih_what);
}
/*
diff --git a/sys/arch/amd64/pci/pci_machdep.c b/sys/arch/amd64/pci/pci_machdep.c
index b1580779134..722b6e3591d 100644
--- a/sys/arch/amd64/pci/pci_machdep.c
+++ b/sys/arch/amd64/pci/pci_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.c,v 1.17 2008/12/06 05:08:02 tedu Exp $ */
+/* $OpenBSD: pci_machdep.c,v 1.18 2008/12/06 19:59:38 tedu Exp $ */
/* $NetBSD: pci_machdep.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */
/*-
@@ -518,8 +518,8 @@ pci_intr_string(pci_chipset_tag_t pc, pci_intr_handle_t ih)
}
void *
-pci_intr_establish_flags(pci_chipset_tag_t pc, pci_intr_handle_t ih, int level,
- int (*func)(void *), void *arg, char *what, int flags)
+pci_intr_establish(pci_chipset_tag_t pc, pci_intr_handle_t ih, int level,
+ int (*func)(void *), void *arg, char *what)
{
int pin, irq;
struct pic *pic;
@@ -542,8 +542,7 @@ pci_intr_establish_flags(pci_chipset_tag_t pc, pci_intr_handle_t ih, int level,
}
#endif
- return intr_establish(irq, pic, pin, IST_LEVEL, level, func, arg, what,
- flags);
+ return intr_establish(irq, pic, pin, IST_LEVEL, level, func, arg, what);
}
void
diff --git a/sys/arch/arm/include/pci_machdep.h b/sys/arch/arm/include/pci_machdep.h
index 064864380b2..32094d85c14 100644
--- a/sys/arch/arm/include/pci_machdep.h
+++ b/sys/arch/arm/include/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.5 2008/12/06 04:31:24 tedu Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.6 2008/12/06 19:59:38 tedu Exp $ */
/* $NetBSD: pci_machdep.h,v 1.2 2002/05/15 19:23:52 thorpej Exp $ */
/*
@@ -93,7 +93,5 @@ struct arm32_pci_chipset {
(*(c)->pc_intr_string)((c)->pc_intr_v, (ih))
#define pci_intr_establish(c, ih, l, h, a, n) \
(*(c)->pc_intr_establish)((c)->pc_intr_v, (ih), (l), (h), (a), (n))
-#define pci_intr_establish_mpsafe(c,h,l,f,a,w) \
- pci_intr_establish(c,h,l,f,a,w)
#define pci_intr_disestablish(c, iv) \
(*(c)->pc_intr_disestablish)((c)->pc_intr_v, (iv))
diff --git a/sys/arch/hppa/include/pci_machdep.h b/sys/arch/hppa/include/pci_machdep.h
index ec3caa8eac5..d5dca28e21a 100644
--- a/sys/arch/hppa/include/pci_machdep.h
+++ b/sys/arch/hppa/include/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.2 2008/12/06 04:31:24 tedu Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.3 2008/12/06 19:59:38 tedu Exp $ */
/*
* Copyright (c) 2003 Michael Shalayeff
@@ -82,8 +82,6 @@ struct hppa_pci_chipset_tag {
(*(c)->pc_intr_string)((c)->_cookie, (ih))
#define pci_intr_establish(c, ih, l, h, a, nm) \
(*(c)->pc_intr_establish)((c)->_cookie, (ih), (l), (h), (a), (nm))
-#define pci_intr_establish_mpsafe(c, ih, l, h, a, nm) \
- pci_intr_establish(c, ih, l, h, a, nm)
#define pci_intr_disestablish(c, iv) \
(*(c)->pc_intr_disestablish)((c)->_cookie, (iv))
diff --git a/sys/arch/hppa64/include/pci_machdep.h b/sys/arch/hppa64/include/pci_machdep.h
index 2115d8e35ca..ebfea186793 100644
--- a/sys/arch/hppa64/include/pci_machdep.h
+++ b/sys/arch/hppa64/include/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.2 2008/12/06 04:31:24 tedu Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.3 2008/12/06 19:59:38 tedu Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -73,8 +73,6 @@ struct hppa64_pci_chipset_tag {
(*(c)->pc_intr_string)((c)->_cookie, (ih))
#define pci_intr_establish(c, ih, l, h, a, nm) \
(*(c)->pc_intr_establish)((c)->_cookie, (ih), (l), (h), (a), (nm))
-#define pci_intr_establish_mpsafe(c,h,l,f,a,w) \
- pci_intr_establish(c,h,l,f,a,w)
#define pci_intr_disestablish(c, iv) \
(*(c)->pc_intr_disestablish)((c)->_cookie, (iv))
diff --git a/sys/arch/i386/pci/pci_machdep.h b/sys/arch/i386/pci/pci_machdep.h
index 85037b66267..778e632e5bc 100644
--- a/sys/arch/i386/pci/pci_machdep.h
+++ b/sys/arch/i386/pci/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.13 2008/12/06 05:05:46 tedu Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.14 2008/12/06 19:59:38 tedu Exp $ */
/* $NetBSD: pci_machdep.h,v 1.7 1997/06/06 23:29:18 thorpej Exp $ */
/*
@@ -94,8 +94,6 @@ int pci_intr_map(struct pci_attach_args *,
const char *pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t);
void *pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t,
int, int (*)(void *), void *, char *);
-#define pci_intr_establish_mpsafe(t,h,l,f,a,w) \
- pci_intr_establish(t,h,l,f,a,w)
void pci_intr_disestablish(pci_chipset_tag_t, void *);
void pci_decompose_tag(pci_chipset_tag_t, pcitag_t,
int *, int *, int *);
diff --git a/sys/arch/landisk/include/pci_machdep.h b/sys/arch/landisk/include/pci_machdep.h
index 6da2e1c4470..eb7a94a9174 100644
--- a/sys/arch/landisk/include/pci_machdep.h
+++ b/sys/arch/landisk/include/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.2 2008/12/06 04:31:24 tedu Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.3 2008/12/06 19:59:38 tedu Exp $ */
/* $NetBSD: pci_machdep.h,v 1.1 2006/09/01 21:26:18 uwe Exp $ */
/*
@@ -77,7 +77,5 @@ void landisk_pci_conf_interrupt(void *v, int bus, int dev, int pin,
landisk_pci_intr_string(v, ih)
#define pci_intr_establish(v, ih, level, ih_fun, ih_arg, ih_name) \
landisk_pci_intr_establish(v, ih, level, ih_fun, ih_arg, ih_name)
-#define pci_intr_establish_mpsafe(t,h,l,f,a,w) \
- pci_intr_establish(t,h,l,f,a,w)
#define pci_intr_disestablish(v, cookie) \
landisk_pci_intr_disestablish(v, cookie)
diff --git a/sys/arch/sparc64/include/pci_machdep.h b/sys/arch/sparc64/include/pci_machdep.h
index aa845e04357..1aece7a69e4 100644
--- a/sys/arch/sparc64/include/pci_machdep.h
+++ b/sys/arch/sparc64/include/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.20 2008/12/06 04:31:24 tedu Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.21 2008/12/06 19:59:38 tedu Exp $ */
/* $NetBSD: pci_machdep.h,v 1.7 2001/07/20 00:07:14 eeh Exp $ */
/*
@@ -87,8 +87,6 @@ int pci_intr_line(pci_intr_handle_t);
const char *pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t);
void *pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t,
int, int (*)(void *), void *, char *);
-#define pci_intr_establish_mpsafe(t,h,l,f,a,w) \
- pci_intr_establish(t,h,l,f,a,w)
void pci_intr_disestablish(pci_chipset_tag_t, void *);
int sparc64_pci_enumerate_bus(struct pci_softc *,