/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* contributed to Berkeley.
*
* All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Lawrence Berkeley Laboratory.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)trap.h 8.1 (Berkeley) 6/11/93
*/
/*
* Sun4m support by Aaron Brown, Harvard University.
* Changes Copyright (c) 1995 The President and Fellows of Harvard College.
* All rights reserved.
*/
/* beginning of `user' vectors (from trap instructions) - all priority 12 */
#define T_SUN_SYSCALL 0x80 /* system call */
#define T_BREAKPOINT 0x81 /* breakpoint `instruction' */
#define T_DIV0 0x82 /* explicitly signal division by zero */
#define T_FLUSHWIN 0x83 /* flush windows */
#define T_CLEANWIN 0x84 /* request new windows to be cleaned */
#define T_RANGECHECK 0x85 /* explicitly signal a range checking error */
#define T_FIXALIGN 0x86 /* fix up unaligned accesses */
#define T_INTOF 0x87 /* explicitly signal integer overflow */
/* 0x89..0x8f - reserved for the OS */
#define T_BSD_SYSCALL 0x89 /* BSD system call */
#define T_KGDB_EXEC 0x8a /* for kernel gdb */
#define T_DBPAUSE 0x8b /* for smp kernel debugging */
/* 0x90..0x9f - reserved, will never be specified */
/* 0xa0..0xff are currently unallocated */
#ifdef _KERNEL /* pseudo traps for locore.s */
#define T_RWRET -1 /* need first user window for trap return */
#define T_AST -2 /* no-op, just needed reschedule or profile */
#endif
/* flags to system call (flags in %g1 along with syscall number) */
#define SYSCALL_G2RFLAG 0x400 /* on success, return to %g2 rather than npc */
#define SYSCALL_G7RFLAG 0x800 /* use %g7 as above (deprecated) */
#define SYSCALL_G5RFLAG 0xc00 /* use %g5 as above (only ABI compatible way) */
/*
* `software trap' macros to keep people happy (sparc v8 manual says not
* to set the upper bits).
*/
#define ST_SYSCALL (T_SUN_SYSCALL & 0x7f)
#define ST_BREAKPOINT (T_BREAKPOINT & 0x7f)
#define ST_DIV0 (T_DIV0 & 0x7f)
#define ST_FLUSHWIN (T_FLUSHWIN & 0x7f)