]>
Commit | Line | Data |
---|---|---|
c14d22a7 DE |
1 | /* sparc64 trap definitions |
2 | Copyright (C) 1999 Cygnus Solutions. */ | |
3 | ||
4 | #ifndef TRAP64_H | |
5 | #define TRAP64_H | |
6 | ||
7 | /* D1.2.4 page 107 */ | |
8 | ||
9 | typedef enum | |
10 | { | |
11 | TRAP64_POWER_ON_RESET = 1, | |
12 | TRAP64_WATCHDOG_RESET = 2, | |
13 | TRAP64_EXTERNALLY_INITIATED_RESET = 3, | |
14 | TRAP64_SOFTWARE_INITIATED_RESET = 4, | |
15 | TRAP64_RED_STATE_EXCEPTION = 5, | |
16 | TRAP64_INSN_ACCESS_EXCEPTION = 8, | |
17 | TRAP64_INSN_ACCESS_MMU_MISS = 9, | |
18 | TRAP64_INSN_ACCESS_ERROR = 10, | |
19 | TRAP64_ILLEGAL_INSN = 16, | |
20 | TRAP64_PRIVILEDGED_OPCODE = 17, | |
21 | TRAP64_UNIMPLEMENTED_LDD = 18, | |
22 | TRAP64_UNIMPLEMENTED_STD = 19, | |
23 | TRAP64_FP_DISABLED = 32, | |
24 | TRAP64_FP_EXCEPTION_IEEE_754 = 33, | |
25 | TRAP64_FP_EXCEPTION_OTHER = 34, | |
26 | TRAP64_TAG_OVERFLOW = 35, | |
27 | TRAP64_CLEAN_WINDOW = 36, | |
28 | TRAP64_DIVISION_BY_ZERO = 40, | |
29 | TRAP64_INTERNAL_PROCESSOR_ERROR = 41, | |
30 | TRAP64_DATA_ACCESS_EXCEPTION = 48, | |
31 | TRAP64_DATA_ACCESS_MMU_MISS = 49, | |
32 | TRAP64_DATA_ACCESS_ERROR = 50, | |
33 | TRAP64_DATA_ACCESS_PROTECTION = 51, | |
34 | TRAP64_MEM_ADDRESS_NOT_ALIGNED = 52, | |
35 | TRAP64_LDDF_MEM_ADDRESS_NOT_ALIGNED = 53, /* impdep # 109 */ | |
36 | TRAP64_STDF_MEM_ADDRESS_NOT_ALIGNED = 54, /* impdep # 110 */ | |
37 | TRAP64_PRIVILEDGED_ACTION = 55, | |
38 | TRAP64_LDQF_MEM_ADDRESS_NOT_ALIGNED = 56, /* impdep # 111 */ | |
39 | TRAP64_STQF_MEM_ADDRESS_NOT_ALIGNED = 57, /* impdep # 112 */ | |
40 | TRAP64_ASYNC_DATA_ERROR = 64, | |
41 | TRAP64_INTERRUPT_LEVEL_0 = 65, /* n = 1..15 */ | |
42 | TRAP64_IMPDEP_EXCEPTION_0 = 96, /* n = 0..31 */ | |
43 | ||
44 | /* IMPDEP codes used by the simulator in ENVIRONMENT_USER. */ | |
45 | TRAP64_SIM_UNIMPLEMENTED_OPCODE = 124, | |
46 | TRAP64_SIM_RESERVED_INSN = 125, | |
47 | TRAP64_SIM_SPILL = 126, | |
48 | TRAP64_SIM_FILL = 127, | |
49 | ||
50 | TRAP64_SPILL_0_NORMAL = 128, /* n = 0..7 */ | |
51 | TRAP64_SPILL_0_OTHER = 160, /* n = 0..7 */ | |
52 | TRAP64_FILL_0_NORMAL = 192, /* n = 0..7 */ | |
53 | TRAP64_FILL_0_OTHER = 224, /* n = 0..7 */ | |
54 | TRAP64_INSTRUCTION = 256, /* n = 0..127 */ | |
55 | TRAP64_BREAKPOINT = 257, /* convention */ | |
56 | TRAP64_MAX = 0x17f | |
57 | } TRAP64_TYPE; | |
58 | ||
59 | #define MAX_NUM_TRAPS 1024 | |
60 | ||
61 | #define TRAP64_TABLE_SIZE (32 * MAX_NUM_TRAPS) /* in bytes */ | |
62 | ||
63 | /* We record the fact that the cpu is in error state by setting TL to be | |
64 | something greater than MAXTL, usually MAXTL+1. */ | |
65 | ||
66 | #define ERROR_STATE_P() (GET_TL () > MAXTL) | |
67 | ||
68 | #if 0 | |
69 | fastint trap (trap_type_e); | |
70 | int trap_priority (trap_type_e); | |
71 | ||
72 | fastint reserved (void); | |
73 | fastint deprecated (void); | |
74 | fastint not_impl (void); | |
75 | fastint illegal (void); | |
76 | fastint priviledged (void); | |
77 | fastint unimp_fpop (void); | |
78 | fastint fp_disabled (void); | |
79 | ||
80 | /* When running user level programs, we supply all the necessary trap handlers. | |
81 | These handlers run on the host, not in the emulation environment. */ | |
82 | ||
83 | typedef fastint (trap_handler_t) (void); | |
84 | #endif | |
85 | ||
86 | #endif /* TRAP64_H */ |