From 7fabe79fca48742ba4b8966e73a45d11f347e000 Mon Sep 17 00:00:00 2001 From: kstailey Date: Fri, 14 Feb 1997 17:57:07 +0000 Subject: change inline version of _spl() to macro --- sys/arch/sun3/include/param.h | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) (limited to 'sys/arch/sun3/include') diff --git a/sys/arch/sun3/include/param.h b/sys/arch/sun3/include/param.h index 705c3727778..a16a48420a9 100644 --- a/sys/arch/sun3/include/param.h +++ b/sys/arch/sun3/include/param.h @@ -1,4 +1,4 @@ -/* $OpenBSD: param.h,v 1.8 1997/02/14 17:52:26 kstailey Exp $ */ +/* $OpenBSD: param.h,v 1.9 1997/02/14 17:57:06 kstailey Exp $ */ /* $NetBSD: param.h,v 1.34 1996/03/04 05:04:40 cgd Exp $ */ /* @@ -149,30 +149,20 @@ #define sun3_btop(x) ((unsigned)(x) >> PGSHIFT) #define sun3_ptob(x) ((unsigned)(x) << PGSHIFT) -#include - -#if defined(_KERNEL) && !defined(_LOCORE) - -#ifndef __GNUC__ -/* No inline, use real function in locore.s */ -extern int _spl(int new); -#else /* GNUC */ /* - * Define an inline function for PSL manipulation. - * This is as close to a macro as one can get. - * If not optimizing, the one in locore.s is used. - * (See the GCC extensions info document.) + * spl functions; all but spl0 are done in-line */ -extern __inline__ int _spl(int new) -{ - register int old; - __asm __volatile ( - "clrl %0; movew sr,%0; movew %1,sr" : - "&=d" (old) : "di" (new)); - return (old); -} -#endif /* GNUC */ +#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; \ +}) /* * The rest of this is sun3 specific, because other ports may @@ -221,6 +211,7 @@ extern __inline__ int _spl(int new) /* Get current sr value (debug, etc.) */ extern int getsr __P((void)); +#if defined(_KERNEL) && !defined(_LOCORE) extern void _delay __P((unsigned)); #define delay(us) _delay((us)<<8) #define DELAY(n) delay(n) -- cgit v1.2.3