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