1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #if !defined(QUIET_UNUSED)
20 struct _fault_register {
21
22 bool ILL_OP;
23 bool ILL_MOD;
24 bool ILL_SLV;
25 bool ILL_PROC;
26 bool NEM;
27 bool OOB;
28 bool ILL_DIG;
29 bool PROC_PARU;
30 bool PROC_PARL;
31 bool CON_A;
32 bool CON_B;
33 bool CON_C;
34 bool CON_D;
35 bool DA_ERR;
36
37 bool DA_ERR2;
38
39 int IA_A;
40 int IA_B;
41 int IA_C;
42 int IA_D;
43 bool CPAR_DIV;
44 bool CPAR_STR;
45 bool CPAR_IA;
46
47 bool CPAR_BLK;
48
49
50
51 bool PORT_A;
52 bool PORT_B;
53 bool PORT_C;
54 bool PORT_D;
55
56 bool CPD;
57
58
59
60 bool LEVEL_0;
61 bool LEVEL_1;
62 bool LEVEL_2;
63 bool LEVEL_3;
64
65
66 bool CDD;
67
68 bool PAR_SDWAM;
69 bool PAR_PTWAM;
70 };
71
72 struct dps8faults
73 {
74 int fault_number;
75 int fault_address;
76 const char *fault_mnemonic;
77 const char *fault_name;
78 int fault_priority;
79 int fault_group;
80 };
81 typedef struct dps8faults dps8faults;
82 #endif
83
84 extern char * faultNames [N_FAULTS];
85 void check_events (void);
86 void clearFaultCycle (cpu_state_t * cpup);
87 void emCallReportFault (void);
88
89 void cu_safe_restore (cpu_state_t * cpup);
90
91 NO_RETURN void doG7Fault(cpu_state_t * cpup, bool allowTR);
92
93 #if defined(NEED_128)
94 # define fst_zero (_fault_subtype) {.bits=0}
95 # define fst_acv9 (_fault_subtype) {.fault_acv_subtype=ACV9}
96 # define fst_acv15 (_fault_subtype) {.fault_acv_subtype=ACV15}
97 # define fst_ill_mod (_fault_subtype) {.fault_ipr_subtype=FR_ILL_MOD}
98 # define fst_ill_proc (_fault_subtype) {.fault_ipr_subtype=FR_ILL_PROC}
99 # define fst_ill_dig (_fault_subtype) {.fault_ipr_subtype=FR_ILL_DIG}
100 # define fst_ill_op (_fault_subtype) {.fault_ipr_subtype=FR_ILL_OP}
101 # define fst_str_oob (_fault_subtype) {.fault_str_subtype=flt_str_oob}
102 # define fst_str_nea (_fault_subtype) {.fault_str_subtype=flt_str_nea}
103 # define fst_str_ptr (_fault_subtype) {.fault_str_subtype=flt_str_ill_ptr}
104 # define fst_cmd_lprpn (_fault_subtype) {.fault_cmd_subtype=flt_cmd_lprpn_bits}
105 # define fst_cmd_ctl (_fault_subtype) {.fault_cmd_subtype=flt_cmd_not_control}
106 # define fst_onc_nem (_fault_subtype) {.fault_onc_subtype=flt_onc_nem}
107 #else
108 extern const _fault_subtype fst_zero;
109 extern const _fault_subtype fst_acv9;
110 extern const _fault_subtype fst_acv15;
111 extern const _fault_subtype fst_ill_mod;
112 extern const _fault_subtype fst_ill_proc;
113 extern const _fault_subtype fst_ill_dig;
114 extern const _fault_subtype fst_ill_op;
115 extern const _fault_subtype fst_str_oob;
116 extern const _fault_subtype fst_str_nea;
117 extern const _fault_subtype fst_str_ptr;
118 extern const _fault_subtype fst_cmd_lprpn;
119 extern const _fault_subtype fst_cmd_ctl;
120 extern const _fault_subtype fst_onc_nem;
121 #endif
122
123 NO_RETURN void doFault (_fault faultNumber, _fault_subtype faultSubtype,
124 const char * faultMsg);
125 void dlyDoFault (_fault faultNumber, _fault_subtype subFault,
126 const char * faultMsg);
127 bool bG7PendingNoTRO (cpu_state_t * cpup);
128 bool bG7Pending (cpu_state_t * cpup);
129 void setG7fault (uint cpuNo, _fault faultNo, _fault_subtype subFault);
130
131 void clearTROFault (cpu_state_t * cpup);
132 void advanceG7Faults (cpu_state_t * cpup);
133 void set_FFV_fault (cpu_state_t * cpup, uint f_fault_no);
134 void do_FFV_fault (cpu_state_t * cpup, uint fault_number, const char * fault_msg);