diff options
Diffstat (limited to 'sys/arch/mvme68k')
-rw-r--r-- | sys/arch/mvme68k/dev/cl.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/zs.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme68k/include/intr.h | 53 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/trap.c | 4 |
4 files changed, 22 insertions, 43 deletions
diff --git a/sys/arch/mvme68k/dev/cl.c b/sys/arch/mvme68k/dev/cl.c index 85a2f6a322b..da5609800c7 100644 --- a/sys/arch/mvme68k/dev/cl.c +++ b/sys/arch/mvme68k/dev/cl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl.c,v 1.42 2006/01/01 11:59:39 miod Exp $ */ +/* $OpenBSD: cl.c,v 1.43 2006/06/11 20:46:50 miod Exp $ */ /* * Copyright (c) 1995 Dale Rahn. All rights reserved. @@ -128,7 +128,7 @@ struct clsoftc { char sc_rxintrname[16 + 3]; char sc_txintrname[16 + 3]; int sc_flags; - int ssir; + u_int8_t ssir; }; const struct { diff --git a/sys/arch/mvme68k/dev/zs.c b/sys/arch/mvme68k/dev/zs.c index 23c6cdfcab4..4ec1daa2049 100644 --- a/sys/arch/mvme68k/dev/zs.c +++ b/sys/arch/mvme68k/dev/zs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zs.c,v 1.24 2006/03/15 20:04:36 miod Exp $ */ +/* $OpenBSD: zs.c,v 1.25 2006/06/11 20:46:50 miod Exp $ */ /* * Copyright (c) 2000 Steve Murphree, Jr. @@ -129,7 +129,7 @@ int zsirq(void *); int zsregs(vaddr_t, int, volatile u_char **, volatile u_char **); int zspclk(void); -u_long sir_zs; +u_int8_t sir_zs; void zs_softint(void *); #define zsunit(dev) (minor(dev) >> 1) diff --git a/sys/arch/mvme68k/include/intr.h b/sys/arch/mvme68k/include/intr.h index 68324d79560..41c4a74312d 100644 --- a/sys/arch/mvme68k/include/intr.h +++ b/sys/arch/mvme68k/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.13 2006/03/12 03:28:28 brad Exp $ */ +/* $OpenBSD: intr.h,v 1.14 2006/06/11 20:46:50 miod Exp $ */ /* * Copyright (C) 2000 Steve Murphree, Jr. * All rights reserved. @@ -29,50 +29,28 @@ #ifndef _MVME68K_INTR_H_ #define _MVME68K_INTR_H_ +#include <machine/psl.h> + #ifdef _KERNEL /* - * simulated software interrupt register + * Simulated software interrupt register. */ -extern unsigned char ssir; +extern volatile u_int8_t ssir; -#define SIR_NET 0x1 -#define SIR_CLOCK 0x2 +#define SIR_NET 0x01 +#define SIR_CLOCK 0x02 -#define setsoftint(x) ssir |= (x) -#define setsoftnet() ssir |= SIR_NET -#define setsoftclock() ssir |= SIR_CLOCK -u_long allocate_sir(void (*proc)(void *), void *arg); +#define siron(mask) \ + __asm __volatile ( "orb %1,%0" : "=m" (ssir) : "ir" (mask)) +#define siroff(mask) \ + __asm __volatile ( "andb %1,%0" : "=m" (ssir) : "ir" (~(mask))) -#define _spl(s) \ -({ \ - register int _spl_r; \ -\ - __asm __volatile ("clrl %0; movew sr,%0; movew %1,sr" : \ - "=&d" (_spl_r) : "di" (s)); \ - _spl_r; \ -}) +#define setsoftint(s) siron(s) +#define setsoftnet() siron(SIR_NET) +#define setsoftclock() siron(SIR_CLOCK) -#define _splraise(s) \ -({ \ - int _spl_r; \ - \ - __asm __volatile (" \ - clrl d0 ; \ - movw sr,d0 ; \ - movl d0,%0 ; \ - andw #0x700,d0 ; \ - movw %1,d1 ; \ - andw #0x700,d1 ; \ - cmpw d0,d1 ; \ - jle 1f ; \ - movw %1,sr ; \ - 1:" : \ - "=&d" (_spl_r) : \ - "di" (s) : \ - "d0", "d1"); \ - _spl_r; \ -}) +u_int8_t allocate_sir(void (*proc)(void *), void *arg); /* * Interrupt "levels". These are a more abstract representation @@ -108,5 +86,6 @@ u_long allocate_sir(void (*proc)(void *), void *arg); /* locore.s */ int spl0(void); + #endif /* _KERNEL */ #endif /* _MVME68K_INTR_H_ */ diff --git a/sys/arch/mvme68k/mvme68k/trap.c b/sys/arch/mvme68k/mvme68k/trap.c index 2ebeab657b4..84210a63acd 100644 --- a/sys/arch/mvme68k/mvme68k/trap.c +++ b/sys/arch/mvme68k/mvme68k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.62 2006/01/30 21:26:19 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.63 2006/06/11 20:46:50 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -1128,7 +1128,7 @@ bad: /* * Allocation routines for software interrupts. */ -u_long +u_int8_t allocate_sir(proc, arg) void (*proc)(void *); void *arg; |