summaryrefslogtreecommitdiff
path: root/sys/arch/macppc/dev/openpic.c
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2008-04-26 22:37:42 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2008-04-26 22:37:42 +0000
commitd35e12aa8f871aa01e86a962c189acf4f17b67b0 (patch)
tree82ac1d0535685178ff8f91684b3b52653ef83fc0 /sys/arch/macppc/dev/openpic.c
parent098d59e6fd1c5402c7400866d0b275efe074545d (diff)
Changes to get closer to SMP.
add biglock before interrupt calls into the kernel. switch the clock to using cpuinfo variables instead of globals move cpu_switchto into C code so that on multiprocessor the FPU and Altivec can be saved before switching CPUs. add a lock into pmap when modifying the hash table.
Diffstat (limited to 'sys/arch/macppc/dev/openpic.c')
-rw-r--r--sys/arch/macppc/dev/openpic.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/arch/macppc/dev/openpic.c b/sys/arch/macppc/dev/openpic.c
index f3be80fe373..5429b905212 100644
--- a/sys/arch/macppc/dev/openpic.c
+++ b/sys/arch/macppc/dev/openpic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openpic.c,v 1.41 2007/10/27 22:37:03 kettenis Exp $ */
+/* $OpenBSD: openpic.c,v 1.42 2008/04/26 22:37:41 drahn Exp $ */
/*-
* Copyright (c) 1995 Per Fogelstrom
@@ -484,8 +484,10 @@ openpic_do_pending_int()
while(ih) {
ppc_intr_enable(1);
+ KERNEL_LOCK();
if ((*ih->ih_fun)(ih->ih_arg))
ih->ih_count.ec_count++;
+ KERNEL_UNLOCK();
(void)ppc_intr_disable();
@@ -498,7 +500,9 @@ openpic_do_pending_int()
do {
if((ci->ci_ipending & SINT_CLOCK) & ~pcpl) {
ci->ci_ipending &= ~SINT_CLOCK;
+ KERNEL_LOCK();
softclock();
+ KERNEL_UNLOCK();
}
if((ci->ci_ipending & SINT_NET) & ~pcpl) {
extern int netisr;
@@ -507,12 +511,16 @@ openpic_do_pending_int()
ci->ci_ipending &= ~SINT_NET;
while ((pisr = netisr) != 0) {
atomic_clearbits_int(&netisr, pisr);
+ KERNEL_LOCK();
softnet(pisr);
+ KERNEL_UNLOCK();
}
}
if((ci->ci_ipending & SINT_TTY) & ~pcpl) {
ci->ci_ipending &= ~SINT_TTY;
+ KERNEL_LOCK();
softtty();
+ KERNEL_UNLOCK();
}
} while ((ci->ci_ipending & SINT_MASK) & ~pcpl);
ci->ci_ipending &= pcpl;