diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-06-11 20:46:51 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-06-11 20:46:51 +0000 |
commit | 8afd1e0abdf70e1817d86d751f72f294f5ba1724 (patch) | |
tree | 2bde36d3175cc93c4df6aa6282d44fb88a75be6e /sys/arch/mac68k | |
parent | dcaea01709bb3167aacceeabbd34212bcd555f22 (diff) |
Factorize spl handling functions and software interrupt routines between
m68k-based platforms.
Diffstat (limited to 'sys/arch/mac68k')
-rw-r--r-- | sys/arch/mac68k/include/intr.h | 41 |
1 files changed, 5 insertions, 36 deletions
diff --git a/sys/arch/mac68k/include/intr.h b/sys/arch/mac68k/include/intr.h index 2e0cda8d139..0f3f4902e79 100644 --- a/sys/arch/mac68k/include/intr.h +++ b/sys/arch/mac68k/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.14 2006/03/13 19:39:52 brad Exp $ */ +/* $OpenBSD: intr.h,v 1.15 2006/06/11 20:46:50 miod Exp $ */ /* $NetBSD: intr.h,v 1.9 1998/08/12 06:58:42 scottr Exp $ */ /* @@ -31,40 +31,9 @@ #ifndef _MAC68K_INTR_H_ #define _MAC68K_INTR_H_ -#ifdef _KERNEL -/* - * spl functions; all but spl0 are done in-line - */ +#include <machine/psl.h> -#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 _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; \ -}) +#ifdef _KERNEL /* * splnet must block hardware network interrupts @@ -136,9 +105,9 @@ extern volatile u_int8_t ssir; #define SIR_ADB 0x08 #define siron(mask) \ - __asm __volatile ( "orb %0,_ssir" : : "i" (mask)) + __asm __volatile ( "orb %1,%0" : "=m" (ssir) : "i" (mask)) #define siroff(mask) \ - __asm __volatile ( "andb %0,_ssir" : : "ir" (~(mask))); + __asm __volatile ( "andb %1,%0" : "=m" (ssir) : "ir" (~(mask))) #define setsoftnet() siron(SIR_NET) #define setsoftclock() siron(SIR_CLOCK) |