Annotation of sys/arch/sparc/include/trap.h, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: trap.h,v 1.5 2003/06/02 23:27:54 millert Exp $ */
! 2: /* $NetBSD: trap.h,v 1.9 1996/05/16 15:57:04 abrown Exp $ */
! 3:
! 4: /*
! 5: * Copyright (c) 1992, 1993
! 6: * The Regents of the University of California. All rights reserved.
! 7: *
! 8: * This software was developed by the Computer Systems Engineering group
! 9: * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
! 10: * contributed to Berkeley.
! 11: *
! 12: * All advertising materials mentioning features or use of this software
! 13: * must display the following acknowledgement:
! 14: * This product includes software developed by the University of
! 15: * California, Lawrence Berkeley Laboratory.
! 16: *
! 17: * Redistribution and use in source and binary forms, with or without
! 18: * modification, are permitted provided that the following conditions
! 19: * are met:
! 20: * 1. Redistributions of source code must retain the above copyright
! 21: * notice, this list of conditions and the following disclaimer.
! 22: * 2. Redistributions in binary form must reproduce the above copyright
! 23: * notice, this list of conditions and the following disclaimer in the
! 24: * documentation and/or other materials provided with the distribution.
! 25: * 3. Neither the name of the University nor the names of its contributors
! 26: * may be used to endorse or promote products derived from this software
! 27: * without specific prior written permission.
! 28: *
! 29: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
! 30: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! 31: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! 32: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
! 33: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! 34: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
! 35: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
! 36: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
! 37: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
! 38: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! 39: * SUCH DAMAGE.
! 40: *
! 41: * @(#)trap.h 8.1 (Berkeley) 6/11/93
! 42: */
! 43: /*
! 44: * Sun4m support by Aaron Brown, Harvard University.
! 45: * Changes Copyright (c) 1995 The President and Fellows of Harvard College.
! 46: * All rights reserved.
! 47: */
! 48:
! 49: #ifndef _MACHINE_TRAP_H
! 50: #define _MACHINE_TRAP_H
! 51:
! 52: /*
! 53: * vectors 0x00..0x1f are common to all sparc implementations, while
! 54: * vectors 0x20..0x2f are selectively implemented by some v8 cpu's
! 55: * either to support new instructions or simplify fault decoding.
! 56: * For sanity, these defines should match the layout of the trap
! 57: * table, but some cases may be treated in common. The priorities
! 58: * listed are correct, but the v8 traps been inserted "between levels".
! 59: */
! 60:
! 61: /* trap vec (pri) description */
! 62: #define T_RESET 0x00 /* (1) not actually vectored; jumps to 0 */
! 63: #define T_TEXTFAULT 0x01 /* (2) address fault during instr fetch */
! 64: #define T_ILLINST 0x02 /* (3) illegal instruction */
! 65: #define T_PRIVINST 0x03 /* (4) privileged instruction */
! 66: #define T_FPDISABLED 0x04 /* (5) fp instr while fp disabled */
! 67: #define T_WINOF 0x05 /* (6) register window overflow */
! 68: #define T_WINUF 0x06 /* (7) register window underflow */
! 69: #define T_ALIGN 0x07 /* (8) address not properly aligned */
! 70: #define T_FPE 0x08 /* (9) floating point exception */
! 71: #define T_DATAFAULT 0x09 /* (10) address fault during data fetch */
! 72: #define T_TAGOF 0x0a /* (11) tag overflow */
! 73: /* 0x0b unused */
! 74: /* 0x0c unused */
! 75: /* 0x0d unused */
! 76: /* 0x0e unused */
! 77: /* 0x0f unused */
! 78: /* 0x10 unused */
! 79: #define T_L1INT 0x11 /* (27) level 1 interrupt */
! 80: #define T_L2INT 0x12 /* (26) level 2 interrupt */
! 81: #define T_L3INT 0x13 /* (25) level 3 interrupt */
! 82: #define T_L4INT 0x14 /* (24) level 4 interrupt */
! 83: #define T_L5INT 0x15 /* (23) level 5 interrupt */
! 84: #define T_L6INT 0x16 /* (22) level 6 interrupt */
! 85: #define T_L7INT 0x17 /* (21) level 7 interrupt */
! 86: #define T_L8INT 0x18 /* (20) level 8 interrupt */
! 87: #define T_L9INT 0x19 /* (19) level 9 interrupt */
! 88: #define T_L10INT 0x1a /* (18) level 10 interrupt */
! 89: #define T_L11INT 0x1b /* (17) level 11 interrupt */
! 90: #define T_L12INT 0x1c /* (16) level 12 interrupt */
! 91: #define T_L13INT 0x1d /* (15) level 13 interrupt */
! 92: #define T_L14INT 0x1e /* (14) level 14 interrupt */
! 93: #define T_L15INT 0x1f /* (13) level 15 interrupt */
! 94: #define T_RREGERROR 0x20 /* (?) r-register access error (v8?) */
! 95: #define T_TEXTERROR 0x21 /* (<2) error during instruction access (v8) */
! 96: /* 0x22 unused */
! 97: /* through 0x23 unused */
! 98: #define T_CPDISABLED 0x24 /* (5) coprocessor instr while disabled */
! 99: /* 0x25 unused */
! 100: /* through 0x27 unused */
! 101: #define T_CPEXCEPTION 0x28 /* (9) coprocessor exception */
! 102: #define T_DATAERROR 0x29 /* (<9) error during data access (v8) */
! 103: #define T_IDIV0 0x2a /* (<11) integer divide by zero (v8) */
! 104: #define T_STOREBUFFAULT 0x2b /* SuperSPARC: Store buffer copy-back fault */
! 105: /* 0x2c unused */
! 106: /* through 0x7f unused */
! 107:
! 108: /* beginning of `user' vectors (from trap instructions) - all priority 12 */
! 109: #define T_SUN_SYSCALL 0x80 /* system call */
! 110: #define T_BREAKPOINT 0x81 /* breakpoint `instruction' */
! 111: #define T_DIV0 0x82 /* division routine was handed 0 */
! 112: #define T_FLUSHWIN 0x83 /* flush windows */
! 113: #define T_CLEANWIN 0x84 /* provide clean windows */
! 114: #define T_RANGECHECK 0x85 /* ? */
! 115: #define T_FIXALIGN 0x86 /* fix up unaligned accesses */
! 116: #define T_INTOF 0x87 /* integer overflow ? */
! 117: #define T_SVR4_SYSCALL 0x88 /* SVR4 system call */
! 118: #define T_BSD_SYSCALL 0x89 /* BSD system call */
! 119: #define T_KGDB_EXEC 0x8a /* for kernel gdb */
! 120:
! 121: /* 0x8b..0xff are currently unallocated, except the following */
! 122: #define T_SVR4_GETCC 0xa0
! 123: #define T_SVR4_SETCC 0xa1
! 124: #define T_SVR4_GETPSR 0xa2
! 125: #define T_SVR4_SETPSR 0xa3
! 126: #define T_SVR4_GETHRTIME 0xa4
! 127: #define T_SVR4_GETHRVTIME 0xa5
! 128: #define T_SVR4_GETHRESTIME 0xa7
! 129:
! 130:
! 131: #ifdef _KERNEL /* pseudo traps for locore.s */
! 132: #define T_RWRET -1 /* need first user window for trap return */
! 133: #define T_AST -2 /* no-op, just needed reschedule or profile */
! 134: #endif
! 135:
! 136: /* flags to system call (flags in %g1 along with syscall number) */
! 137: #define SYSCALL_G2RFLAG 0x400 /* on success, return to %g2 rather than npc */
! 138: #define SYSCALL_G7RFLAG 0x800 /* use %g7 as above (deprecated) */
! 139:
! 140: /*
! 141: * `software trap' macros to keep people happy (sparc v8 manual says not
! 142: * to set the upper bits).
! 143: */
! 144: #define ST_BREAKPOINT (T_BREAKPOINT & 0x7f)
! 145: #define ST_DIV0 (T_DIV0 & 0x7f)
! 146: #define ST_FLUSHWIN (T_FLUSHWIN & 0x7f)
! 147: #define ST_SYSCALL (T_SUN_SYSCALL & 0x7f)
! 148:
! 149: #endif /* _MACHINE_TRAP_H_ */
CVSweb