From 8afd1e0abdf70e1817d86d751f72f294f5ba1724 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sun, 11 Jun 2006 20:46:51 +0000 Subject: Factorize spl handling functions and software interrupt routines between m68k-based platforms. --- sys/arch/mac68k/include/intr.h | 41 +++++------------------------------------ 1 file changed, 5 insertions(+), 36 deletions(-) (limited to 'sys/arch/mac68k') 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 -#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) -- cgit v1.2.3