diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-05-19 10:20:58 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-05-19 10:20:58 +0000 |
commit | d413a08361665794efe8c2e38f2a171e85f272aa (patch) | |
tree | 17232362a274cb61b7823091f1574b65b91c75be /sys/arch/powerpc | |
parent | 8df27b6759a173443ccb89f6b88ed44ca1460b2e (diff) |
Use atomic operations in set_sint() instead of disabling interrupts in the
function. ok kettenis@
Diffstat (limited to 'sys/arch/powerpc')
-rw-r--r-- | sys/arch/powerpc/include/intr.h | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/sys/arch/powerpc/include/intr.h b/sys/arch/powerpc/include/intr.h index aad653eeb87..a6999d357b1 100644 --- a/sys/arch/powerpc/include/intr.h +++ b/sys/arch/powerpc/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.32 2007/03/20 20:59:53 kettenis Exp $ */ +/* $OpenBSD: intr.h,v 1.33 2007/05/19 10:20:57 miod Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom, Opsycon AB and RTMX Inc, USA. @@ -53,6 +53,7 @@ #if defined(_KERNEL) && !defined(_LOCORE) #include <sys/evcount.h> +#include <machine/atomic.h> #define PPC_NIRQ 66 #define PPC_CLK_IRQ 64 @@ -67,7 +68,6 @@ int splsoftnet(void); void do_pending_int(void); - extern int imask[IPL_NUM]; /* SPL asserts */ @@ -118,19 +118,7 @@ spllower(int newcpl) return(oldcpl); } -/* Following code should be implemented with lwarx/stwcx to avoid - * the disable/enable. i need to read the manual once more.... */ -static __inline void -set_sint(int pending) -{ - struct cpu_info *ci = curcpu(); - int msrsave; - - __asm__ ("mfmsr %0" : "=r"(msrsave)); - __asm__ volatile ("mtmsr %0" :: "r"(msrsave & ~PSL_EE)); - ci->ci_ipending |= pending; - __asm__ volatile ("mtmsr %0" :: "r"(msrsave)); -} +#define set_sint(p) atomic_setbits_int(&curcpu()->ci_ipending, p) #define SINT_CLOCK 0x10000000 #define SINT_NET 0x20000000 |