]> git.proxmox.com Git - qemu.git/commitdiff
inline cpu_halted into sole caller
authorPaolo Bonzini <pbonzini@redhat.com>
Sat, 12 Mar 2011 16:43:56 +0000 (17:43 +0100)
committerBlue Swirl <blauwirbel@gmail.com>
Sun, 13 Mar 2011 14:44:21 +0000 (14:44 +0000)
All implementations are now the same, and there is only one caller,
so inline the function there.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 files changed:
cpu-exec.c
target-alpha/exec.h
target-arm/exec.h
target-cris/exec.h
target-i386/exec.h
target-m68k/exec.h
target-microblaze/exec.h
target-mips/exec.h
target-ppc/exec.h
target-s390x/exec.h
target-sh4/exec.h
target-sparc/exec.h

index 70c3e5ae1bb04c5d4d46bbb9e0e68b2281d885ff..34eaedca04997abc944a2ccd9874d6685d8ae90b 100644 (file)
@@ -208,8 +208,13 @@ int cpu_exec(CPUState *env1)
     uint8_t *tc_ptr;
     unsigned long next_tb;
 
-    if (cpu_halted(env1) == EXCP_HALTED)
-        return EXCP_HALTED;
+    if (env1->halted) {
+        if (!cpu_has_work(env1)) {
+            return EXCP_HALTED;
+        }
+
+        env1->halted = 0;
+    }
 
     cpu_single_env = env1;
 
index a8a38d29f465af4f45da0fc506e12d93c5ba2f8e..6ae96d148b7a453ad4d8544d99d86fbaeab62b27 100644 (file)
@@ -42,17 +42,6 @@ static inline int cpu_has_work(CPUState *env)
     return (env->interrupt_request & CPU_INTERRUPT_HARD);
 }
 
-static inline int cpu_halted(CPUState *env)
-{
-    if (!env->halted)
-        return 0;
-    if (cpu_has_work(env)) {
-        env->halted = 0;
-        return 0;
-    }
-    return EXCP_HALTED;
-}
-
 static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
 {
     env->pc = tb->pc;
index e4c35a33ebbd670146db6a87511c9586eb107259..44e1b55aa2e24b5cbfc067b25fe2d524f91dd77f 100644 (file)
@@ -32,19 +32,6 @@ static inline int cpu_has_work(CPUState *env)
             (CPU_INTERRUPT_FIQ | CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB));
 }
 
-static inline int cpu_halted(CPUState *env) {
-    if (!env->halted)
-        return 0;
-    /* An interrupt wakes the CPU even if the I and F CPSR bits are
-       set.  We use EXITTB to silently wake CPU without causing an
-       actual interrupt.  */
-    if (cpu_has_work(env)) {
-        env->halted = 0;
-        return 0;
-    }
-    return EXCP_HALTED;
-}
-
 #if !defined(CONFIG_USER_ONLY)
 #include "softmmu_exec.h"
 #endif
index 34c0132ce9b934290f8ba661f2e5ca6af8287e94..2d5d297e1b125be486bee07406e50e05c5c510ef 100644 (file)
@@ -33,17 +33,6 @@ static inline int cpu_has_work(CPUState *env)
     return (env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI));
 }
 
-static inline int cpu_halted(CPUState *env) {
-       if (!env->halted)
-               return 0;
-
-       if (cpu_has_work(env)) {
-               env->halted = 0;
-               return 0;
-       }
-       return EXCP_HALTED;
-}
-
 static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
 {
     env->pc = tb->pc;
index fc8945b964d8d98e2da03241f04a8a435225ef95..3e7386e91c7a3f0dac85c16ba6d17b3aff6c4266 100644 (file)
@@ -304,18 +304,6 @@ static inline int cpu_has_work(CPUState *env)
     return work;
 }
 
-static inline int cpu_halted(CPUState *env) {
-    /* handle exit of HALTED state */
-    if (!env->halted)
-        return 0;
-    /* disable halt condition */
-    if (cpu_has_work(env)) {
-        env->halted = 0;
-        return 0;
-    }
-    return EXCP_HALTED;
-}
-
 /* load efer and update the corresponding hflags. XXX: do consistency
    checks with cpuid bits ? */
 static inline void cpu_load_efer(CPUState *env, uint64_t val)
