Annotation of sys/arch/m88k/include/intr.h, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: intr.h,v 1.8 2007/05/16 19:37:06 thib Exp $ */
2: /*
3: * Copyright (C) 2000 Steve Murphree, Jr.
4: * All rights reserved.
5: *
6: * Redistribution and use in source and binary forms, with or without
7: * modification, are permitted provided that the following conditions
8: * are met:
9: * 1. Redistributions of source code must retain the above copyright
10: * notice, this list of conditions and the following disclaimer.
11: * 2. Redistributions in binary form must reproduce the above copyright
12: * notice, this list of conditions and the following disclaimer in the
13: * documentation and/or other materials provided with the distribution.
14: * 3. The name of the author may not be used to endorse or promote products
15: * derived from this software without specific prior written permission.
16: *
17: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27: */
28:
29: #ifndef _M88K_INTR_H_
30: #define _M88K_INTR_H_
31:
32: #ifdef _KERNEL
33: #ifndef _LOCORE
34: unsigned setipl(unsigned level);
35: unsigned raiseipl(unsigned level);
36: int spl0(void);
37:
38: /* SPL asserts */
39: #ifdef DIAGNOSTIC
40: /*
41: * Although this function is implemented in MI code, it must be in this MD
42: * header because we don't want this header to include MI includes.
43: */
44: void splassert_fail(int, int, const char *);
45: extern int splassert_ctl;
46: void splassert_check(int, const char *);
47: #define splassert(__wantipl) do { \
48: if (splassert_ctl > 0) { \
49: splassert_check(__wantipl, __func__); \
50: } \
51: } while (0)
52: #else
53: #define splassert(wantipl) do { /* nothing */ } while (0)
54: #endif
55:
56: #endif /* _LOCORE */
57:
58: #define splsoftclock() raiseipl(IPL_SOFTCLOCK)
59: #define splsoftnet() raiseipl(IPL_SOFTNET)
60: #define splbio() raiseipl(IPL_BIO)
61: #define splnet() raiseipl(IPL_NET)
62: #define spltty() raiseipl(IPL_TTY)
63: #define splclock() raiseipl(IPL_CLOCK)
64: #define splstatclock() raiseipl(IPL_STATCLOCK)
65: #define splsched() raiseipl(IPL_SCHED)
66: #define splvm() raiseipl(IPL_VM)
67: #define splhigh() setipl(IPL_HIGH)
68:
69: #define spllock() splhigh()
70:
71: #define splx(x) ((x) ? setipl((x)) : spl0())
72:
73: #endif /* _KERNEL */
74: #endif /* _M88K_INTR_H_ */
CVSweb