diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2012-03-14 16:47:49 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-03-14 16:47:49 -0500 |
commit | aea6ff7fa07b046fb9f43d6262d6e34b77e8437e (patch) | |
tree | dd3043d1742273a95fa7fc5e99b8d5ffe0c710e5 /target-m68k/helper.c | |
parent | 9e4dd565b46749d5e6d5cf87bfd84f1917c68319 (diff) | |
parent | dd83b06ae61cfa2dc4381ab49f365bd0995fc930 (diff) |
Merge remote-tracking branch 'afaerber/qom-cpu.v5' into staging
* afaerber/qom-cpu.v5: (43 commits)
qom: Introduce CPU class
Rename CPUState -> CPUArchState
xtensa hw/: Don't use CPUState
sparc hw/: Don't use CPUState
sh4 hw/: Don't use CPUState
s390x hw/: Don't use CPUState
ppc hw/: Don't use CPUState
mips hw/: Don't use CPUState
microblaze hw/: Don't use CPUState
m68k hw/: Don't use CPUState
lm32 hw/: Don't use CPUState
i386 hw/: Don't use CPUState
cris hw/: Don't use CPUState
arm hw/: Don't use CPUState
alpha hw/: Don't use CPUState
xtensa-semi: Don't use CPUState
m68k-semi: Don't use CPUState
arm-semi: Don't use CPUState
target-xtensa: Don't overuse CPUState
target-unicore32: Don't overuse CPUState
...
Diffstat (limited to 'target-m68k/helper.c')
-rw-r--r-- | target-m68k/helper.c | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/target-m68k/helper.c b/target-m68k/helper.c index fa675bfca6..1feed9be67 100644 --- a/target-m68k/helper.c +++ b/target-m68k/helper.c @@ -56,7 +56,7 @@ void m68k_cpu_list(FILE *f, fprintf_function cpu_fprintf) } } -static int fpu_gdb_get_reg(CPUState *env, uint8_t *mem_buf, int n) +static int fpu_gdb_get_reg(CPUM68KState *env, uint8_t *mem_buf, int n) { if (n < 8) { stfq_p(mem_buf, env->fregs[n]); @@ -70,7 +70,7 @@ static int fpu_gdb_get_reg(CPUState *env, uint8_t *mem_buf, int n) return 0; } -static int fpu_gdb_set_reg(CPUState *env, uint8_t *mem_buf, int n) +static int fpu_gdb_set_reg(CPUM68KState *env, uint8_t *mem_buf, int n) { if (n < 8) { env->fregs[n] = ldfq_p(mem_buf); @@ -143,7 +143,7 @@ static int cpu_m68k_set_model(CPUM68KState *env, const char *name) return 0; } -void cpu_reset(CPUM68KState *env) +void cpu_state_reset(CPUM68KState *env) { if (qemu_loglevel_mask(CPU_LOG_RESET)) { qemu_log("CPU Reset (CPU %d)\n", env->cpu_index); @@ -181,7 +181,7 @@ CPUM68KState *cpu_m68k_init(const char *cpu_model) return NULL; } - cpu_reset(env); + cpu_state_reset(env); qemu_init_vcpu(env); return env; } @@ -338,7 +338,7 @@ void m68k_switch_sp(CPUM68KState *env) #if defined(CONFIG_USER_ONLY) -int cpu_m68k_handle_mmu_fault (CPUState *env, target_ulong address, int rw, +int cpu_m68k_handle_mmu_fault (CPUM68KState *env, target_ulong address, int rw, int mmu_idx) { env->exception_index = EXCP_ACCESS; @@ -351,12 +351,12 @@ int cpu_m68k_handle_mmu_fault (CPUState *env, target_ulong address, int rw, /* MMU */ /* TODO: This will need fixing once the MMU is implemented. */ -target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr) +target_phys_addr_t cpu_get_phys_page_debug(CPUM68KState *env, target_ulong addr) { return addr; } -int cpu_m68k_handle_mmu_fault (CPUState *env, target_ulong address, int rw, +int cpu_m68k_handle_mmu_fault (CPUM68KState *env, target_ulong address, int rw, int mmu_idx) { int prot; @@ -407,7 +407,7 @@ uint32_t HELPER(sats)(uint32_t val, uint32_t ccr) return val; } -uint32_t HELPER(subx_cc)(CPUState *env, uint32_t op1, uint32_t op2) +uint32_t HELPER(subx_cc)(CPUM68KState *env, uint32_t op1, uint32_t op2) { uint32_t res; uint32_t old_flags; @@ -430,7 +430,7 @@ uint32_t HELPER(subx_cc)(CPUState *env, uint32_t op1, uint32_t op2) return res; } -uint32_t HELPER(addx_cc)(CPUState *env, uint32_t op1, uint32_t op2) +uint32_t HELPER(addx_cc)(CPUM68KState *env, uint32_t op1, uint32_t op2) { uint32_t res; uint32_t old_flags; @@ -458,13 +458,13 @@ uint32_t HELPER(xflag_lt)(uint32_t a, uint32_t b) return a < b; } -void HELPER(set_sr)(CPUState *env, uint32_t val) +void HELPER(set_sr)(CPUM68KState *env, uint32_t val) { env->sr = val & 0xffff; m68k_switch_sp(env); } -uint32_t HELPER(shl_cc)(CPUState *env, uint32_t val, uint32_t shift) +uint32_t HELPER(shl_cc)(CPUM68KState *env, uint32_t val, uint32_t shift) { uint32_t result; uint32_t cf; @@ -489,7 +489,7 @@ uint32_t HELPER(shl_cc)(CPUState *env, uint32_t val, uint32_t shift) return result; } -uint32_t HELPER(shr_cc)(CPUState *env, uint32_t val, uint32_t shift) +uint32_t HELPER(shr_cc)(CPUM68KState *env, uint32_t val, uint32_t shift) { uint32_t result; uint32_t cf; @@ -514,7 +514,7 @@ uint32_t HELPER(shr_cc)(CPUState *env, uint32_t val, uint32_t shift) return result; } -uint32_t HELPER(sar_cc)(CPUState *env, uint32_t val, uint32_t shift) +uint32_t HELPER(sar_cc)(CPUM68KState *env, uint32_t val, uint32_t shift) { uint32_t result; uint32_t cf; @@ -537,37 +537,37 @@ uint32_t HELPER(sar_cc)(CPUState *env, uint32_t val, uint32_t shift) } /* FPU helpers. */ -uint32_t HELPER(f64_to_i32)(CPUState *env, float64 val) +uint32_t HELPER(f64_to_i32)(CPUM68KState *env, float64 val) { return float64_to_int32(val, &env->fp_status); } -float32 HELPER(f64_to_f32)(CPUState *env, float64 val) +float32 HELPER(f64_to_f32)(CPUM68KState *env, float64 val) { return float64_to_float32(val, &env->fp_status); } -float64 HELPER(i32_to_f64)(CPUState *env, uint32_t val) +float64 HELPER(i32_to_f64)(CPUM68KState *env, uint32_t val) { return int32_to_float64(val, &env->fp_status); } -float64 HELPER(f32_to_f64)(CPUState *env, float32 val) +float64 HELPER(f32_to_f64)(CPUM68KState *env, float32 val) { return float32_to_float64(val, &env->fp_status); } -float64 HELPER(iround_f64)(CPUState *env, float64 val) +float64 HELPER(iround_f64)(CPUM68KState *env, float64 val) { return float64_round_to_int(val, &env->fp_status); } -float64 HELPER(itrunc_f64)(CPUState *env, float64 val) +float64 HELPER(itrunc_f64)(CPUM68KState *env, float64 val) { return float64_trunc_to_int(val, &env->fp_status); } -float64 HELPER(sqrt_f64)(CPUState *env, float64 val) +float64 HELPER(sqrt_f64)(CPUM68KState *env, float64 val) { return float64_sqrt(val, &env->fp_status); } @@ -582,27 +582,27 @@ float64 HELPER(chs_f64)(float64 val) return float64_chs(val); } -float64 HELPER(add_f64)(CPUState *env, float64 a, float64 b) +float64 HELPER(add_f64)(CPUM68KState *env, float64 a, float64 b) { return float64_add(a, b, &env->fp_status); } -float64 HELPER(sub_f64)(CPUState *env, float64 a, float64 b) +float64 HELPER(sub_f64)(CPUM68KState *env, float64 a, float64 b) { return float64_sub(a, b, &env->fp_status); } -float64 HELPER(mul_f64)(CPUState *env, float64 a, float64 b) +float64 HELPER(mul_f64)(CPUM68KState *env, float64 a, float64 b) { return float64_mul(a, b, &env->fp_status); } -float64 HELPER(div_f64)(CPUState *env, float64 a, float64 b) +float64 HELPER(div_f64)(CPUM68KState *env, float64 a, float64 b) { return float64_div(a, b, &env->fp_status); } -float64 HELPER(sub_cmp_f64)(CPUState *env, float64 a, float64 b) +float64 HELPER(sub_cmp_f64)(CPUM68KState *env, float64 a, float64 b) { /* ??? This may incorrectly raise exceptions. */ /* ??? Should flush denormals to zero. */ @@ -620,7 +620,7 @@ float64 HELPER(sub_cmp_f64)(CPUState *env, float64 a, float64 b) return res; } -uint32_t HELPER(compare_f64)(CPUState *env, float64 val) +uint32_t HELPER(compare_f64)(CPUM68KState *env, float64 val) { return float64_compare_quiet(val, float64_zero, &env->fp_status); } @@ -629,7 +629,7 @@ uint32_t HELPER(compare_f64)(CPUState *env, float64 val) /* FIXME: The MAC unit implementation is a bit of a mess. Some helpers take values, others take register numbers and manipulate the contents in-place. */ -void HELPER(mac_move)(CPUState *env, uint32_t dest, uint32_t src) +void HELPER(mac_move)(CPUM68KState *env, uint32_t dest, uint32_t src) { uint32_t mask; env->macc[dest] = env->macc[src]; @@ -640,7 +640,7 @@ void HELPER(mac_move)(CPUState *env, uint32_t dest, uint32_t src) env->macsr &= ~mask; } -uint64_t HELPER(macmuls)(CPUState *env, uint32_t op1, uint32_t op2) +uint64_t HELPER(macmuls)(CPUM68KState *env, uint32_t op1, uint32_t op2) { int64_t product; int64_t res; @@ -660,7 +660,7 @@ uint64_t HELPER(macmuls)(CPUState *env, uint32_t op1, uint32_t op2) return res; } -uint64_t HELPER(macmulu)(CPUState *env, uint32_t op1, uint32_t op2) +uint64_t HELPER(macmulu)(CPUM68KState *env, uint32_t op1, uint32_t op2) { uint64_t product; @@ -677,7 +677,7 @@ uint64_t HELPER(macmulu)(CPUState *env, uint32_t op1, uint32_t op2) return product; } -uint64_t HELPER(macmulf)(CPUState *env, uint32_t op1, uint32_t op2) +uint64_t HELPER(macmulf)(CPUM68KState *env, uint32_t op1, uint32_t op2) { uint64_t product; uint32_t remainder; @@ -696,7 +696,7 @@ uint64_t HELPER(macmulf)(CPUState *env, uint32_t op1, uint32_t op2) return product; } -void HELPER(macsats)(CPUState *env, uint32_t acc) +void HELPER(macsats)(CPUM68KState *env, uint32_t acc) { int64_t tmp; int64_t result; @@ -717,7 +717,7 @@ void HELPER(macsats)(CPUState *env, uint32_t acc) env->macc[acc] = result; } -void HELPER(macsatu)(CPUState *env, uint32_t acc) +void HELPER(macsatu)(CPUM68KState *env, uint32_t acc) { uint64_t val; @@ -739,7 +739,7 @@ void HELPER(macsatu)(CPUState *env, uint32_t acc) env->macc[acc] = val; } -void HELPER(macsatf)(CPUState *env, uint32_t acc) +void HELPER(macsatf)(CPUM68KState *env, uint32_t acc) { int64_t sum; int64_t result; @@ -758,7 +758,7 @@ void HELPER(macsatf)(CPUState *env, uint32_t acc) env->macc[acc] = result; } -void HELPER(mac_set_flags)(CPUState *env, uint32_t acc) +void HELPER(mac_set_flags)(CPUM68KState *env, uint32_t acc) { uint64_t val; val = env->macc[acc]; @@ -784,12 +784,12 @@ void HELPER(mac_set_flags)(CPUState *env, uint32_t acc) } } -void HELPER(flush_flags)(CPUState *env, uint32_t cc_op) +void HELPER(flush_flags)(CPUM68KState *env, uint32_t cc_op) { cpu_m68k_flush_flags(env, cc_op); } -uint32_t HELPER(get_macf)(CPUState *env, uint64_t val) +uint32_t HELPER(get_macf)(CPUM68KState *env, uint64_t val) { int rem; uint32_t result; @@ -858,7 +858,7 @@ uint32_t HELPER(get_macu)(uint64_t val) } } -uint32_t HELPER(get_mac_extf)(CPUState *env, uint32_t acc) +uint32_t HELPER(get_mac_extf)(CPUM68KState *env, uint32_t acc) { uint32_t val; val = env->macc[acc] & 0x00ff; @@ -868,7 +868,7 @@ uint32_t HELPER(get_mac_extf)(CPUState *env, uint32_t acc) return val; } -uint32_t HELPER(get_mac_exti)(CPUState *env, uint32_t acc) +uint32_t HELPER(get_mac_exti)(CPUM68KState *env, uint32_t acc) { uint32_t val; val = (env->macc[acc] >> 32) & 0xffff; @@ -876,7 +876,7 @@ uint32_t HELPER(get_mac_exti)(CPUState *env, uint32_t acc) return val; } -void HELPER(set_mac_extf)(CPUState *env, uint32_t val, uint32_t acc) +void HELPER(set_mac_extf)(CPUM68KState *env, uint32_t val, uint32_t acc) { int64_t res; int32_t tmp; @@ -892,7 +892,7 @@ void HELPER(set_mac_extf)(CPUState *env, uint32_t val, uint32_t acc) env->macc[acc + 1] = res; } -void HELPER(set_mac_exts)(CPUState *env, uint32_t val, uint32_t acc) +void HELPER(set_mac_exts)(CPUM68KState *env, uint32_t val, uint32_t acc) { int64_t res; int32_t tmp; @@ -906,7 +906,7 @@ void HELPER(set_mac_exts)(CPUState *env, uint32_t val, uint32_t acc) env->macc[acc + 1] = res; } -void HELPER(set_mac_extu)(CPUState *env, uint32_t val, uint32_t acc) +void HELPER(set_mac_extu)(CPUM68KState *env, uint32_t val, uint32_t acc) { uint64_t res; res = (uint32_t)env->macc[acc]; |