1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright 2003 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate #ifndef _SYS_MACHTRAP_H 28*7c478bd9Sstevel@tonic-gate #define _SYS_MACHTRAP_H 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*7c478bd9Sstevel@tonic-gate 32*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 33*7c478bd9Sstevel@tonic-gate extern "C" { 34*7c478bd9Sstevel@tonic-gate #endif 35*7c478bd9Sstevel@tonic-gate 36*7c478bd9Sstevel@tonic-gate /* 37*7c478bd9Sstevel@tonic-gate * This file is machine specific as is. 38*7c478bd9Sstevel@tonic-gate * Some trap types could be made common 39*7c478bd9Sstevel@tonic-gate * for all sparcs, but that is a project 40*7c478bd9Sstevel@tonic-gate * in and of itself. 41*7c478bd9Sstevel@tonic-gate */ 42*7c478bd9Sstevel@tonic-gate 43*7c478bd9Sstevel@tonic-gate /* 44*7c478bd9Sstevel@tonic-gate * Trap type values. 45*7c478bd9Sstevel@tonic-gate */ 46*7c478bd9Sstevel@tonic-gate #define TT(X) ((X)<<4) 47*7c478bd9Sstevel@tonic-gate 48*7c478bd9Sstevel@tonic-gate /* 49*7c478bd9Sstevel@tonic-gate * The Coprocessor bit. 50*7c478bd9Sstevel@tonic-gate */ 51*7c478bd9Sstevel@tonic-gate #define CP_BIT 0x20 52*7c478bd9Sstevel@tonic-gate 53*7c478bd9Sstevel@tonic-gate /* 54*7c478bd9Sstevel@tonic-gate * Hardware traps. 55*7c478bd9Sstevel@tonic-gate */ 56*7c478bd9Sstevel@tonic-gate #define T_RESET 0x00 57*7c478bd9Sstevel@tonic-gate #define T_TEXT_FAULT 0x01 58*7c478bd9Sstevel@tonic-gate #define T_UNIMP_INSTR 0x02 59*7c478bd9Sstevel@tonic-gate #define T_PRIV_INSTR 0x03 60*7c478bd9Sstevel@tonic-gate #define T_FP_DISABLED 0x04 61*7c478bd9Sstevel@tonic-gate #define T_CP_DISABLED (0x4 | CP_BIT) 62*7c478bd9Sstevel@tonic-gate #define T_WIN_OVERFLOW 0x05 63*7c478bd9Sstevel@tonic-gate #define T_WIN_UNDERFLOW 0x06 64*7c478bd9Sstevel@tonic-gate #define T_ALIGNMENT 0x07 65*7c478bd9Sstevel@tonic-gate #define T_FP_EXCEPTION 0x08 66*7c478bd9Sstevel@tonic-gate #define T_CP_EXCEPTION (0x8 | CP_BIT) 67*7c478bd9Sstevel@tonic-gate #define T_DATA_FAULT 0x09 68*7c478bd9Sstevel@tonic-gate #define T_TAG_OVERFLOW 0x0A 69*7c478bd9Sstevel@tonic-gate #define T_INT 0x10 70*7c478bd9Sstevel@tonic-gate #define T_INT_LEVEL 0x0F 71*7c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_1 0x11 72*7c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_2 0x12 73*7c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_3 0x13 74*7c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_4 0x14 75*7c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_5 0x15 76*7c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_6 0x16 77*7c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_7 0x17 78*7c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_8 0x18 79*7c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_9 0x19 80*7c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_10 0x1A 81*7c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_11 0x1B 82*7c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_12 0x1C 83*7c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_13 0x1D 84*7c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_14 0x1E 85*7c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_15 0x1F 86*7c478bd9Sstevel@tonic-gate #define T_TEXT_ERROR 0x21 87*7c478bd9Sstevel@tonic-gate #define T_UNIMP_FLUSH 0x25 /* IFLUSH - unimplemented flush */ 88*7c478bd9Sstevel@tonic-gate #define T_DATA_ERROR 0x29 89*7c478bd9Sstevel@tonic-gate #define T_IDIV0 0x2A 90*7c478bd9Sstevel@tonic-gate #define T_DATA_STORE 0x2B 91*7c478bd9Sstevel@tonic-gate 92*7c478bd9Sstevel@tonic-gate /* 93*7c478bd9Sstevel@tonic-gate * Software trap type values. 94*7c478bd9Sstevel@tonic-gate */ 95*7c478bd9Sstevel@tonic-gate #define T_SOFTWARE_TRAP 0x80 96*7c478bd9Sstevel@tonic-gate #define T_ESOFTWARE_TRAP 0xFF 97*7c478bd9Sstevel@tonic-gate #define T_OSYSCALL (T_SOFTWARE_TRAP + ST_OSYSCALL) 98*7c478bd9Sstevel@tonic-gate #define T_BREAKPOINT (T_SOFTWARE_TRAP + ST_BREAKPOINT) 99*7c478bd9Sstevel@tonic-gate #define T_DIV0 (T_SOFTWARE_TRAP + ST_DIV0) 100*7c478bd9Sstevel@tonic-gate #define T_FLUSH_WINDOWS (T_SOFTWARE_TRAP + ST_FLUSH_WINDOWS) 101*7c478bd9Sstevel@tonic-gate #define T_CLEAN_WINDOWS (T_SOFTWARE_TRAP + ST_CLEAN_WINDOWS) 102*7c478bd9Sstevel@tonic-gate #define T_RANGE_CHECK (T_SOFTWARE_TRAP + ST_RANGE_CHECK) 103*7c478bd9Sstevel@tonic-gate #define T_FIX_ALIGN (T_SOFTWARE_TRAP + ST_FIX_ALIGN) 104*7c478bd9Sstevel@tonic-gate #define T_INT_OVERFLOW (T_SOFTWARE_TRAP + ST_INT_OVERFLOW) 105*7c478bd9Sstevel@tonic-gate #define T_SYSCALL (T_SOFTWARE_TRAP + ST_SYSCALL) 106*7c478bd9Sstevel@tonic-gate 107*7c478bd9Sstevel@tonic-gate #define T_GETCC (T_SOFTWARE_TRAP + ST_GETCC) 108*7c478bd9Sstevel@tonic-gate #define T_SETCC (T_SOFTWARE_TRAP + ST_SETCC) 109*7c478bd9Sstevel@tonic-gate 110*7c478bd9Sstevel@tonic-gate 111*7c478bd9Sstevel@tonic-gate /* 112*7c478bd9Sstevel@tonic-gate * Pseudo traps. 113*7c478bd9Sstevel@tonic-gate */ 114*7c478bd9Sstevel@tonic-gate #define T_INTERRUPT 0x100 115*7c478bd9Sstevel@tonic-gate #define T_SPURIOUS (T_INTERRUPT | T_INT) 116*7c478bd9Sstevel@tonic-gate #define T_FAULT 0x200 117*7c478bd9Sstevel@tonic-gate #define T_AST 0x400 118*7c478bd9Sstevel@tonic-gate #define T_FLUSH_PCB (T_AST + 0x10) 119*7c478bd9Sstevel@tonic-gate #define T_SYS_RTT_PAGE (T_AST + 0x20) 120*7c478bd9Sstevel@tonic-gate #define T_ZERO 0x00 121*7c478bd9Sstevel@tonic-gate 122*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 123*7c478bd9Sstevel@tonic-gate } 124*7c478bd9Sstevel@tonic-gate #endif 125*7c478bd9Sstevel@tonic-gate 126*7c478bd9Sstevel@tonic-gate #endif /* _SYS_MACHTRAP_H */ 127