xref: /netbsd/sys/arch/amiga/include/psl.h (revision bf9ec67e)
1 /*	$NetBSD: psl.h,v 1.19 2001/05/27 20:22:57 is Exp $	*/
2 
3 #ifndef _MACHINE_PSL_H_
4 #define _MACHINE_PSL_H_
5 
6 #include <m68k/psl.h>
7 
8 #if defined(_KERNEL) && !defined(_LOCORE)
9 
10 #if !defined(_LKM)
11 #include "opt_lev6_defer.h"
12 #endif
13 
14 #define	spl0()			_spl0()	/* we have real software interrupts */
15 
16 #define splnone()		spl0()
17 #define	spllowersoftclock()	spl1()
18 
19 #define splsoftclock()		splraise1()
20 #define splsoftnet()		splraise1()
21 #define splbio()		splraise3()
22 #define splnet()		splraise3()
23 
24 /*
25  * splserial hack, idea by Jason Thorpe.
26  * drivers which need it (at the present only the coms) raise the variable to
27  * their serial interrupt level.
28  *
29  * serialspl is statically initialized in machdep.c at the moment; should
30  * be some driver independent file.
31  *
32  * XXX should serialspl be volatile? I think not; it is intended to be set only
33  * during xxx_attach() time, and will be used only later.
34  *	-is
35  */
36 
37 extern u_int16_t	amiga_serialspl;
38 #define splserial()	_splraise(amiga_serialspl)
39 #define spltty()	splraise4()
40 #define	splvm()		splraise4()
41 
42 #ifndef _LKM
43 
44 #ifndef LEV6_DEFER
45 #define splclock()	splraise6()
46 #define splstatclock()	splraise6()
47 #define splhigh()	spl7()
48 #define splsched()	spl7()
49 #define spllock()	spl7()
50 #else
51 #define splclock()	splraise4()
52 #define splstatclock()	splraise4()
53 #define splhigh()	splraise4()
54 #define splsched()	splraise4()
55 #define spllock()	splraise4()
56 #endif
57 
58 #else	/* _LKM */
59 
60 extern int _spllkm6(void);
61 extern int _spllkm7(void);
62 
63 #define splclock()	_spllkm6()
64 #define splstatclock()	_spllkm6()
65 #define spllock()	_spllkm7()
66 #define splhigh()	_spllkm7()
67 #define splsched()	_spllkm7()
68 
69 #endif /* _LKM */
70 
71 #define splx(s)		_spl(s)
72 
73 #endif	/* KERNEL && !_LOCORE */
74 #endif	/* _MACHINE_PSL_H_ */
75