/*
* Copyright (c) 1996-1999 Eduardo Horvath
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*
*/
/* beginning of `user' vectors (from trap instructions) - all priority 16 */
#define T_SUN_SYSCALL 0x100 /* system call */
#define T_BREAKPOINT 0x101 /* breakpoint `instruction' */
#define T_DIV0 0x102 /* division routine was handed 0 */
#define T_FLUSHWIN 0x103 /* flush windows */
#define T_CLEANWIN 0x104 /* provide clean windows */
#define T_RANGECHECK 0x105 /* ? */
#define T_FIXALIGN 0x106 /* fix up unaligned accesses */
#define T_INTOF 0x107 /* integer overflow ? */
#define T_BSD_SYSCALL 0x109 /* BSD system call */
#define T_KGDB_EXEC 0x10a /* for kernel gdb */
/* 0x10c..0x1ff are currently unallocated, except the following */
#define T_GETCC 0x132
#define T_SETCC 0x133
#define T_SVID_SYSCALL 0x164
#define T_SPARC_INTL_SYSCALL 0x165
#define T_OS_VENDOR_SYSCALL 0x166
#define T_HW_OEM_SYSCALL 0x167
#define T_RTF_DEF_TRAP 0x168
#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). Correct mask is 0xff for v9, but all values
* here are small enough - so keep it the same as the sparc port.
*/
#define ST_BREAKPOINT (T_BREAKPOINT & 0x7f)
#define ST_DIV0 (T_DIV0 & 0x7f)
#define ST_FLUSHWIN (T_FLUSHWIN & 0x7f)
#define ST_SYSCALL (T_SUN_SYSCALL & 0x7f)