1 /* $NetBSD: intr.h,v 1.14 2005/12/11 12:16:36 christos Exp $ */ 2 3 /*- 4 * Copyright (c) 1997 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Ignatios Souvatzis. 9 * 10 * Redistribution and use in source and binary forms, with or without 11 * modification, are permitted provided that the following conditions 12 * are met: 13 * 1. Redistributions of source code must retain the above copyright 14 * notice, this list of conditions and the following disclaimer. 15 * 2. Redistributions in binary form must reproduce the above copyright 16 * notice, this list of conditions and the following disclaimer in the 17 * documentation and/or other materials provided with the distribution. 18 * 3. All advertising materials mentioning features or use of this software 19 * must display the following acknowledgement: 20 * This product includes software developed by the NetBSD 21 * Foundation, Inc. and its contributors. 22 * 4. Neither the name of The NetBSD Foundation nor the names of its 23 * contributors may be used to endorse or promote products derived 24 * from this software without specific prior written permission. 25 * 26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 36 * POSSIBILITY OF SUCH DAMAGE. 37 */ 38 39 /* 40 * machine/intr.h for the Amiga port. 41 * Currently, only a wrapper, for most of the stuff, around the old 42 * include files. 43 */ 44 45 #ifndef _MACHINE_INTR_H_ 46 #define _MACHINE_INTR_H_ 47 48 #include <amiga/amiga/isr.h> 49 #include <amiga/include/mtpr.h> 50 #include <m68k/psl.h> 51 52 #define IPL_SOFTCLOCK 1 53 #define IPL_SOFTSERIAL 1 54 #define IPL_SOFTNET 1 55 56 /* not used yet, should reflect psl.h */ 57 #define IPL_BIO 3 58 #define IPL_NET 3 59 #define IPL_SERIAL 4 60 #define IPL_TTY 4 61 62 63 #ifdef splaudio 64 #undef splaudio 65 #define splaudio spl6 66 #endif 67 68 #define spllpt() spl6() 69 70 #if !defined(_LKM) 71 #include "opt_lev6_defer.h" 72 #endif 73 74 #define spl0() _spl0() /* we have real software interrupts */ 75 76 #define splnone() spl0() 77 #define spllowersoftclock() spl1() 78 79 #define splsoftclock() splraise1() 80 #define splsoftnet() splraise1() 81 #define splbio() splraise3() 82 #define splnet() splraise3() 83 84 /* 85 * splserial hack, idea by Jason Thorpe. 86 * drivers which need it (at the present only the coms) raise the variable to 87 * their serial interrupt level. 88 * 89 * serialspl is statically initialized in machdep.c at the moment; should 90 * be some driver independent file. 91 */ 92 93 extern uint16_t amiga_serialspl; 94 95 #define splserial() _splraise(amiga_serialspl) 96 #define spltty() splraise4() 97 #define splvm() splraise4() 98 99 #ifndef _LKM 100 101 #ifndef LEV6_DEFER 102 #define splclock() splraise6() 103 #define splstatclock() splraise6() 104 #define splhigh() spl7() 105 #define splsched() spl7() 106 #define spllock() spl7() 107 #else 108 #define splclock() splraise4() 109 #define splstatclock() splraise4() 110 #define splhigh() splraise4() 111 #define splsched() splraise4() 112 #define spllock() splraise4() 113 #endif 114 115 #else /* _LKM */ 116 117 extern int _spllkm6(void); 118 extern int _spllkm7(void); 119 120 #define splclock() _spllkm6() 121 #define splstatclock() _spllkm6() 122 #define spllock() _spllkm7() 123 #define splhigh() _spllkm7() 124 #define splsched() _spllkm7() 125 126 #endif /* _LKM */ 127 128 #define splx(s) _spl(s) 129 130 #endif 131