exec.h: fix coding style and change cpu_has_work to return bool

Before the next patch, fix coding style of the areas affected.

Change the type of the return value from cpu_has_work() and
qemu_cpu_has_work() to bool.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2011-05-21 12:16:05 +00:00
parent d8108fb187
commit f3e270377a
15 changed files with 24 additions and 24 deletions

View File

@ -847,7 +847,7 @@ void cpu_reset_interrupt(CPUState *env, int mask);
void cpu_exit(CPUState *s); void cpu_exit(CPUState *s);
int qemu_cpu_has_work(CPUState *env); bool qemu_cpu_has_work(CPUState *env);
/* Breakpoint/watchpoint flags */ /* Breakpoint/watchpoint flags */
#define BP_MEM_READ 0x01 #define BP_MEM_READ 0x01

View File

@ -32,7 +32,7 @@ int tb_invalidated_flag;
//#define CONFIG_DEBUG_EXEC //#define CONFIG_DEBUG_EXEC
int qemu_cpu_has_work(CPUState *env) bool qemu_cpu_has_work(CPUState *env)
{ {
return cpu_has_work(env); return cpu_has_work(env);
} }

View File

@ -37,7 +37,7 @@ register struct CPUAlphaState *env asm(AREG0);
#include "softmmu_exec.h" #include "softmmu_exec.h"
#endif /* !defined(CONFIG_USER_ONLY) */ #endif /* !defined(CONFIG_USER_ONLY) */
static inline int cpu_has_work(CPUState *env) static inline bool cpu_has_work(CPUState *env)
{ {
/* Here we are checking to see if the CPU should wake up from HALT. /* Here we are checking to see if the CPU should wake up from HALT.
We will have gotten into this state only for WTINT from PALmode. */ We will have gotten into this state only for WTINT from PALmode. */

View File

@ -24,10 +24,10 @@ register struct CPUARMState *env asm(AREG0);
#include "cpu.h" #include "cpu.h"
#include "exec-all.h" #include "exec-all.h"
static inline int cpu_has_work(CPUState *env) static inline bool cpu_has_work(CPUState *env)
{ {
return (env->interrupt_request & return env->interrupt_request &
(CPU_INTERRUPT_FIQ | CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB)); (CPU_INTERRUPT_FIQ | CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB);
} }
#if !defined(CONFIG_USER_ONLY) #if !defined(CONFIG_USER_ONLY)

View File

@ -28,9 +28,9 @@ register struct CPUCRISState *env asm(AREG0);
#include "softmmu_exec.h" #include "softmmu_exec.h"
#endif #endif
static inline int cpu_has_work(CPUState *env) static inline bool cpu_has_work(CPUState *env)
{ {
return (env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI)); return env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI);
} }
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb) static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)

View File

@ -160,7 +160,7 @@ static inline void load_eflags(int eflags, int update_mask)
(eflags & update_mask) | 0x2; (eflags & update_mask) | 0x2;
} }
static inline int cpu_has_work(CPUState *env) static inline bool cpu_has_work(CPUState *env)
{ {
return ((env->interrupt_request & CPU_INTERRUPT_HARD) && return ((env->interrupt_request & CPU_INTERRUPT_HARD) &&
(env->eflags & IF_MASK)) || (env->eflags & IF_MASK)) ||

View File

@ -24,7 +24,7 @@ register struct CPULM32State *env asm(AREG0);
#include "cpu.h" #include "cpu.h"
#include "exec-all.h" #include "exec-all.h"
static inline int cpu_has_work(CPUState *env) static inline bool cpu_has_work(CPUState *env)
{ {
return env->interrupt_request & CPU_INTERRUPT_HARD; return env->interrupt_request & CPU_INTERRUPT_HARD;
} }

View File

@ -28,9 +28,9 @@ register struct CPUM68KState *env asm(AREG0);
#include "softmmu_exec.h" #include "softmmu_exec.h"
#endif #endif
static inline int cpu_has_work(CPUState *env) static inline bool cpu_has_work(CPUState *env)
{ {
return (env->interrupt_request & (CPU_INTERRUPT_HARD)); return env->interrupt_request & (CPU_INTERRUPT_HARD);
} }
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb) static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)

