Commit eda48c34 authored by Paolo Bonzini's avatar Paolo Bonzini Committed by Blue Swirl
Browse files

inline cpu_halted into sole caller



All implementations are now the same, and there is only one caller,
so inline the function there.

Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
parent 38a42e7c
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -208,8 +208,13 @@ int cpu_exec(CPUState *env1)
    uint8_t *tc_ptr;
    unsigned long next_tb;

    if (cpu_halted(env1) == EXCP_HALTED)
    if (env1->halted) {
        if (!cpu_has_work(env1)) {
            return EXCP_HALTED;
        }

        env1->halted = 0;
    }

    cpu_single_env = env1;

+0 −11
Original line number Diff line number Diff line
@@ -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;
+0 −13
Original line number Diff line number Diff line
@@ -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
+0 −11
Original line number Diff line number Diff line
@@ -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;
+0 −12
Original line number Diff line number Diff line
@@ -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)
Loading