Kill CLOCK_VA, INTERREG_VA. Do spl0() and splx(x) inline too.

This commit is contained in:
gwr 1994-09-20 16:31:03 +00:00
parent 7cd046827a
commit 399b15ebf9
2 changed files with 50 additions and 40 deletions

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 1994 Gordon W. Ross
* Copyright (c) 1993 Adam Glass
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
@ -38,11 +39,13 @@
*
* from: Utah Hdr: machparam.h 1.16 92/12/20
* from: @(#)param.h 8.1 (Berkeley) 6/10/93
* $Id: param.h,v 1.17 1994/09/16 02:41:16 jtc Exp $
* $Id: param.h,v 1.18 1994/09/20 16:31:03 gwr Exp $
*/
#ifndef MACHINE
/*
* Machine dependent constants for HP9000 series 300.
* Machine dependent constants for the Sun3 series.
*/
#define MACHINE "sun3"
#define MACHINE_ARCH "m68k"
@ -80,10 +83,6 @@
#define SINCR 1 /* increment of stack/NBPG */
#define UPAGES 3 /* pages of u-area */
#define USPACE (UPAGES * NBPG)
#define CLOCK_VA (0x0FFE0000+(UPAGES*NBPG*2))
#define INTERREG_VA (0x0FFE0000+(UPAGES*NBPG*2)+NBPG)
/*
* Constants related to network buffer management.
@ -151,21 +150,27 @@
#define sun3_ptob(x) ((unsigned)(x) << PGSHIFT)
/*
* spl functions; all but spl0 are done in-line
* Suns have a REAL interrupt register, so spl0() and splx(s)
* have no need to check for any simulated interrupts, etc.
* All are done in-line (if optimization turned on).
*/
#include <machine/psl.h>
#ifdef __GNUC__
#define _spl(s) \
({ \
register int _spl_r; \
\
__asm __volatile ("clrl %0; movew sr,%0; movew %1,sr" : \
"&=d" (_spl_r) : "di" (s)); \
_spl_r; \
})
#endif
/* spl0 requires checking for software interrupts */
/*
* This is as close to a macro as one can get.
* (See the GCC extensions info document.)
*/
extern __inline__ int _spl(int new)
{
register int old;
__asm__ __volatile ("clrl %0; movw sr,%0; movw %1,sr" :
"&=d" (old) : "di" (new));
return (old);
}
#endif /* GNUC */
#define spl0() _spl(PSL_S|PSL_IPL0)
#define spl1() _spl(PSL_S|PSL_IPL1)
#define spl2() _spl(PSL_S|PSL_IPL2)
#define spl3() _spl(PSL_S|PSL_IPL3)
@ -173,6 +178,7 @@
#define spl5() _spl(PSL_S|PSL_IPL5)
#define spl6() _spl(PSL_S|PSL_IPL6)
#define spl7() _spl(PSL_S|PSL_IPL7)
#define splx(x) _spl(x)
#define splsoftclock() spl1()
#define splnet() spl3()
@ -186,9 +192,6 @@
#define splhigh() spl7()
#define splsched() spl7()
/* watch out for side effects */
#define splx(s) (s & PSL_IPL ? _spl(s) : spl0())
#ifdef KERNEL
#ifndef LOCORE
#define DELAY(n) delay(n)
@ -197,3 +200,5 @@
#else
#define DELAY(n) { register int N = (n); while (--N > 0); }
#endif
#endif /* MACHINE */

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 1994 Gordon W. Ross
* Copyright (c) 1993 Adam Glass
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
@ -38,11 +39,13 @@
*
* from: Utah Hdr: machparam.h 1.16 92/12/20
* from: @(#)param.h 8.1 (Berkeley) 6/10/93
* $Id: param3.h,v 1.17 1994/09/16 02:41:16 jtc Exp $
* $Id: param3.h,v 1.18 1994/09/20 16:31:03 gwr Exp $
*/
#ifndef MACHINE
/*
* Machine dependent constants for HP9000 series 300.
* Machine dependent constants for the Sun3 series.
*/
#define MACHINE "sun3"
#define MACHINE_ARCH "m68k"
@ -80,10 +83,6 @@
#define SINCR 1 /* increment of stack/NBPG */
#define UPAGES 3 /* pages of u-area */
#define USPACE (UPAGES * NBPG)
#define CLOCK_VA (0x0FFE0000+(UPAGES*NBPG*2))
#define INTERREG_VA (0x0FFE0000+(UPAGES*NBPG*2)+NBPG)
/*
* Constants related to network buffer management.
@ -151,21 +150,27 @@
#define sun3_ptob(x) ((unsigned)(x) << PGSHIFT)
/*
* spl functions; all but spl0 are done in-line
* Suns have a REAL interrupt register, so spl0() and splx(s)
* have no need to check for any simulated interrupts, etc.
* All are done in-line (if optimization turned on).
*/
#include <machine/psl.h>
#ifdef __GNUC__
#define _spl(s) \
({ \
register int _spl_r; \
\
__asm __volatile ("clrl %0; movew sr,%0; movew %1,sr" : \
"&=d" (_spl_r) : "di" (s)); \
_spl_r; \
})
#endif
/* spl0 requires checking for software interrupts */
/*
* This is as close to a macro as one can get.
* (See the GCC extensions info document.)
*/
extern __inline__ int _spl(int new)
{
register int old;
__asm__ __volatile ("clrl %0; movw sr,%0; movw %1,sr" :
"&=d" (old) : "di" (new));
return (old);
}
#endif /* GNUC */
#define spl0() _spl(PSL_S|PSL_IPL0)
#define spl1() _spl(PSL_S|PSL_IPL1)
#define spl2() _spl(PSL_S|PSL_IPL2)
#define spl3() _spl(PSL_S|PSL_IPL3)
@ -173,6 +178,7 @@
#define spl5() _spl(PSL_S|PSL_IPL5)
#define spl6() _spl(PSL_S|PSL_IPL6)
#define spl7() _spl(PSL_S|PSL_IPL7)
#define splx(x) _spl(x)
#define splsoftclock() spl1()
#define splnet() spl3()
@ -186,9 +192,6 @@
#define splhigh() spl7()
#define splsched() spl7()
/* watch out for side effects */
#define splx(s) (s & PSL_IPL ? _spl(s) : spl0())
#ifdef KERNEL
#ifndef LOCORE
#define DELAY(n) delay(n)
@ -197,3 +200,5 @@
#else
#define DELAY(n) { register int N = (n); while (--N > 0); }
#endif
#endif /* MACHINE */