File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 25
25
26
26
void cpu_loop (CPUMBState * env )
27
27
{
28
+ int trapnr , ret , si_code , sig ;
28
29
CPUState * cs = env_cpu (env );
29
- int trapnr , ret , si_code ;
30
30
31
31
while (1 ) {
32
32
cpu_exec_start (cs );
@@ -76,6 +76,7 @@ void cpu_loop(CPUMBState *env)
76
76
env -> iflags &= ~(IMM_FLAG | D_FLAG );
77
77
switch (env -> esr & 31 ) {
78
78
case ESR_EC_DIVZERO :
79
+ sig = TARGET_SIGFPE ;
79
80
si_code = TARGET_FPE_INTDIV ;
80
81
break ;
81
82
case ESR_EC_FPU :
@@ -84,6 +85,7 @@ void cpu_loop(CPUMBState *env)
84
85
* if there's no recognized bit set. Possibly this
85
86
* implies that si_code is 0, but follow the structure.
86
87
*/
88
+ sig = TARGET_SIGFPE ;
87
89
si_code = env -> fsr ;
88
90
if (si_code & FSR_IO ) {
89
91
si_code = TARGET_FPE_FLTINV ;
@@ -97,13 +99,17 @@ void cpu_loop(CPUMBState *env)
97
99
si_code = TARGET_FPE_FLTRES ;
98
100
}
99
101
break ;
102
+ case ESR_EC_PRIVINSN :
103
+ sig = SIGILL ;
104
+ si_code = ILL_PRVOPC ;
105
+ break ;
100
106
default :
101
107
fprintf (stderr , "Unhandled hw-exception: 0x%x\n" ,
102
108
env -> esr & ESR_EC_MASK );
103
109
cpu_dump_state (cs , stderr , 0 );
104
110
exit (EXIT_FAILURE );
105
111
}
106
- force_sig_fault (TARGET_SIGFPE , si_code , env -> pc );
112
+ force_sig_fault (sig , si_code , env -> pc );
107
113
break ;
108
114
109
115
case EXCP_DEBUG :
You can’t perform that action at this time.
0 commit comments