1 /* $NetBSD: vector.c,v 1.2 2001/11/26 18:08:37 fredette Exp $ */ 2 3 /*- 4 * Copyright (c) 1996 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Adam Glass and Gordon W. Ross. 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 * The interrupt vector table. 41 */ 42 43 #include "opt_compat_netbsd.h" 44 #include "opt_compat_sunos.h" 45 46 #include <sys/param.h> 47 #include <sys/systm.h> 48 49 #include "vector.h" 50 51 #define BADTRAP16 badtrap, badtrap, badtrap, badtrap, \ 52 badtrap, badtrap, badtrap, badtrap, \ 53 badtrap, badtrap, badtrap, badtrap, \ 54 badtrap, badtrap, badtrap, badtrap 55 56 #define fpbsun fpfault 57 #define fpdz fpfault 58 #define fpinex fpfault 59 #define fpoperr fpfault 60 #define fpovfl fpfault 61 #define fpsnan fpfault 62 #define fpunfl fpfault 63 64 void *vector_table[NVECTORS] = { 65 (void*)0xfffe000, /* 0: NOT USED (reset SP) */ 66 (void*)0xfef0000, /* 1: NOT USED (reset PC) */ 67 buserr, /* 2: bus error */ 68 addrerr, /* 3: address error */ 69 illinst, /* 4: illegal instruction */ 70 zerodiv, /* 5: zero divide */ 71 chkinst, /* 6: CHK instruction */ 72 trapvinst, /* 7: TRAPV instruction */ 73 privinst, /* 8: privilege violation */ 74 trace, /* 9: trace (single-step) */ 75 illinst, /* 10: line 1010 emulator */ 76 fpfline, /* 11: line 1111 emulator */ 77 badtrap, /* 12: unassigned, reserved */ 78 coperr, /* 13: coprocessor protocol violatio */ 79 fmterr, /* 14: format error */ 80 badtrap, /* 15: uninitialized interrupt vecto */ 81 badtrap, /* 16: unassigned, reserved */ 82 badtrap, /* 17: unassigned, reserved */ 83 badtrap, /* 18: unassigned, reserved */ 84 badtrap, /* 19: unassigned, reserved */ 85 badtrap, /* 20: unassigned, reserved */ 86 badtrap, /* 21: unassigned, reserved */ 87 badtrap, /* 22: unassigned, reserved */ 88 badtrap, /* 23: unassigned, reserved */ 89 _isr_autovec, /* 24: spurious interrupt */ 90 _isr_autovec, /* 25: level 1 interrupt autovector */ 91 _isr_autovec, /* 26: level 2 interrupt autovector */ 92 _isr_autovec, /* 27: level 3 interrupt autovector */ 93 _isr_autovec, /* 28: level 4 interrupt autovector */ 94 _isr_autovec, /* 29: level 5 interrupt autovector */ 95 _isr_autovec, /* 30: level 6 interrupt autovector */ 96 _isr_autovec, /* 31: level 7 interrupt autovector */ 97 trap0, /* 32: syscalls */ 98 #if defined(COMPAT_13) || defined(COMPAT_SUNOS) 99 trap1, /* 33: compat_13_sigreturn */ 100 #else 101 illinst, 102 #endif 103 trap2, /* 34: trace */ 104 trap3, /* 35: sigreturn special syscall */ 105 illinst, /* 36: TRAP instruction vector */ 106 illinst, /* 37: TRAP instruction vector */ 107 illinst, /* 38: TRAP instruction vector */ 108 illinst, /* 39: TRAP instruction vector */ 109 illinst, /* 40: TRAP instruction vector */ 110 illinst, /* 41: TRAP instruction vector */ 111 illinst, /* 42: TRAP instruction vector */ 112 illinst, /* 43: TRAP instruction vector */ 113 trap12, /* 44: TRAP 12: cachectl */ 114 illinst, /* 45: TRAP instruction vector */ 115 illinst, /* 46: TRAP instruction vector */ 116 trap15, /* 47: TRAP 15: breakpoint */ 117 fpbsun, /* 48: FPCP branch/set on unordered */ 118 fpinex, /* 49: FPCP inexact result */ 119 fpdz, /* 50: FPCP divide by zero */ 120 fpunfl, /* 51: FPCP underflow */ 121 fpoperr, /* 52: FPCP operand error */ 122 fpovfl, /* 53: FPCP overflow */ 123 fpsnan, /* 54: FPCP signalling NAN */ 124 fpunsupp, /* 55: FPCP unimplemented data type */ 125 badtrap, /* 56: unassigned, reserved */ 126 badtrap, /* 57: unassigned, reserved */ 127 badtrap, /* 58: unassigned, reserved */ 128 badtrap, /* 59: unassigned, reserved */ 129 badtrap, /* 60: unassigned, reserved */ 130 badtrap, /* 61: unassigned, reserved */ 131 badtrap, /* 62: unassigned, reserved */ 132 badtrap, /* 63: unassigned, reserved */ 133 134 /* 64-255: set later by isr_add_vectored() */ 135 136 BADTRAP16, BADTRAP16, BADTRAP16, BADTRAP16, 137 BADTRAP16, BADTRAP16, BADTRAP16, BADTRAP16, 138 BADTRAP16, BADTRAP16, BADTRAP16, BADTRAP16, 139 }; 140