Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/news68k/include Make sure access of ssir atomic. (f...



details:   https://anonhg.NetBSD.org/src/rev/36ced11785bc
branches:  trunk
changeset: 482606:36ced11785bc
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Wed Feb 16 15:32:03 2000 +0000

description:
Make sure access of ssir atomic. (from luna68k)

diffstat:

 sys/arch/news68k/include/intr.h |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r 43791d24258f -r 36ced11785bc sys/arch/news68k/include/intr.h
--- a/sys/arch/news68k/include/intr.h   Wed Feb 16 14:02:13 2000 +0000
+++ b/sys/arch/news68k/include/intr.h   Wed Feb 16 15:32:03 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.h,v 1.2 1999/12/29 05:01:14 tsutsui Exp $ */
+/*     $NetBSD: intr.h,v 1.3 2000/02/16 15:32:03 tsutsui Exp $ */
 
 /*
  *
@@ -74,15 +74,18 @@
 #define        SIR_CLOCK       1
 #define        NEXT_SIR        2
 
-#define        siroff(x)       ssir &= ~(x)
+#define        siron(x)        \
+       __asm __volatile ("orb %0,%1" : : "di" ((u_char)(x)), "g" (ssir))
+#define        siroff(x)       \
+       __asm __volatile ("andb %0,%1" : : "di" ((u_char)~(x)), "g" (ssir))
 #define        setsoftint(x)   do {                            \
-                               ssir |= (x);            \
+                               siron(x);               \
                                *ctrl_int2 = 0xff;      \
                        } while (0)
 #define        setsoftnet()    setsoftint(1 << SIR_NET)
 #define        setsoftclock()  setsoftint(1 << SIR_CLOCK)
 
-u_char allocate_sir __P((void (*) __P((void *)), void *));
+u_char allocate_sir __P((void (*)(void *), void *));
 void init_sir __P((void));
 #endif /* _KERNEL */
 



Home | Main Index | Thread Index | Old Index