index f31e06ed95cf3f71cfac3712413576aad65285f9..91daa6bac47c6ef31d1e6aca39254af31c27a6ca 100644 (file)
@@ -33,16 +33,6 @@ static inline int cpu_has_work(CPUState *env)
     return (env->interrupt_request & (CPU_INTERRUPT_HARD));
 }
 
-static inline int cpu_halted(CPUState *env) {
-    if (!env->halted)
-        return 0;
-    if (cpu_has_work(env)) {
-        env->halted = 0;
-        return 0;
-    }
-    return EXCP_HALTED;
-}
-
 static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
 {
     env->pc = tb->pc;
index ab198284774bffa6c731765b3ad7480094b96020..1efff30620a769bb90b55ea1dcc9a4e2ba16d434 100644 (file)
@@ -32,17 +32,6 @@ static inline int cpu_has_work(CPUState *env)
     return (env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI));
 }
 
-static inline int cpu_halted(CPUState *env) {
-       if (!env->halted)
-               return 0;
-
-       if (cpu_has_work(env)) {
-               env->halted = 0;
-               return 0;
-       }
-       return EXCP_HALTED;
-}
-
 static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
 {
     env->sregs[SR_PC] = tb->pc;
index 12736543acae8c37fc6bf5f8fbf1a78a283b4019..b3c5a13f561fc187ed370f3ff9c0b805bea0c2ce 100644 (file)
@@ -36,17 +36,6 @@ static inline int cpu_has_work(CPUState *env)
     return has_work;
 }
 
-static inline int cpu_halted(CPUState *env)
-{
-    if (!env->halted)
-        return 0;
-    if (cpu_has_work(env)) {
-        env->halted = 0;
-        return 0;
-    }
-    return EXCP_HALTED;
-}
-
 static inline void compute_hflags(CPUState *env)
 {
     env->hflags &= ~(MIPS_HFLAG_COP1X | MIPS_HFLAG_64 | MIPS_HFLAG_CP0 |
index 4688ef5710a9e1405f9415ae2e5277c066755992..f87847acb1ba86b7ff46a9a69c111346d05249e5 100644 (file)
@@ -38,17 +38,6 @@ static inline int cpu_has_work(CPUState *env)
 }
 
 
-static inline int cpu_halted(CPUState *env)
-{
-    if (!env->halted)
-        return 0;
-    if (cpu_has_work(env)) {
-        env->halted = 0;
-        return 0;
-    }
-    return EXCP_HALTED;
-}
-
 static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
 {
     env->nip = tb->pc;
index bf3f264026813b884c672e348e459aea4f507d82..f7893f3877886f915e793488f40b814bd27b6e94 100644 (file)
@@ -34,18 +34,6 @@ static inline int cpu_has_work(CPUState *env)
     return env->interrupt_request & CPU_INTERRUPT_HARD; // guess
 }
 
-static inline int cpu_halted(CPUState *env)
-{
-    if (!env->halted) {
-       return 0;
-    }
-    if (cpu_has_work(env)) {
-        env->halted = 0;
-        return 0;
-    }
-    return EXCP_HALTED;
-}
-
 static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock* tb)
 {
     env->psw.addr = tb->pc;
index 61bc1211dde6646085686846be36008dce7cc50a..9f1c1f6a005ebb2f529ccbafc7321ebc42871c53 100644 (file)
@@ -32,16 +32,6 @@ static inline int cpu_has_work(CPUState *env)
     return (env->interrupt_request & CPU_INTERRUPT_HARD);
 }
 
-static inline int cpu_halted(CPUState *env) {
-    if (!env->halted)
-        return 0;
-    if (cpu_has_work(env)) {
-        env->halted = 0;
-        return 0;
-    }
-    return EXCP_HALTED;
-}
-
 #ifndef CONFIG_USER_ONLY
 #include "softmmu_exec.h"
 #endif
index f8115716eb17623d9a55521ed5afde322bbeecd9..f5c221e48c18998b6a3320723cc09d75fb5d8add 100644 (file)
@@ -22,16 +22,6 @@ static inline int cpu_has_work(CPUState *env1)
 }
 
 
-static inline int cpu_halted(CPUState *env1) {
-    if (!env1->halted)
-        return 0;
-    if (cpu_has_work(env1)) {
-        env1->halted = 0;
-        return 0;
-    }
-    return EXCP_HALTED;
-}
-
 static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
 {
     env->pc = tb->pc;