Commit d10927f86bd2458fd154fc5a8b529d7e54846c14
1 parent
8b6e0729
Add missing cpu_halted function, by Magnus Damm.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2998 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
11 additions
and
0 deletions
target-sh4/cpu.h
| ... | ... | @@ -114,6 +114,7 @@ typedef struct CPUSH4State { |
| 114 | 114 | jmp_buf jmp_env; |
| 115 | 115 | int user_mode_only; |
| 116 | 116 | int interrupt_request; |
| 117 | + int halted; | |
| 117 | 118 | int exception_index; |
| 118 | 119 | CPU_COMMON tlb_t utlb[UTLB_SIZE]; /* unified translation table */ |
| 119 | 120 | tlb_t itlb[ITLB_SIZE]; /* instruction translation table */ | ... | ... |
target-sh4/exec.h
| ... | ... | @@ -36,6 +36,16 @@ register uint32_t T1 asm(AREG2); |
| 36 | 36 | #include "cpu.h" |
| 37 | 37 | #include "exec-all.h" |
| 38 | 38 | |
| 39 | +static inline int cpu_halted(CPUState *env) { | |
| 40 | + if (!env->halted) | |
| 41 | + return 0; | |
| 42 | + if (env->interrupt_request & CPU_INTERRUPT_HARD) { | |
| 43 | + env->halted = 0; | |
| 44 | + return 0; | |
| 45 | + } | |
| 46 | + return EXCP_HALTED; | |
| 47 | +} | |
| 48 | + | |
| 39 | 49 | #ifndef CONFIG_USER_ONLY |
| 40 | 50 | #include "softmmu_exec.h" |
| 41 | 51 | #endif | ... | ... |