View File

@ -27,9 +27,9 @@ register struct CPUMBState *env asm(AREG0);
#include "softmmu_exec.h" #include "softmmu_exec.h"
#endif #endif
static inline int cpu_has_work(CPUState *env) static inline bool cpu_has_work(CPUState *env)
{ {
return (env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI)); return env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI);
} }
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb) static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)

View File

@ -17,7 +17,7 @@ register struct CPUMIPSState *env asm(AREG0);
#include "softmmu_exec.h" #include "softmmu_exec.h"
#endif /* !defined(CONFIG_USER_ONLY) */ #endif /* !defined(CONFIG_USER_ONLY) */
static inline int cpu_has_work(CPUState *env) static inline bool cpu_has_work(CPUState *env)
{ {
int has_work = 0; int has_work = 0;

View File

@ -32,9 +32,9 @@ register struct CPUPPCState *env asm(AREG0);
#include "softmmu_exec.h" #include "softmmu_exec.h"
#endif /* !defined(CONFIG_USER_ONLY) */ #endif /* !defined(CONFIG_USER_ONLY) */
static inline int cpu_has_work(CPUState *env) static inline bool cpu_has_work(CPUState *env)
{ {
return (msr_ee && (env->interrupt_request & CPU_INTERRUPT_HARD)); return msr_ee && (env->interrupt_request & CPU_INTERRUPT_HARD);
} }

View File

@ -29,10 +29,10 @@ register struct CPUS390XState *env asm(AREG0);
#include "softmmu_exec.h" #include "softmmu_exec.h"
#endif /* !defined(CONFIG_USER_ONLY) */ #endif /* !defined(CONFIG_USER_ONLY) */
static inline int cpu_has_work(CPUState *env) static inline bool cpu_has_work(CPUState *env)
{ {
return ((env->interrupt_request & CPU_INTERRUPT_HARD) && return (env->interrupt_request & CPU_INTERRUPT_HARD) &&
(env->psw.mask & PSW_MASK_EXT)); (env->psw.mask & PSW_MASK_EXT);
} }
static inline void regs_to_env(void) static inline void regs_to_env(void)

View File

@ -27,9 +27,9 @@ register struct CPUSH4State *env asm(AREG0);
#include "cpu.h" #include "cpu.h"
#include "exec-all.h" #include "exec-all.h"
static inline int cpu_has_work(CPUState *env) static inline bool cpu_has_work(CPUState *env)
{ {
return (env->interrupt_request & CPU_INTERRUPT_HARD); return env->interrupt_request & CPU_INTERRUPT_HARD;
} }
#ifndef CONFIG_USER_ONLY #ifndef CONFIG_USER_ONLY

View File

@ -13,7 +13,7 @@ register struct CPUSPARCState *env asm(AREG0);
#endif /* !defined(CONFIG_USER_ONLY) */ #endif /* !defined(CONFIG_USER_ONLY) */
/* op_helper.c */ /* op_helper.c */
static inline int cpu_has_work(CPUState *env1) static inline bool cpu_has_work(CPUState *env1)
{ {
return (env1->interrupt_request & CPU_INTERRUPT_HARD) && return (env1->interrupt_request & CPU_INTERRUPT_HARD) &&
cpu_interrupts_enabled(env1); cpu_interrupts_enabled(env1);

View File

@ -26,7 +26,7 @@ static inline void regs_to_env(void)
{ {
} }
static inline int cpu_has_work(CPUState *env) static inline bool cpu_has_work(CPUState *env)
{ {
return env->interrupt_request & return env->interrupt_request &
(CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB); (CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB);