From 26c0ce012cf1640acdb963e52e79a4b756dd59c3 Mon Sep 17 00:00:00 2001 From: ths Date: Fri, 22 Jun 2007 10:11:48 +0000 Subject: [PATCH] Add missing cpu_halted function, by Magnus Damm. --- target-sh4/cpu.h | 1 + target-sh4/exec.h | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/target-sh4/cpu.h b/target-sh4/cpu.h index 00ee062680..4f25b6cafa 100644 --- a/target-sh4/cpu.h +++ b/target-sh4/cpu.h @@ -114,6 +114,7 @@ typedef struct CPUSH4State { jmp_buf jmp_env; int user_mode_only; int interrupt_request; + int halted; int exception_index; CPU_COMMON tlb_t utlb[UTLB_SIZE]; /* unified translation table */ tlb_t itlb[ITLB_SIZE]; /* instruction translation table */ diff --git a/target-sh4/exec.h b/target-sh4/exec.h index 3563300307..84f29319e2 100644 --- a/target-sh4/exec.h +++ b/target-sh4/exec.h @@ -36,6 +36,16 @@ register uint32_t T1 asm(AREG2); #include "cpu.h" #include "exec-all.h" +static inline int cpu_halted(CPUState *env) { + if (!env->halted) + return 0; + if (env->interrupt_request & CPU_INTERRUPT_HARD) { + env->halted = 0; + return 0; + } + return EXCP_HALTED; +} + #ifndef CONFIG_USER_ONLY #include "softmmu_exec.h" #endif -- 2.11.4.GIT