Revision 9fddaa0c target-ppc/op_helper.c
b/target-ppc/op_helper.c | ||
---|---|---|
31 | 31 |
|
32 | 32 |
/*****************************************************************************/ |
33 | 33 |
/* Exceptions processing helpers */ |
34 |
void do_queue_exception_err (uint32_t exception, int error_code)
|
|
34 |
void cpu_loop_exit(void)
|
|
35 | 35 |
{ |
36 |
/* Queue real PPC exceptions */ |
|
37 |
if (exception < EXCP_PPC_MAX) { |
|
38 |
env->exceptions |= 1 << exception; |
|
39 |
env->errors[exception] = error_code; |
|
40 |
} else { |
|
41 |
/* Preserve compatibility with qemu core */ |
|
42 |
env->exceptions |= 1; |
|
43 |
env->exception_index = exception; |
|
44 |
env->error_code = error_code; |
|
45 |
} |
|
36 |
longjmp(env->jmp_env, 1); |
|
46 | 37 |
} |
47 | 38 |
|
48 |
void do_queue_exception (uint32_t exception)
|
|
39 |
void do_raise_exception_err (uint32_t exception, int error_code)
|
|
49 | 40 |
{ |
50 |
do_queue_exception_err(exception, 0); |
|
51 |
} |
|
52 |
|
|
53 |
void do_check_exception_state (void) |
|
54 |
{ |
|
55 |
if ((env->exceptions & 1) == 1 || check_exception_state(env)) { |
|
56 |
env->exceptions &= ~1; |
|
41 |
#if 0 |
|
42 |
printf("Raise exception %3x code : %d\n", exception, error_code); |
|
43 |
#endif |
|
44 |
switch (exception) { |
|
45 |
case EXCP_EXTERNAL: |
|
46 |
case EXCP_DECR: |
|
47 |
printf("DECREMENTER & EXTERNAL exceptions should be hard interrupts !\n"); |
|
48 |
if (msr_ee == 0) |
|
49 |
return; |
|
50 |
break; |
|
51 |
case EXCP_PROGRAM: |
|
52 |
if (error_code == EXCP_FP && msr_fe0 == 0 && msr_fe1 == 0) |
|
53 |
return; |
|
54 |
break; |
|
55 |
default: |
|
56 |
break; |
|
57 |
} |
|
58 |
env->exception_index = exception; |
|
59 |
env->error_code = error_code; |
|
57 | 60 |
cpu_loop_exit(); |
58 | 61 |
} |
62 |
|
|
63 |
void do_raise_exception (uint32_t exception) |
|
64 |
{ |
|
65 |
do_raise_exception_err(exception, 0); |
|
59 | 66 |
} |
60 | 67 |
|
61 | 68 |
/*****************************************************************************/ |
... | ... | |
125 | 132 |
/* Flush all tlb when changing translation mode or privilege level */ |
126 | 133 |
do_tlbia(); |
127 | 134 |
} |
128 |
#if 0 |
|
129 |
if ((T0 >> MSR_IP) & 0x01) { |
|
130 |
printf("Halting CPU. Stop emulation\n"); |
|
131 |
do_queue_exception(EXCP_HLT); |
|
132 |
cpu_loop_exit(); |
|
133 |
} |
|
134 |
#endif |
|
135 | 135 |
msr_pow = (T0 >> MSR_POW) & 0x03; |
136 | 136 |
msr_ile = (T0 >> MSR_ILE) & 0x01; |
137 | 137 |
msr_ee = (T0 >> MSR_EE) & 0x01; |
Also available in: Unified diff