提交 10eb0cc0 编写于 作者: P Paolo Bonzini 提交者: Blue Swirl

move cpu_pc_from_tb to target-*/exec.h

Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 83dae095
...@@ -512,11 +512,6 @@ void pal_init (CPUState *env); ...@@ -512,11 +512,6 @@ void pal_init (CPUState *env);
void call_pal (CPUState *env); void call_pal (CPUState *env);
#endif #endif
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->pc = tb->pc;
}
static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,
target_ulong *cs_base, int *flags) target_ulong *cs_base, int *flags)
{ {
......
...@@ -53,4 +53,9 @@ static inline int cpu_halted(CPUState *env) ...@@ -53,4 +53,9 @@ static inline int cpu_halted(CPUState *env)
return EXCP_HALTED; return EXCP_HALTED;
} }
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->pc = tb->pc;
}
#endif /* !defined (__ALPHA_EXEC_H__) */ #endif /* !defined (__ALPHA_EXEC_H__) */
...@@ -437,11 +437,6 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) ...@@ -437,11 +437,6 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)
#include "cpu-all.h" #include "cpu-all.h"
#include "exec-all.h" #include "exec-all.h"
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->regs[15] = tb->pc;
}
static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,
target_ulong *cs_base, int *flags) target_ulong *cs_base, int *flags)
{ {
......
...@@ -50,3 +50,9 @@ static inline int cpu_halted(CPUState *env) { ...@@ -50,3 +50,9 @@ static inline int cpu_halted(CPUState *env) {
#endif #endif
void raise_exception(int); void raise_exception(int);
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->regs[15] = tb->pc;
}
...@@ -252,11 +252,6 @@ static inline void cpu_set_tls(CPUCRISState *env, target_ulong newtls) ...@@ -252,11 +252,6 @@ static inline void cpu_set_tls(CPUCRISState *env, target_ulong newtls)
#include "cpu-all.h" #include "cpu-all.h"
#include "exec-all.h" #include "exec-all.h"
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->pc = tb->pc;
}
static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,
target_ulong *cs_base, int *flags) target_ulong *cs_base, int *flags)
{ {
......
...@@ -45,3 +45,9 @@ static inline int cpu_halted(CPUState *env) { ...@@ -45,3 +45,9 @@ static inline int cpu_halted(CPUState *env) {
} }
return EXCP_HALTED; return EXCP_HALTED;
} }
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->pc = tb->pc;
}
...@@ -941,11 +941,6 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) ...@@ -941,11 +941,6 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)
#include "hw/apic.h" #include "hw/apic.h"
#endif #endif
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->eip = tb->pc - tb->cs_base;
}
static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,
target_ulong *cs_base, int *flags) target_ulong *cs_base, int *flags)
{ {
......
...@@ -327,3 +327,9 @@ static inline void cpu_load_efer(CPUState *env, uint64_t val) ...@@ -327,3 +327,9 @@ static inline void cpu_load_efer(CPUState *env, uint64_t val)
if (env->efer & MSR_EFER_SVME) if (env->efer & MSR_EFER_SVME)
env->hflags |= HF_SVME_MASK; env->hflags |= HF_SVME_MASK;
} }
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->eip = tb->pc - tb->cs_base;
}
...@@ -244,11 +244,6 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) ...@@ -244,11 +244,6 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)
#include "cpu-all.h" #include "cpu-all.h"
#include "exec-all.h" #include "exec-all.h"
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->pc = tb->pc;
}
static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,
target_ulong *cs_base, int *flags) target_ulong *cs_base, int *flags)
{ {
......
...@@ -42,3 +42,9 @@ static inline int cpu_halted(CPUState *env) { ...@@ -42,3 +42,9 @@ static inline int cpu_halted(CPUState *env) {
} }
return EXCP_HALTED; return EXCP_HALTED;
} }
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->pc = tb->pc;
}
...@@ -307,11 +307,6 @@ static inline int cpu_interrupts_enabled(CPUState *env) ...@@ -307,11 +307,6 @@ static inline int cpu_interrupts_enabled(CPUState *env)
#include "cpu-all.h" #include "cpu-all.h"
#include "exec-all.h" #include "exec-all.h"
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->sregs[SR_PC] = tb->pc;
}
static inline target_ulong cpu_get_pc(CPUState *env) static inline target_ulong cpu_get_pc(CPUState *env)
{ {
return env->sregs[SR_PC]; return env->sregs[SR_PC];
......
...@@ -44,3 +44,9 @@ static inline int cpu_halted(CPUState *env) { ...@@ -44,3 +44,9 @@ static inline int cpu_halted(CPUState *env) {
} }
return EXCP_HALTED; return EXCP_HALTED;
} }
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->sregs[SR_PC] = tb->pc;
}
...@@ -612,13 +612,6 @@ target_phys_addr_t cpu_mips_translate_address (CPUState *env, target_ulong addre ...@@ -612,13 +612,6 @@ target_phys_addr_t cpu_mips_translate_address (CPUState *env, target_ulong addre
int rw); int rw);
#endif #endif
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->active_tc.PC = tb->pc;
env->hflags &= ~MIPS_HFLAG_BMASK;
env->hflags |= tb->flags & MIPS_HFLAG_BMASK;
}
static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,
target_ulong *cs_base, int *flags) target_ulong *cs_base, int *flags)
{ {
......
...@@ -76,4 +76,11 @@ static inline void compute_hflags(CPUState *env) ...@@ -76,4 +76,11 @@ static inline void compute_hflags(CPUState *env)
} }
} }
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->active_tc.PC = tb->pc;
env->hflags &= ~MIPS_HFLAG_BMASK;
env->hflags |= tb->flags & MIPS_HFLAG_BMASK;
}
#endif /* !defined(__QEMU_MIPS_EXEC_H__) */ #endif /* !defined(__QEMU_MIPS_EXEC_H__) */
...@@ -1601,11 +1601,6 @@ enum { ...@@ -1601,11 +1601,6 @@ enum {
/*****************************************************************************/ /*****************************************************************************/
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->nip = tb->pc;
}
static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,
target_ulong *cs_base, int *flags) target_ulong *cs_base, int *flags)
{ {
......
...@@ -52,4 +52,9 @@ static inline int cpu_halted(CPUState *env) ...@@ -52,4 +52,9 @@ static inline int cpu_halted(CPUState *env)
return EXCP_HALTED; return EXCP_HALTED;
} }
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->nip = tb->pc;
}
#endif /* !defined (__PPC_H__) */ #endif /* !defined (__PPC_H__) */
...@@ -123,11 +123,6 @@ extern CPUState *s390_cpu_addr2state(uint16_t cpu_addr); ...@@ -123,11 +123,6 @@ extern CPUState *s390_cpu_addr2state(uint16_t cpu_addr);
#define EXCP_ADDR 5 /* addressing exception */ #define EXCP_ADDR 5 /* addressing exception */
#define EXCP_EXECUTE_SVC 0xff00000 /* supervisor call via execute insn */ #define EXCP_EXECUTE_SVC 0xff00000 /* supervisor call via execute insn */
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock* tb)
{
env->psw.addr = tb->pc;
}
static inline void cpu_get_tb_cpu_state(CPUState* env, target_ulong *pc, static inline void cpu_get_tb_cpu_state(CPUState* env, target_ulong *pc,
target_ulong *cs_base, int *flags) target_ulong *cs_base, int *flags)
{ {
......
...@@ -45,3 +45,9 @@ static inline int cpu_halted(CPUState *env) ...@@ -45,3 +45,9 @@ static inline int cpu_halted(CPUState *env)
} }
return EXCP_HALTED; return EXCP_HALTED;
} }
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock* tb)
{
env->psw.addr = tb->pc;
}
...@@ -303,12 +303,6 @@ static inline int cpu_ptel_pr (uint32_t ptel) ...@@ -303,12 +303,6 @@ static inline int cpu_ptel_pr (uint32_t ptel)
#define PTEA_TC (1 << 3) #define PTEA_TC (1 << 3)
#define cpu_ptea_tc(ptea) (((ptea) & PTEA_TC) >> 3) #define cpu_ptea_tc(ptea) (((ptea) & PTEA_TC) >> 3)
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->pc = tb->pc;
env->flags = tb->flags;
}
#define TB_FLAG_PENDING_MOVCA (1 << 4) #define TB_FLAG_PENDING_MOVCA (1 << 4)
static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,
......
...@@ -47,4 +47,10 @@ static inline int cpu_halted(CPUState *env) { ...@@ -47,4 +47,10 @@ static inline int cpu_halted(CPUState *env) {
#include "softmmu_exec.h" #include "softmmu_exec.h"
#endif #endif
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->pc = tb->pc;
env->flags = tb->flags;
}
#endif /* _EXEC_SH4_H */ #endif /* _EXEC_SH4_H */
...@@ -625,12 +625,6 @@ void cpu_tick_set_limit(CPUTimer *timer, uint64_t limit); ...@@ -625,12 +625,6 @@ void cpu_tick_set_limit(CPUTimer *timer, uint64_t limit);
trap_state* cpu_tsptr(CPUState* env); trap_state* cpu_tsptr(CPUState* env);
#endif #endif
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->pc = tb->pc;
env->npc = tb->cs_base;
}
static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,
target_ulong *cs_base, int *flags) target_ulong *cs_base, int *flags)
{ {
......
...@@ -32,4 +32,10 @@ static inline int cpu_halted(CPUState *env1) { ...@@ -32,4 +32,10 @@ static inline int cpu_halted(CPUState *env1) {
return EXCP_HALTED; return EXCP_HALTED;
} }
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
{
env->pc = tb->pc;
env->npc = tb->cs_base;
}
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册