mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
* Add missing ERRP_GUARD() statements in functions that need it
* Prefer fast cpu_env() over slower CPU QOM cast macro -----BEGIN PGP SIGNATURE----- iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmXwPhYRHHRodXRoQHJl ZGhhdC5jb20ACgkQLtnXdP5wLbWHvBAAgKx5LHFjz3xREVA+LkDTQ49mz0lK3s32 SGvNlIHjiaDGVttVYhVC4sinBWUruG4Lyv/2QN72OJBzn6WUsEUQE3KPH1d7Y3/s wS9X7mj70n4kugWJqeIJP5AXSRasHmWoQ4QJLVQRJd6+Eb9jqwep0x7bYkI1de6D bL1Q7bIfkFeNQBXaiPWAm2i+hqmT4C1r8HEAGZIjAsMFrjy/hzBEjNV+pnh6ZSq9 Vp8BsPWRfLU2XHm4WX0o8d89WUMAfUGbVkddEl/XjIHDrUD+Zbd1HAhLyfhsmrnE jXIwSzm+ML1KX4MoF5ilGtg8Oo0gQDEBy9/xck6G0HCm9lIoLKlgTxK9glr2vdT8 yxZmrM9Hder7F9hKKxmb127xgU6AmL7rYmVqsoQMNAq22D6Xr4UDpgFRXNk2/wO6 zZZBkfZ4H4MpZXbd/KJpXvYH5mQA4IpkOy8LJdE+dbcHX7Szy9ksZdPA+Z10hqqf zqS13qTs3abxymy2Q/tO3hPKSJCk1+vCGUkN60Wm+9VoLWGoU43qMc7gnY/pCS7m 0rFKtvfwFHhokX1orK0lP/ppVzPv/5oFIeK8YDY9if+N+dU2LCwVZHIuf2/VJPRq wmgH2vAn3JDoRKPxTGX9ly6AMxuZaeP92qBTOPap0gDhihYzIpaCq9ecEBoTakI7 tdFhV0iRr08= =NiP4 -----END PGP SIGNATURE----- Merge tag 'pull-request-2024-03-12' of https://gitlab.com/thuth/qemu into staging * Add missing ERRP_GUARD() statements in functions that need it * Prefer fast cpu_env() over slower CPU QOM cast macro # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmXwPhYRHHRodXRoQHJl # ZGhhdC5jb20ACgkQLtnXdP5wLbWHvBAAgKx5LHFjz3xREVA+LkDTQ49mz0lK3s32 # SGvNlIHjiaDGVttVYhVC4sinBWUruG4Lyv/2QN72OJBzn6WUsEUQE3KPH1d7Y3/s # wS9X7mj70n4kugWJqeIJP5AXSRasHmWoQ4QJLVQRJd6+Eb9jqwep0x7bYkI1de6D # bL1Q7bIfkFeNQBXaiPWAm2i+hqmT4C1r8HEAGZIjAsMFrjy/hzBEjNV+pnh6ZSq9 # Vp8BsPWRfLU2XHm4WX0o8d89WUMAfUGbVkddEl/XjIHDrUD+Zbd1HAhLyfhsmrnE # jXIwSzm+ML1KX4MoF5ilGtg8Oo0gQDEBy9/xck6G0HCm9lIoLKlgTxK9glr2vdT8 # yxZmrM9Hder7F9hKKxmb127xgU6AmL7rYmVqsoQMNAq22D6Xr4UDpgFRXNk2/wO6 # zZZBkfZ4H4MpZXbd/KJpXvYH5mQA4IpkOy8LJdE+dbcHX7Szy9ksZdPA+Z10hqqf # zqS13qTs3abxymy2Q/tO3hPKSJCk1+vCGUkN60Wm+9VoLWGoU43qMc7gnY/pCS7m # 0rFKtvfwFHhokX1orK0lP/ppVzPv/5oFIeK8YDY9if+N+dU2LCwVZHIuf2/VJPRq # wmgH2vAn3JDoRKPxTGX9ly6AMxuZaeP92qBTOPap0gDhihYzIpaCq9ecEBoTakI7 # tdFhV0iRr08= # =NiP4 # -----END PGP SIGNATURE----- # gpg: Signature made Tue 12 Mar 2024 11:35:50 GMT # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full] # gpg: aka "Thomas Huth <thuth@redhat.com>" [full] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * tag 'pull-request-2024-03-12' of https://gitlab.com/thuth/qemu: (55 commits) user: Prefer fast cpu_env() over slower CPU QOM cast macro target/xtensa: Prefer fast cpu_env() over slower CPU QOM cast macro target/tricore: Prefer fast cpu_env() over slower CPU QOM cast macro target/sparc: Prefer fast cpu_env() over slower CPU QOM cast macro target/sh4: Prefer fast cpu_env() over slower CPU QOM cast macro target/rx: Prefer fast cpu_env() over slower CPU QOM cast macro target/ppc: Prefer fast cpu_env() over slower CPU QOM cast macro target/openrisc: Prefer fast cpu_env() over slower CPU QOM cast macro target/nios2: Prefer fast cpu_env() over slower CPU QOM cast macro target/mips: Prefer fast cpu_env() over slower CPU QOM cast macro target/microblaze: Prefer fast cpu_env() over slower CPU QOM cast macro target/m68k: Prefer fast cpu_env() over slower CPU QOM cast macro target/loongarch: Prefer fast cpu_env() over slower CPU QOM cast macro target/i386/hvf: Use CPUState typedef target/hexagon: Prefer fast cpu_env() over slower CPU QOM cast macro target/cris: Prefer fast cpu_env() over slower CPU QOM cast macro target/avr: Prefer fast cpu_env() over slower CPU QOM cast macro target/alpha: Prefer fast cpu_env() over slower CPU QOM cast macro target: Replace CPU_GET_CLASS(cpu -> obj) in cpu_reset_hold() handler bulk: Call in place single use cpu_env() ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
e692f9c6a6
154 changed files with 436 additions and 692 deletions
|
@ -135,40 +135,27 @@ static ObjectClass *alpha_cpu_class_by_name(const char *cpu_model)
|
|||
|
||||
static void ev4_cpu_initfn(Object *obj)
|
||||
{
|
||||
AlphaCPU *cpu = ALPHA_CPU(obj);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
|
||||
env->implver = IMPLVER_2106x;
|
||||
cpu_env(CPU(obj))->implver = IMPLVER_2106x;
|
||||
}
|
||||
|
||||
static void ev5_cpu_initfn(Object *obj)
|
||||
{
|
||||
AlphaCPU *cpu = ALPHA_CPU(obj);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
|
||||
env->implver = IMPLVER_21164;
|
||||
cpu_env(CPU(obj))->implver = IMPLVER_21164;
|
||||
}
|
||||
|
||||
static void ev56_cpu_initfn(Object *obj)
|
||||
{
|
||||
AlphaCPU *cpu = ALPHA_CPU(obj);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
|
||||
env->amask |= AMASK_BWX;
|
||||
cpu_env(CPU(obj))->amask |= AMASK_BWX;
|
||||
}
|
||||
|
||||
static void pca56_cpu_initfn(Object *obj)
|
||||
{
|
||||
AlphaCPU *cpu = ALPHA_CPU(obj);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
|
||||
env->amask |= AMASK_MVI;
|
||||
cpu_env(CPU(obj))->amask |= AMASK_MVI;
|
||||
}
|
||||
|
||||
static void ev6_cpu_initfn(Object *obj)
|
||||
{
|
||||
AlphaCPU *cpu = ALPHA_CPU(obj);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
CPUAlphaState *env = cpu_env(CPU(obj));
|
||||
|
||||
env->implver = IMPLVER_21264;
|
||||
env->amask = AMASK_BWX | AMASK_FIX | AMASK_MVI | AMASK_TRAP;
|
||||
|
@ -176,16 +163,12 @@ static void ev6_cpu_initfn(Object *obj)
|
|||
|
||||
static void ev67_cpu_initfn(Object *obj)
|
||||
{
|
||||
AlphaCPU *cpu = ALPHA_CPU(obj);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
|
||||
env->amask |= AMASK_CIX | AMASK_PREFETCH;
|
||||
cpu_env(CPU(obj))->amask |= AMASK_CIX | AMASK_PREFETCH;
|
||||
}
|
||||
|
||||
static void alpha_cpu_initfn(Object *obj)
|
||||
{
|
||||
AlphaCPU *cpu = ALPHA_CPU(obj);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
CPUAlphaState *env = cpu_env(CPU(obj));
|
||||
|
||||
env->lock_addr = -1;
|
||||
#if defined(CONFIG_USER_ONLY)
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
|
||||
int alpha_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||
{
|
||||
AlphaCPU *cpu = ALPHA_CPU(cs);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
CPUAlphaState *env = cpu_env(cs);
|
||||
uint64_t val;
|
||||
CPU_DoubleU d;
|
||||
|
||||
|
@ -59,8 +58,7 @@ int alpha_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
|||
|
||||
int alpha_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
{
|
||||
AlphaCPU *cpu = ALPHA_CPU(cs);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
CPUAlphaState *env = cpu_env(cs);
|
||||
target_ulong tmp = ldtul_p(mem_buf);
|
||||
CPU_DoubleU d;
|
||||
|
||||
|
|
|
@ -286,11 +286,10 @@ static int get_physical_address(CPUAlphaState *env, target_ulong addr,
|
|||
|
||||
hwaddr alpha_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
|
||||
{
|
||||
AlphaCPU *cpu = ALPHA_CPU(cs);
|
||||
target_ulong phys;
|
||||
int prot, fail;
|
||||
|
||||
fail = get_physical_address(&cpu->env, addr, 0, 0, &phys, &prot);
|
||||
fail = get_physical_address(cpu_env(cs), addr, 0, 0, &phys, &prot);
|
||||
return (fail >= 0 ? -1 : phys);
|
||||
}
|
||||
|
||||
|
@ -298,8 +297,7 @@ bool alpha_cpu_tlb_fill(CPUState *cs, vaddr addr, int size,
|
|||
MMUAccessType access_type, int mmu_idx,
|
||||
bool probe, uintptr_t retaddr)
|
||||
{
|
||||
AlphaCPU *cpu = ALPHA_CPU(cs);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
CPUAlphaState *env = cpu_env(cs);
|
||||
target_ulong phys;
|
||||
int prot, fail;
|
||||
|
||||
|
@ -325,8 +323,7 @@ bool alpha_cpu_tlb_fill(CPUState *cs, vaddr addr, int size,
|
|||
|
||||
void alpha_cpu_do_interrupt(CPUState *cs)
|
||||
{
|
||||
AlphaCPU *cpu = ALPHA_CPU(cs);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
CPUAlphaState *env = cpu_env(cs);
|
||||
int i = cs->exception_index;
|
||||
|
||||
if (qemu_loglevel_mask(CPU_LOG_INT)) {
|
||||
|
@ -435,8 +432,7 @@ void alpha_cpu_do_interrupt(CPUState *cs)
|
|||
|
||||
bool alpha_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
||||
{
|
||||
AlphaCPU *cpu = ALPHA_CPU(cs);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
CPUAlphaState *env = cpu_env(cs);
|
||||
int idx = -1;
|
||||
|
||||
/* We never take interrupts while in PALmode. */
|
||||
|
@ -487,8 +483,7 @@ void alpha_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
|||
"a0", "a1", "a2", "a3", "a4", "a5", "t8", "t9",
|
||||
"t10", "t11", "ra", "t12", "at", "gp", "sp"
|
||||
};
|
||||
AlphaCPU *cpu = ALPHA_CPU(cs);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
CPUAlphaState *env = cpu_env(cs);
|
||||
int i;
|
||||
|
||||
qemu_fprintf(f, "PC " TARGET_FMT_lx " PS %02x\n",
|
||||
|
|
|
@ -42,18 +42,14 @@ static void do_unaligned_access(CPUAlphaState *env, vaddr addr, uintptr_t retadd
|
|||
void alpha_cpu_record_sigbus(CPUState *cs, vaddr addr,
|
||||
MMUAccessType access_type, uintptr_t retaddr)
|
||||
{
|
||||
AlphaCPU *cpu = ALPHA_CPU(cs);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
|
||||
do_unaligned_access(env, addr, retaddr);
|
||||
do_unaligned_access(cpu_env(cs), addr, retaddr);
|
||||
}
|
||||
#else
|
||||
void alpha_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
|
||||
MMUAccessType access_type,
|
||||
int mmu_idx, uintptr_t retaddr)
|
||||
{
|
||||
AlphaCPU *cpu = ALPHA_CPU(cs);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
CPUAlphaState *env = cpu_env(cs);
|
||||
|
||||
do_unaligned_access(env, addr, retaddr);
|
||||
cs->exception_index = EXCP_UNALIGN;
|
||||
|
@ -67,8 +63,7 @@ void alpha_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr,
|
|||
int mmu_idx, MemTxAttrs attrs,
|
||||
MemTxResult response, uintptr_t retaddr)
|
||||
{
|
||||
AlphaCPU *cpu = ALPHA_CPU(cs);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
CPUAlphaState *env = cpu_env(cs);
|
||||
|
||||
env->trap_arg0 = addr;
|
||||
env->trap_arg1 = access_type == MMU_DATA_STORE ? 1 : 0;
|
||||
|
|
|
@ -2903,8 +2903,8 @@ static void alpha_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu)
|
|||
static void alpha_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)
|
||||
{
|
||||
DisasContext *ctx = container_of(dcbase, DisasContext, base);
|
||||
CPUAlphaState *env = cpu_env(cpu);
|
||||
uint32_t insn = translator_ldl(env, &ctx->base, ctx->base.pc_next);
|
||||
uint32_t insn = translator_ldl(cpu_env(cpu), &ctx->base,
|
||||
ctx->base.pc_next);
|
||||
|
||||
ctx->base.pc_next += 4;
|
||||
ctx->base.is_jmp = translate_one(ctx, insn);
|
||||
|
|
|
@ -214,9 +214,9 @@ static void cp_reg_check_reset(gpointer key, gpointer value, gpointer opaque)
|
|||
|
||||
static void arm_cpu_reset_hold(Object *obj)
|
||||
{
|
||||
CPUState *s = CPU(obj);
|
||||
ARMCPU *cpu = ARM_CPU(s);
|
||||
ARMCPUClass *acc = ARM_CPU_GET_CLASS(cpu);
|
||||
CPUState *cs = CPU(obj);
|
||||
ARMCPU *cpu = ARM_CPU(cs);
|
||||
ARMCPUClass *acc = ARM_CPU_GET_CLASS(obj);
|
||||
CPUARMState *env = &cpu->env;
|
||||
|
||||
if (acc->parent_phases.hold) {
|
||||
|
@ -233,7 +233,7 @@ static void arm_cpu_reset_hold(Object *obj)
|
|||
env->vfp.xregs[ARM_VFP_MVFR1] = cpu->isar.mvfr1;
|
||||
env->vfp.xregs[ARM_VFP_MVFR2] = cpu->isar.mvfr2;
|
||||
|
||||
cpu->power_state = s->start_powered_off ? PSCI_OFF : PSCI_ON;
|
||||
cpu->power_state = cs->start_powered_off ? PSCI_OFF : PSCI_ON;
|
||||
|
||||
if (arm_feature(env, ARM_FEATURE_IWMMXT)) {
|
||||
env->iwmmxt.cregs[ARM_IWMMXT_wCID] = 0x69051000 | 'Q';
|
||||
|
@ -438,7 +438,7 @@ static void arm_cpu_reset_hold(Object *obj)
|
|||
|
||||
/* Load the initial SP and PC from offset 0 and 4 in the vector table */
|
||||
vecbase = env->v7m.vecbase[env->v7m.secure];
|
||||
rom = rom_ptr_for_as(s->as, vecbase, 8);
|
||||
rom = rom_ptr_for_as(cs->as, vecbase, 8);
|
||||
if (rom) {
|
||||
/* Address zero is covered by ROM which hasn't yet been
|
||||
* copied into physical memory.
|
||||
|
@ -451,8 +451,8 @@ static void arm_cpu_reset_hold(Object *obj)
|
|||
* it got copied into memory. In the latter case, rom_ptr
|
||||
* will return a NULL pointer and we should use ldl_phys instead.
|
||||
*/
|
||||
initial_msp = ldl_phys(s->as, vecbase);
|
||||
initial_pc = ldl_phys(s->as, vecbase + 4);
|
||||
initial_msp = ldl_phys(cs->as, vecbase);
|
||||
initial_pc = ldl_phys(cs->as, vecbase + 4);
|
||||
}
|
||||
|
||||
qemu_log_mask(CPU_LOG_INT,
|
||||
|
@ -2095,7 +2095,7 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
|
|||
* We rely on no XScale CPU having VFP so we can use the same bits in the
|
||||
* TB flags field for VECSTRIDE and XSCALE_CPAR.
|
||||
*/
|
||||
assert(arm_feature(&cpu->env, ARM_FEATURE_AARCH64) ||
|
||||
assert(arm_feature(env, ARM_FEATURE_AARCH64) ||
|
||||
!cpu_isar_feature(aa32_vfp_simd, cpu) ||
|
||||
!arm_feature(env, ARM_FEATURE_XSCALE));
|
||||
|
||||
|
@ -2145,7 +2145,7 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
if (cpu->cfgend) {
|
||||
if (arm_feature(&cpu->env, ARM_FEATURE_V7)) {
|
||||
if (arm_feature(env, ARM_FEATURE_V7)) {
|
||||
cpu->reset_sctlr |= SCTLR_EE;
|
||||
} else {
|
||||
cpu->reset_sctlr |= SCTLR_B;
|
||||
|
|
|
@ -1888,7 +1888,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
|
|||
cpu->psci_version = QEMU_PSCI_VERSION_0_2;
|
||||
cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_PSCI_0_2;
|
||||
}
|
||||
if (!arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) {
|
||||
if (!arm_feature(env, ARM_FEATURE_AARCH64)) {
|
||||
cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_EL1_32BIT;
|
||||
}
|
||||
if (!kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_PMU_V3)) {
|
||||
|
|
|
@ -773,7 +773,7 @@ static int cpu_pre_load(void *opaque)
|
|||
env->irq_line_state = UINT32_MAX;
|
||||
|
||||
if (!kvm_enabled()) {
|
||||
pmu_op_start(&cpu->env);
|
||||
pmu_op_start(env);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -871,11 +871,11 @@ static int cpu_post_load(void *opaque, int version_id)
|
|||
}
|
||||
|
||||
if (!kvm_enabled()) {
|
||||
pmu_op_finish(&cpu->env);
|
||||
pmu_op_finish(env);
|
||||
}
|
||||
|
||||
if (tcg_enabled()) {
|
||||
arm_rebuild_hflags(&cpu->env);
|
||||
arm_rebuild_hflags(env);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -43,11 +43,8 @@ static vaddr avr_cpu_get_pc(CPUState *cs)
|
|||
|
||||
static bool avr_cpu_has_work(CPUState *cs)
|
||||
{
|
||||
AVRCPU *cpu = AVR_CPU(cs);
|
||||
CPUAVRState *env = &cpu->env;
|
||||
|
||||
return (cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_RESET))
|
||||
&& cpu_interrupts_enabled(env);
|
||||
&& cpu_interrupts_enabled(cpu_env(cs));
|
||||
}
|
||||
|
||||
static int avr_cpu_mmu_index(CPUState *cs, bool ifetch)
|
||||
|
@ -58,28 +55,22 @@ static int avr_cpu_mmu_index(CPUState *cs, bool ifetch)
|
|||
static void avr_cpu_synchronize_from_tb(CPUState *cs,
|
||||
const TranslationBlock *tb)
|
||||
{
|
||||
AVRCPU *cpu = AVR_CPU(cs);
|
||||
CPUAVRState *env = &cpu->env;
|
||||
|
||||
tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL));
|
||||
env->pc_w = tb->pc / 2; /* internally PC points to words */
|
||||
cpu_env(cs)->pc_w = tb->pc / 2; /* internally PC points to words */
|
||||
}
|
||||
|
||||
static void avr_restore_state_to_opc(CPUState *cs,
|
||||
const TranslationBlock *tb,
|
||||
const uint64_t *data)
|
||||
{
|
||||
AVRCPU *cpu = AVR_CPU(cs);
|
||||
CPUAVRState *env = &cpu->env;
|
||||
|
||||
env->pc_w = data[0];
|
||||
cpu_env(cs)->pc_w = data[0];
|
||||
}
|
||||
|
||||
static void avr_cpu_reset_hold(Object *obj)
|
||||
{
|
||||
CPUState *cs = CPU(obj);
|
||||
AVRCPU *cpu = AVR_CPU(cs);
|
||||
AVRCPUClass *mcc = AVR_CPU_GET_CLASS(cpu);
|
||||
AVRCPUClass *mcc = AVR_CPU_GET_CLASS(obj);
|
||||
CPUAVRState *env = &cpu->env;
|
||||
|
||||
if (mcc->parent_phases.hold) {
|
||||
|
@ -170,8 +161,7 @@ static ObjectClass *avr_cpu_class_by_name(const char *cpu_model)
|
|||
|
||||
static void avr_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
{
|
||||
AVRCPU *cpu = AVR_CPU(cs);
|
||||
CPUAVRState *env = &cpu->env;
|
||||
CPUAVRState *env = cpu_env(cs);
|
||||
int i;
|
||||
|
||||
qemu_fprintf(f, "\n");
|
||||
|
@ -281,8 +271,7 @@ static void avr_cpu_class_init(ObjectClass *oc, void *data)
|
|||
*/
|
||||
static void avr_avr5_initfn(Object *obj)
|
||||
{
|
||||
AVRCPU *cpu = AVR_CPU(obj);
|
||||
CPUAVRState *env = &cpu->env;
|
||||
CPUAVRState *env = cpu_env(CPU(obj));
|
||||
|
||||
set_avr_feature(env, AVR_FEATURE_LPM);
|
||||
set_avr_feature(env, AVR_FEATURE_IJMP_ICALL);
|
||||
|
@ -310,8 +299,7 @@ static void avr_avr5_initfn(Object *obj)
|
|||
*/
|
||||
static void avr_avr51_initfn(Object *obj)
|
||||
{
|
||||
AVRCPU *cpu = AVR_CPU(obj);
|
||||
CPUAVRState *env = &cpu->env;
|
||||
CPUAVRState *env = cpu_env(CPU(obj));
|
||||
|
||||
set_avr_feature(env, AVR_FEATURE_LPM);
|
||||
set_avr_feature(env, AVR_FEATURE_IJMP_ICALL);
|
||||
|
@ -340,8 +328,7 @@ static void avr_avr51_initfn(Object *obj)
|
|||
*/
|
||||
static void avr_avr6_initfn(Object *obj)
|
||||
{
|
||||
AVRCPU *cpu = AVR_CPU(obj);
|
||||
CPUAVRState *env = &cpu->env;
|
||||
CPUAVRState *env = cpu_env(CPU(obj));
|
||||
|
||||
set_avr_feature(env, AVR_FEATURE_LPM);
|
||||
set_avr_feature(env, AVR_FEATURE_IJMP_ICALL);
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
|
||||
int avr_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||
{
|
||||
AVRCPU *cpu = AVR_CPU(cs);
|
||||
CPUAVRState *env = &cpu->env;
|
||||
CPUAVRState *env = cpu_env(cs);
|
||||
|
||||
/* R */
|
||||
if (n < 32) {
|
||||
|
@ -53,8 +52,7 @@ int avr_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
|||
|
||||
int avr_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
{
|
||||
AVRCPU *cpu = AVR_CPU(cs);
|
||||
CPUAVRState *env = &cpu->env;
|
||||
CPUAVRState *env = cpu_env(cs);
|
||||
|
||||
/* R */
|
||||
if (n < 32) {
|
||||
|
|
|
@ -30,8 +30,7 @@
|
|||
|
||||
bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
||||
{
|
||||
AVRCPU *cpu = AVR_CPU(cs);
|
||||
CPUAVRState *env = &cpu->env;
|
||||
CPUAVRState *env = cpu_env(cs);
|
||||
|
||||
/*
|
||||
* We cannot separate a skip from the next instruction,
|
||||
|
@ -69,8 +68,7 @@ bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
|||
|
||||
void avr_cpu_do_interrupt(CPUState *cs)
|
||||
{
|
||||
AVRCPU *cpu = AVR_CPU(cs);
|
||||
CPUAVRState *env = &cpu->env;
|
||||
CPUAVRState *env = cpu_env(cs);
|
||||
|
||||
uint32_t ret = env->pc_w;
|
||||
int vector = 0;
|
||||
|
@ -144,9 +142,7 @@ bool avr_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
|
|||
if (probe) {
|
||||
page_size = 1;
|
||||
} else {
|
||||
AVRCPU *cpu = AVR_CPU(cs);
|
||||
CPUAVRState *env = &cpu->env;
|
||||
env->fullacc = 1;
|
||||
cpu_env(cs)->fullacc = 1;
|
||||
cpu_loop_exit_restore(cs, retaddr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2657,11 +2657,10 @@ static bool canonicalize_skip(DisasContext *ctx)
|
|||
static void avr_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
|
||||
{
|
||||
DisasContext *ctx = container_of(dcbase, DisasContext, base);
|
||||
CPUAVRState *env = cpu_env(cs);
|
||||
uint32_t tb_flags = ctx->base.tb->flags;
|
||||
|
||||
ctx->cs = cs;
|
||||
ctx->env = env;
|
||||
ctx->env = cpu_env(cs);
|
||||
ctx->npc = ctx->base.pc_first / 2;
|
||||
|
||||
ctx->skip_cond = TCG_COND_NEVER;
|
||||
|
|
|
@ -63,10 +63,9 @@ static int cris_cpu_mmu_index(CPUState *cs, bool ifetch)
|
|||
|
||||
static void cris_cpu_reset_hold(Object *obj)
|
||||
{
|
||||
CPUState *s = CPU(obj);
|
||||
CRISCPU *cpu = CRIS_CPU(s);
|
||||
CRISCPUClass *ccc = CRIS_CPU_GET_CLASS(cpu);
|
||||
CPUCRISState *env = &cpu->env;
|
||||
CPUState *cs = CPU(obj);
|
||||
CRISCPUClass *ccc = CRIS_CPU_GET_CLASS(obj);
|
||||
CPUCRISState *env = cpu_env(cs);
|
||||
uint32_t vr;
|
||||
|
||||
if (ccc->parent_phases.hold) {
|
||||
|
@ -147,10 +146,7 @@ static void cris_cpu_set_irq(void *opaque, int irq, int level)
|
|||
|
||||
static void cris_disas_set_info(CPUState *cpu, disassemble_info *info)
|
||||
{
|
||||
CRISCPU *cc = CRIS_CPU(cpu);
|
||||
CPUCRISState *env = &cc->env;
|
||||
|
||||
if (env->pregs[PR_VR] != 32) {
|
||||
if (cpu_env(cpu)->pregs[PR_VR] != 32) {
|
||||
info->mach = bfd_mach_cris_v0_v10;
|
||||
info->print_insn = print_insn_crisv10;
|
||||
} else {
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
|
||||
int crisv10_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||
{
|
||||
CRISCPU *cpu = CRIS_CPU(cs);
|
||||
CPUCRISState *env = &cpu->env;
|
||||
CPUCRISState *env = cpu_env(cs);
|
||||
|
||||
if (n < 15) {
|
||||
return gdb_get_reg32(mem_buf, env->regs[n]);
|
||||
|
@ -55,8 +54,7 @@ int crisv10_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
|||
|
||||
int cris_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||
{
|
||||
CRISCPU *cpu = CRIS_CPU(cs);
|
||||
CPUCRISState *env = &cpu->env;
|
||||
CPUCRISState *env = cpu_env(cs);
|
||||
uint8_t srs;
|
||||
|
||||
srs = env->pregs[PR_SRS];
|
||||
|
@ -90,8 +88,7 @@ int cris_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
|||
|
||||
int cris_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
{
|
||||
CRISCPU *cpu = CRIS_CPU(cs);
|
||||
CPUCRISState *env = &cpu->env;
|
||||
CPUCRISState *env = cpu_env(cs);
|
||||
uint32_t tmp;
|
||||
|
||||
if (n > 49) {
|
||||
|
|
|
@ -53,8 +53,7 @@ bool cris_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
|
|||
MMUAccessType access_type, int mmu_idx,
|
||||
bool probe, uintptr_t retaddr)
|
||||
{
|
||||
CRISCPU *cpu = CRIS_CPU(cs);
|
||||
CPUCRISState *env = &cpu->env;
|
||||
CPUCRISState *env = cpu_env(cs);
|
||||
struct cris_mmu_result res;
|
||||
int prot, miss;
|
||||
target_ulong phy;
|
||||
|
@ -97,8 +96,7 @@ bool cris_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
|
|||
|
||||
void crisv10_cpu_do_interrupt(CPUState *cs)
|
||||
{
|
||||
CRISCPU *cpu = CRIS_CPU(cs);
|
||||
CPUCRISState *env = &cpu->env;
|
||||
CPUCRISState *env = cpu_env(cs);
|
||||
int ex_vec = -1;
|
||||
|
||||
D_LOG("exception index=%d interrupt_req=%d\n",
|
||||
|
@ -159,8 +157,7 @@ void crisv10_cpu_do_interrupt(CPUState *cs)
|
|||
|
||||
void cris_cpu_do_interrupt(CPUState *cs)
|
||||
{
|
||||
CRISCPU *cpu = CRIS_CPU(cs);
|
||||
CPUCRISState *env = &cpu->env;
|
||||
CPUCRISState *env = cpu_env(cs);
|
||||
int ex_vec = -1;
|
||||
|
||||
D_LOG("exception index=%d interrupt_req=%d\n",
|
||||
|
@ -262,8 +259,7 @@ hwaddr cris_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
|
|||
bool cris_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
||||
{
|
||||
CPUClass *cc = CPU_GET_CLASS(cs);
|
||||
CRISCPU *cpu = CRIS_CPU(cs);
|
||||
CPUCRISState *env = &cpu->env;
|
||||
CPUCRISState *env = cpu_env(cs);
|
||||
bool ret = false;
|
||||
|
||||
if (interrupt_request & CPU_INTERRUPT_HARD
|
||||
|
|
|
@ -3002,7 +3002,6 @@ static void cris_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu)
|
|||
static void cris_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
|
||||
{
|
||||
DisasContext *dc = container_of(dcbase, DisasContext, base);
|
||||
CPUCRISState *env = cpu_env(cs);
|
||||
unsigned int insn_len;
|
||||
|
||||
/* Pretty disas. */
|
||||
|
@ -3010,7 +3009,7 @@ static void cris_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
|
|||
|
||||
dc->clear_x = 1;
|
||||
|
||||
insn_len = dc->decoder(env, dc);
|
||||
insn_len = dc->decoder(cpu_env(cs), dc);
|
||||
dc->ppc = dc->pc;
|
||||
dc->pc += insn_len;
|
||||
dc->base.pc_next += insn_len;
|
||||
|
@ -3176,8 +3175,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
|||
|
||||
void cris_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
{
|
||||
CRISCPU *cpu = CRIS_CPU(cs);
|
||||
CPUCRISState *env = &cpu->env;
|
||||
CPUCRISState *env = cpu_env(cs);
|
||||
const char * const *regnames;
|
||||
const char * const *pregnames;
|
||||
int i;
|
||||
|
|
|
@ -236,10 +236,7 @@ static void hexagon_dump(CPUHexagonState *env, FILE *f, int flags)
|
|||
|
||||
static void hexagon_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
{
|
||||
HexagonCPU *cpu = HEXAGON_CPU(cs);
|
||||
CPUHexagonState *env = &cpu->env;
|
||||
|
||||
hexagon_dump(env, f, flags);
|
||||
hexagon_dump(cpu_env(cs), f, flags);
|
||||
}
|
||||
|
||||
void hexagon_debug(CPUHexagonState *env)
|
||||
|
@ -249,25 +246,19 @@ void hexagon_debug(CPUHexagonState *env)
|
|||
|
||||
static void hexagon_cpu_set_pc(CPUState *cs, vaddr value)
|
||||
{
|
||||
HexagonCPU *cpu = HEXAGON_CPU(cs);
|
||||
CPUHexagonState *env = &cpu->env;
|
||||
env->gpr[HEX_REG_PC] = value;
|
||||
cpu_env(cs)->gpr[HEX_REG_PC] = value;
|
||||
}
|
||||
|
||||
static vaddr hexagon_cpu_get_pc(CPUState *cs)
|
||||
{
|
||||
HexagonCPU *cpu = HEXAGON_CPU(cs);
|
||||
CPUHexagonState *env = &cpu->env;
|
||||
return env->gpr[HEX_REG_PC];
|
||||
return cpu_env(cs)->gpr[HEX_REG_PC];
|
||||
}
|
||||
|
||||
static void hexagon_cpu_synchronize_from_tb(CPUState *cs,
|
||||
const TranslationBlock *tb)
|
||||
{
|
||||
HexagonCPU *cpu = HEXAGON_CPU(cs);
|
||||
CPUHexagonState *env = &cpu->env;
|
||||
tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL));
|
||||
env->gpr[HEX_REG_PC] = tb->pc;
|
||||
cpu_env(cs)->gpr[HEX_REG_PC] = tb->pc;
|
||||
}
|
||||
|
||||
static bool hexagon_cpu_has_work(CPUState *cs)
|
||||
|
@ -279,18 +270,14 @@ static void hexagon_restore_state_to_opc(CPUState *cs,
|
|||
const TranslationBlock *tb,
|
||||
const uint64_t *data)
|
||||
{
|
||||
HexagonCPU *cpu = HEXAGON_CPU(cs);
|
||||
CPUHexagonState *env = &cpu->env;
|
||||
|
||||
env->gpr[HEX_REG_PC] = data[0];
|
||||
cpu_env(cs)->gpr[HEX_REG_PC] = data[0];
|
||||
}
|
||||
|
||||
static void hexagon_cpu_reset_hold(Object *obj)
|
||||
{
|
||||
CPUState *cs = CPU(obj);
|
||||
HexagonCPU *cpu = HEXAGON_CPU(cs);
|
||||
HexagonCPUClass *mcc = HEXAGON_CPU_GET_CLASS(cpu);
|
||||
CPUHexagonState *env = &cpu->env;
|
||||
HexagonCPUClass *mcc = HEXAGON_CPU_GET_CLASS(obj);
|
||||
CPUHexagonState *env = cpu_env(cs);
|
||||
|
||||
if (mcc->parent_phases.hold) {
|
||||
mcc->parent_phases.hold(obj);
|
||||
|
|
|
@ -22,8 +22,7 @@
|
|||
|
||||
int hexagon_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||
{
|
||||
HexagonCPU *cpu = HEXAGON_CPU(cs);
|
||||
CPUHexagonState *env = &cpu->env;
|
||||
CPUHexagonState *env = cpu_env(cs);
|
||||
|
||||
if (n == HEX_REG_P3_0_ALIASED) {
|
||||
uint32_t p3_0 = 0;
|
||||
|
@ -42,8 +41,7 @@ int hexagon_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
|||
|
||||
int hexagon_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
{
|
||||
HexagonCPU *cpu = HEXAGON_CPU(cs);
|
||||
CPUHexagonState *env = &cpu->env;
|
||||
CPUHexagonState *env = cpu_env(cs);
|
||||
|
||||
if (n == HEX_REG_P3_0_ALIASED) {
|
||||
uint32_t p3_0 = ldtul_p(mem_buf);
|
||||
|
|
|
@ -538,7 +538,6 @@ void HELPER(iitlbt_pa20)(CPUHPPAState *env, target_ulong r1, target_ulong r2)
|
|||
/* Purge (Insn/Data) TLB. */
|
||||
static void ptlb_work(CPUState *cpu, run_on_cpu_data data)
|
||||
{
|
||||
CPUHPPAState *env = cpu_env(cpu);
|
||||
vaddr start = data.target_ptr;
|
||||
vaddr end;
|
||||
|
||||
|
@ -552,7 +551,7 @@ static void ptlb_work(CPUState *cpu, run_on_cpu_data data)
|
|||
end = (vaddr)TARGET_PAGE_SIZE << (2 * end);
|
||||
end = start + end - 1;
|
||||
|
||||
hppa_flush_tlb_range(env, start, end);
|
||||
hppa_flush_tlb_range(cpu_env(cpu), start, end);
|
||||
}
|
||||
|
||||
/* This is local to the current cpu. */
|
||||
|
|
|
@ -3811,8 +3811,7 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a)
|
|||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
if (ctx->tb_flags & PSW_C) {
|
||||
CPUHPPAState *env = cpu_env(ctx->cs);
|
||||
int type = hppa_artype_for_page(env, ctx->base.pc_next);
|
||||
int type = hppa_artype_for_page(cpu_env(ctx->cs), ctx->base.pc_next);
|
||||
/* If we could not find a TLB entry, then we need to generate an
|
||||
ITLB miss exception so the kernel will provide it.
|
||||
The resulting TLB fill operation will invalidate this TB and
|
||||
|
|
|
@ -6695,9 +6695,9 @@ static void x86_cpu_set_sgxlepubkeyhash(CPUX86State *env)
|
|||
|
||||
static void x86_cpu_reset_hold(Object *obj)
|
||||
{
|
||||
CPUState *s = CPU(obj);
|
||||
X86CPU *cpu = X86_CPU(s);
|
||||
X86CPUClass *xcc = X86_CPU_GET_CLASS(cpu);
|
||||
CPUState *cs = CPU(obj);
|
||||
X86CPU *cpu = X86_CPU(cs);
|
||||
X86CPUClass *xcc = X86_CPU_GET_CLASS(obj);
|
||||
CPUX86State *env = &cpu->env;
|
||||
target_ulong cr4;
|
||||
uint64_t xcr0;
|
||||
|
@ -6785,8 +6785,8 @@ static void x86_cpu_reset_hold(Object *obj)
|
|||
memset(env->dr, 0, sizeof(env->dr));
|
||||
env->dr[6] = DR6_FIXED_1;
|
||||
env->dr[7] = DR7_FIXED_1;
|
||||
cpu_breakpoint_remove_all(s, BP_CPU);
|
||||
cpu_watchpoint_remove_all(s, BP_CPU);
|
||||
cpu_breakpoint_remove_all(cs, BP_CPU);
|
||||
cpu_watchpoint_remove_all(cs, BP_CPU);
|
||||
|
||||
cr4 = 0;
|
||||
xcr0 = XSTATE_FP_MASK;
|
||||
|
@ -6837,9 +6837,9 @@ static void x86_cpu_reset_hold(Object *obj)
|
|||
env->triple_fault_pending = false;
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
/* We hard-wire the BSP to the first CPU. */
|
||||
apic_designate_bsp(cpu->apic_state, s->cpu_index == 0);
|
||||
apic_designate_bsp(cpu->apic_state, cs->cpu_index == 0);
|
||||
|
||||
s->halted = !cpu_is_bsp(cpu);
|
||||
cs->halted = !cpu_is_bsp(cpu);
|
||||
|
||||
if (kvm_enabled()) {
|
||||
kvm_arch_reset_vcpu(cpu);
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
return ar;
|
||||
}*/
|
||||
|
||||
bool x86_read_segment_descriptor(struct CPUState *cpu,
|
||||
bool x86_read_segment_descriptor(CPUState *cpu,
|
||||
struct x86_segment_descriptor *desc,
|
||||
x68_segment_selector sel)
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ bool x86_read_segment_descriptor(struct CPUState *cpu,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool x86_write_segment_descriptor(struct CPUState *cpu,
|
||||
bool x86_write_segment_descriptor(CPUState *cpu,
|
||||
struct x86_segment_descriptor *desc,
|
||||
x68_segment_selector sel)
|
||||
{
|
||||
|
@ -99,7 +99,7 @@ bool x86_write_segment_descriptor(struct CPUState *cpu,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool x86_read_call_gate(struct CPUState *cpu, struct x86_call_gate *idt_desc,
|
||||
bool x86_read_call_gate(CPUState *cpu, struct x86_call_gate *idt_desc,
|
||||
int gate)
|
||||
{
|
||||
target_ulong base = rvmcs(cpu->accel->fd, VMCS_GUEST_IDTR_BASE);
|
||||
|
@ -115,30 +115,30 @@ bool x86_read_call_gate(struct CPUState *cpu, struct x86_call_gate *idt_desc,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool x86_is_protected(struct CPUState *cpu)
|
||||
bool x86_is_protected(CPUState *cpu)
|
||||
{
|
||||
uint64_t cr0 = rvmcs(cpu->accel->fd, VMCS_GUEST_CR0);
|
||||
return cr0 & CR0_PE_MASK;
|
||||
}
|
||||
|
||||
bool x86_is_real(struct CPUState *cpu)
|
||||
bool x86_is_real(CPUState *cpu)
|
||||
{
|
||||
return !x86_is_protected(cpu);
|
||||
}
|
||||
|
||||
bool x86_is_v8086(struct CPUState *cpu)
|
||||
bool x86_is_v8086(CPUState *cpu)
|
||||
{
|
||||
X86CPU *x86_cpu = X86_CPU(cpu);
|
||||
CPUX86State *env = &x86_cpu->env;
|
||||
return x86_is_protected(cpu) && (env->eflags & VM_MASK);
|
||||
}
|
||||
|
||||
bool x86_is_long_mode(struct CPUState *cpu)
|
||||
bool x86_is_long_mode(CPUState *cpu)
|
||||
{
|
||||
return rvmcs(cpu->accel->fd, VMCS_GUEST_IA32_EFER) & MSR_EFER_LMA;
|
||||
}
|
||||
|
||||
bool x86_is_long64_mode(struct CPUState *cpu)
|
||||
bool x86_is_long64_mode(CPUState *cpu)
|
||||
{
|
||||
struct vmx_segment desc;
|
||||
vmx_read_segment_descriptor(cpu, &desc, R_CS);
|
||||
|
@ -146,24 +146,24 @@ bool x86_is_long64_mode(struct CPUState *cpu)
|
|||
return x86_is_long_mode(cpu) && ((desc.ar >> 13) & 1);
|
||||
}
|
||||
|
||||
bool x86_is_paging_mode(struct CPUState *cpu)
|
||||
bool x86_is_paging_mode(CPUState *cpu)
|
||||
{
|
||||
uint64_t cr0 = rvmcs(cpu->accel->fd, VMCS_GUEST_CR0);
|
||||
return cr0 & CR0_PG_MASK;
|
||||
}
|
||||
|
||||
bool x86_is_pae_enabled(struct CPUState *cpu)
|
||||
bool x86_is_pae_enabled(CPUState *cpu)
|
||||
{
|
||||
uint64_t cr4 = rvmcs(cpu->accel->fd, VMCS_GUEST_CR4);
|
||||
return cr4 & CR4_PAE_MASK;
|
||||
}
|
||||
|
||||
target_ulong linear_addr(struct CPUState *cpu, target_ulong addr, X86Seg seg)
|
||||
target_ulong linear_addr(CPUState *cpu, target_ulong addr, X86Seg seg)
|
||||
{
|
||||
return vmx_read_segment_base(cpu, seg) + addr;
|
||||
}
|
||||
|
||||
target_ulong linear_addr_size(struct CPUState *cpu, target_ulong addr, int size,
|
||||
target_ulong linear_addr_size(CPUState *cpu, target_ulong addr, int size,
|
||||
X86Seg seg)
|
||||
{
|
||||
switch (size) {
|
||||
|
@ -179,7 +179,7 @@ target_ulong linear_addr_size(struct CPUState *cpu, target_ulong addr, int size,
|
|||
return linear_addr(cpu, addr, seg);
|
||||
}
|
||||
|
||||
target_ulong linear_rip(struct CPUState *cpu, target_ulong rip)
|
||||
target_ulong linear_rip(CPUState *cpu, target_ulong rip)
|
||||
{
|
||||
return linear_addr(cpu, rip, R_CS);
|
||||
}
|
||||
|
|
|
@ -248,30 +248,30 @@ typedef struct x68_segment_selector {
|
|||
#define BH(cpu) RH(cpu, R_EBX)
|
||||
|
||||
/* deal with GDT/LDT descriptors in memory */
|
||||
bool x86_read_segment_descriptor(struct CPUState *cpu,
|
||||
bool x86_read_segment_descriptor(CPUState *cpu,
|
||||
struct x86_segment_descriptor *desc,
|
||||
x68_segment_selector sel);
|
||||
bool x86_write_segment_descriptor(struct CPUState *cpu,
|
||||
bool x86_write_segment_descriptor(CPUState *cpu,
|
||||
struct x86_segment_descriptor *desc,
|
||||
x68_segment_selector sel);
|
||||
|
||||
bool x86_read_call_gate(struct CPUState *cpu, struct x86_call_gate *idt_desc,
|
||||
bool x86_read_call_gate(CPUState *cpu, struct x86_call_gate *idt_desc,
|
||||
int gate);
|
||||
|
||||
/* helpers */
|
||||
bool x86_is_protected(struct CPUState *cpu);
|
||||
bool x86_is_real(struct CPUState *cpu);
|
||||
bool x86_is_v8086(struct CPUState *cpu);
|
||||
bool x86_is_long_mode(struct CPUState *cpu);
|
||||
bool x86_is_long64_mode(struct CPUState *cpu);
|
||||
bool x86_is_paging_mode(struct CPUState *cpu);
|
||||
bool x86_is_pae_enabled(struct CPUState *cpu);
|
||||
bool x86_is_protected(CPUState *cpu);
|
||||
bool x86_is_real(CPUState *cpu);
|
||||
bool x86_is_v8086(CPUState *cpu);
|
||||
bool x86_is_long_mode(CPUState *cpu);
|
||||
bool x86_is_long64_mode(CPUState *cpu);
|
||||
bool x86_is_paging_mode(CPUState *cpu);
|
||||
bool x86_is_pae_enabled(CPUState *cpu);
|
||||
|
||||
enum X86Seg;
|
||||
target_ulong linear_addr(struct CPUState *cpu, target_ulong addr, enum X86Seg seg);
|
||||
target_ulong linear_addr_size(struct CPUState *cpu, target_ulong addr, int size,
|
||||
target_ulong linear_addr(CPUState *cpu, target_ulong addr, enum X86Seg seg);
|
||||
target_ulong linear_addr_size(CPUState *cpu, target_ulong addr, int size,
|
||||
enum X86Seg seg);
|
||||
target_ulong linear_rip(struct CPUState *cpu, target_ulong rip);
|
||||
target_ulong linear_rip(CPUState *cpu, target_ulong rip);
|
||||
|
||||
static inline uint64_t rdtscp(void)
|
||||
{
|
||||
|
|
|
@ -67,12 +67,12 @@ x68_segment_selector vmx_read_segment_selector(CPUState *cpu, X86Seg seg)
|
|||
return sel;
|
||||
}
|
||||
|
||||
void vmx_write_segment_selector(struct CPUState *cpu, x68_segment_selector selector, X86Seg seg)
|
||||
void vmx_write_segment_selector(CPUState *cpu, x68_segment_selector selector, X86Seg seg)
|
||||
{
|
||||
wvmcs(cpu->accel->fd, vmx_segment_fields[seg].selector, selector.sel);
|
||||
}
|
||||
|
||||
void vmx_read_segment_descriptor(struct CPUState *cpu, struct vmx_segment *desc, X86Seg seg)
|
||||
void vmx_read_segment_descriptor(CPUState *cpu, struct vmx_segment *desc, X86Seg seg)
|
||||
{
|
||||
desc->sel = rvmcs(cpu->accel->fd, vmx_segment_fields[seg].selector);
|
||||
desc->base = rvmcs(cpu->accel->fd, vmx_segment_fields[seg].base);
|
||||
|
@ -90,7 +90,9 @@ void vmx_write_segment_descriptor(CPUState *cpu, struct vmx_segment *desc, X86Se
|
|||
wvmcs(cpu->accel->fd, sf->ar_bytes, desc->ar);
|
||||
}
|
||||
|
||||
void x86_segment_descriptor_to_vmx(struct CPUState *cpu, x68_segment_selector selector, struct x86_segment_descriptor *desc, struct vmx_segment *vmx_desc)
|
||||
void x86_segment_descriptor_to_vmx(CPUState *cpu, x68_segment_selector selector,
|
||||
struct x86_segment_descriptor *desc,
|
||||
struct vmx_segment *vmx_desc)
|
||||
{
|
||||
vmx_desc->sel = selector.sel;
|
||||
vmx_desc->base = x86_segment_base(desc);
|
||||
|
@ -107,7 +109,8 @@ void x86_segment_descriptor_to_vmx(struct CPUState *cpu, x68_segment_selector se
|
|||
desc->type;
|
||||
}
|
||||
|
||||
void vmx_segment_to_x86_descriptor(struct CPUState *cpu, struct vmx_segment *vmx_desc, struct x86_segment_descriptor *desc)
|
||||
void vmx_segment_to_x86_descriptor(CPUState *cpu, struct vmx_segment *vmx_desc,
|
||||
struct x86_segment_descriptor *desc)
|
||||
{
|
||||
x86_set_segment_limit(desc, vmx_desc->limit);
|
||||
x86_set_segment_base(desc, vmx_desc->base);
|
||||
|
|
|
@ -29,29 +29,29 @@ typedef struct vmx_segment {
|
|||
} vmx_segment;
|
||||
|
||||
/* deal with vmstate descriptors */
|
||||
void vmx_read_segment_descriptor(struct CPUState *cpu,
|
||||
void vmx_read_segment_descriptor(CPUState *cpu,
|
||||
struct vmx_segment *desc, enum X86Seg seg);
|
||||
void vmx_write_segment_descriptor(CPUState *cpu, struct vmx_segment *desc,
|
||||
enum X86Seg seg);
|
||||
|
||||
x68_segment_selector vmx_read_segment_selector(struct CPUState *cpu,
|
||||
x68_segment_selector vmx_read_segment_selector(CPUState *cpu,
|
||||
enum X86Seg seg);
|
||||
void vmx_write_segment_selector(struct CPUState *cpu,
|
||||
void vmx_write_segment_selector(CPUState *cpu,
|
||||
x68_segment_selector selector,
|
||||
enum X86Seg seg);
|
||||
|
||||
uint64_t vmx_read_segment_base(struct CPUState *cpu, enum X86Seg seg);
|
||||
void vmx_write_segment_base(struct CPUState *cpu, enum X86Seg seg,
|
||||
uint64_t vmx_read_segment_base(CPUState *cpu, enum X86Seg seg);
|
||||
void vmx_write_segment_base(CPUState *cpu, enum X86Seg seg,
|
||||
uint64_t base);
|
||||
|
||||
void x86_segment_descriptor_to_vmx(struct CPUState *cpu,
|
||||
void x86_segment_descriptor_to_vmx(CPUState *cpu,
|
||||
x68_segment_selector selector,
|
||||
struct x86_segment_descriptor *desc,
|
||||
struct vmx_segment *vmx_desc);
|
||||
|
||||
uint32_t vmx_read_segment_limit(CPUState *cpu, enum X86Seg seg);
|
||||
uint32_t vmx_read_segment_ar(CPUState *cpu, enum X86Seg seg);
|
||||
void vmx_segment_to_x86_descriptor(struct CPUState *cpu,
|
||||
void vmx_segment_to_x86_descriptor(CPUState *cpu,
|
||||
struct vmx_segment *vmx_desc,
|
||||
struct x86_segment_descriptor *desc);
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
void init_emu(void);
|
||||
bool exec_instruction(CPUX86State *env, struct x86_decode *ins);
|
||||
|
||||
void load_regs(struct CPUState *cpu);
|
||||
void store_regs(struct CPUState *cpu);
|
||||
void load_regs(CPUState *cpu);
|
||||
void store_regs(CPUState *cpu);
|
||||
|
||||
void simulate_rdmsr(CPUX86State *env);
|
||||
void simulate_wrmsr(CPUX86State *env);
|
||||
|
|
|
@ -49,7 +49,7 @@ struct gpt_translation {
|
|||
bool exec_access;
|
||||
};
|
||||
|
||||
static int gpt_top_level(struct CPUState *cpu, bool pae)
|
||||
static int gpt_top_level(CPUState *cpu, bool pae)
|
||||
{
|
||||
if (!pae) {
|
||||
return 2;
|
||||
|
@ -73,7 +73,7 @@ static inline int pte_size(bool pae)
|
|||
}
|
||||
|
||||
|
||||
static bool get_pt_entry(struct CPUState *cpu, struct gpt_translation *pt,
|
||||
static bool get_pt_entry(CPUState *cpu, struct gpt_translation *pt,
|
||||
int level, bool pae)
|
||||
{
|
||||
int index;
|
||||
|
@ -95,7 +95,7 @@ static bool get_pt_entry(struct CPUState *cpu, struct gpt_translation *pt,
|
|||
}
|
||||
|
||||
/* test page table entry */
|
||||
static bool test_pt_entry(struct CPUState *cpu, struct gpt_translation *pt,
|
||||
static bool test_pt_entry(CPUState *cpu, struct gpt_translation *pt,
|
||||
int level, bool *is_large, bool pae)
|
||||
{
|
||||
uint64_t pte = pt->pte[level];
|
||||
|
@ -166,7 +166,7 @@ static inline uint64_t large_page_gpa(struct gpt_translation *pt, bool pae)
|
|||
|
||||
|
||||
|
||||
static bool walk_gpt(struct CPUState *cpu, target_ulong addr, int err_code,
|
||||
static bool walk_gpt(CPUState *cpu, target_ulong addr, int err_code,
|
||||
struct gpt_translation *pt, bool pae)
|
||||
{
|
||||
int top_level, level;
|
||||
|
@ -205,7 +205,7 @@ static bool walk_gpt(struct CPUState *cpu, target_ulong addr, int err_code,
|
|||
}
|
||||
|
||||
|
||||
bool mmu_gva_to_gpa(struct CPUState *cpu, target_ulong gva, uint64_t *gpa)
|
||||
bool mmu_gva_to_gpa(CPUState *cpu, target_ulong gva, uint64_t *gpa)
|
||||
{
|
||||
bool res;
|
||||
struct gpt_translation pt;
|
||||
|
@ -225,7 +225,7 @@ bool mmu_gva_to_gpa(struct CPUState *cpu, target_ulong gva, uint64_t *gpa)
|
|||
return false;
|
||||
}
|
||||
|
||||
void vmx_write_mem(struct CPUState *cpu, target_ulong gva, void *data, int bytes)
|
||||
void vmx_write_mem(CPUState *cpu, target_ulong gva, void *data, int bytes)
|
||||
{
|
||||
uint64_t gpa;
|
||||
|
||||
|
@ -246,7 +246,7 @@ void vmx_write_mem(struct CPUState *cpu, target_ulong gva, void *data, int bytes
|
|||
}
|
||||
}
|
||||
|
||||
void vmx_read_mem(struct CPUState *cpu, void *data, target_ulong gva, int bytes)
|
||||
void vmx_read_mem(CPUState *cpu, void *data, target_ulong gva, int bytes)
|
||||
{
|
||||
uint64_t gpa;
|
||||
|
||||
|
|
|
@ -36,9 +36,9 @@
|
|||
#define MMU_PAGE_US (1 << 2)
|
||||
#define MMU_PAGE_NX (1 << 3)
|
||||
|
||||
bool mmu_gva_to_gpa(struct CPUState *cpu, target_ulong gva, uint64_t *gpa);
|
||||
bool mmu_gva_to_gpa(CPUState *cpu, target_ulong gva, uint64_t *gpa);
|
||||
|
||||
void vmx_write_mem(struct CPUState *cpu, target_ulong gva, void *data, int bytes);
|
||||
void vmx_read_mem(struct CPUState *cpu, void *data, target_ulong gva, int bytes);
|
||||
void vmx_write_mem(CPUState *cpu, target_ulong gva, void *data, int bytes);
|
||||
void vmx_read_mem(CPUState *cpu, void *data, target_ulong gva, int bytes);
|
||||
|
||||
#endif /* X86_MMU_H */
|
||||
|
|
|
@ -408,7 +408,7 @@ bool hvf_inject_interrupts(CPUState *cs)
|
|||
if (!(env->hflags & HF_INHIBIT_IRQ_MASK) &&
|
||||
(cs->interrupt_request & CPU_INTERRUPT_HARD) &&
|
||||
(env->eflags & IF_MASK) && !(info & VMCS_INTR_VALID)) {
|
||||
int line = cpu_get_pic_interrupt(&x86cpu->env);
|
||||
int line = cpu_get_pic_interrupt(env);
|
||||
cs->interrupt_request &= ~CPU_INTERRUPT_HARD;
|
||||
if (line >= 0) {
|
||||
wvmcs(cs->accel->fd, VMCS_ENTRY_INTR_INFO, line |
|
||||
|
|
|
@ -340,7 +340,6 @@ nvmm_get_registers(CPUState *cpu)
|
|||
static bool
|
||||
nvmm_can_take_int(CPUState *cpu)
|
||||
{
|
||||
CPUX86State *env = cpu_env(cpu);
|
||||
AccelCPUState *qcpu = cpu->accel;
|
||||
struct nvmm_vcpu *vcpu = &qcpu->vcpu;
|
||||
struct nvmm_machine *mach = get_nvmm_mach();
|
||||
|
@ -349,7 +348,7 @@ nvmm_can_take_int(CPUState *cpu)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (qcpu->int_shadow || !(env->eflags & IF_MASK)) {
|
||||
if (qcpu->int_shadow || !(cpu_env(cpu)->eflags & IF_MASK)) {
|
||||
struct nvmm_x64_state *state = vcpu->state;
|
||||
|
||||
/* Exit on interrupt window. */
|
||||
|
@ -645,13 +644,12 @@ static int
|
|||
nvmm_handle_halted(struct nvmm_machine *mach, CPUState *cpu,
|
||||
struct nvmm_vcpu_exit *exit)
|
||||
{
|
||||
CPUX86State *env = cpu_env(cpu);
|
||||
int ret = 0;
|
||||
|
||||
bql_lock();
|
||||
|
||||
if (!((cpu->interrupt_request & CPU_INTERRUPT_HARD) &&
|
||||
(env->eflags & IF_MASK)) &&
|
||||
(cpu_env(cpu)->eflags & IF_MASK)) &&
|
||||
!(cpu->interrupt_request & CPU_INTERRUPT_NMI)) {
|
||||
cpu->exception_index = EXCP_HLT;
|
||||
cpu->halted = true;
|
||||
|
|
|
@ -300,7 +300,6 @@ static SegmentCache whpx_seg_h2q(const WHV_X64_SEGMENT_REGISTER *hs)
|
|||
/* X64 Extended Control Registers */
|
||||
static void whpx_set_xcrs(CPUState *cpu)
|
||||
{
|
||||
CPUX86State *env = cpu_env(cpu);
|
||||
HRESULT hr;
|
||||
struct whpx_state *whpx = &whpx_global;
|
||||
WHV_REGISTER_VALUE xcr0;
|
||||
|
@ -311,7 +310,7 @@ static void whpx_set_xcrs(CPUState *cpu)
|
|||
}
|
||||
|
||||
/* Only xcr0 is supported by the hypervisor currently */
|
||||
xcr0.Reg64 = env->xcr0;
|
||||
xcr0.Reg64 = cpu_env(cpu)->xcr0;
|
||||
hr = whp_dispatch.WHvSetVirtualProcessorRegisters(
|
||||
whpx->partition, cpu->cpu_index, &xcr0_name, 1, &xcr0);
|
||||
if (FAILED(hr)) {
|
||||
|
@ -321,7 +320,6 @@ static void whpx_set_xcrs(CPUState *cpu)
|
|||
|
||||
static int whpx_set_tsc(CPUState *cpu)
|
||||
{
|
||||
CPUX86State *env = cpu_env(cpu);
|
||||
WHV_REGISTER_NAME tsc_reg = WHvX64RegisterTsc;
|
||||
WHV_REGISTER_VALUE tsc_val;
|
||||
HRESULT hr;
|
||||
|
@ -345,7 +343,7 @@ static int whpx_set_tsc(CPUState *cpu)
|
|||
}
|
||||
}
|
||||
|
||||
tsc_val.Reg64 = env->tsc;
|
||||
tsc_val.Reg64 = cpu_env(cpu)->tsc;
|
||||
hr = whp_dispatch.WHvSetVirtualProcessorRegisters(
|
||||
whpx->partition, cpu->cpu_index, &tsc_reg, 1, &tsc_val);
|
||||
if (FAILED(hr)) {
|
||||
|
@ -556,7 +554,6 @@ static void whpx_set_registers(CPUState *cpu, int level)
|
|||
|
||||
static int whpx_get_tsc(CPUState *cpu)
|
||||
{
|
||||
CPUX86State *env = cpu_env(cpu);
|
||||
WHV_REGISTER_NAME tsc_reg = WHvX64RegisterTsc;
|
||||
WHV_REGISTER_VALUE tsc_val;
|
||||
HRESULT hr;
|
||||
|
@ -569,14 +566,13 @@ static int whpx_get_tsc(CPUState *cpu)
|
|||
return -1;
|
||||
}
|
||||
|
||||
env->tsc = tsc_val.Reg64;
|
||||
cpu_env(cpu)->tsc = tsc_val.Reg64;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* X64 Extended Control Registers */
|
||||
static void whpx_get_xcrs(CPUState *cpu)
|
||||
{
|
||||
CPUX86State *env = cpu_env(cpu);
|
||||
HRESULT hr;
|
||||
struct whpx_state *whpx = &whpx_global;
|
||||
WHV_REGISTER_VALUE xcr0;
|
||||
|
@ -594,7 +590,7 @@ static void whpx_get_xcrs(CPUState *cpu)
|
|||
return;
|
||||
}
|
||||
|
||||
env->xcr0 = xcr0.Reg64;
|
||||
cpu_env(cpu)->xcr0 = xcr0.Reg64;
|
||||
}
|
||||
|
||||
static void whpx_get_registers(CPUState *cpu)
|
||||
|
@ -1400,8 +1396,7 @@ static vaddr whpx_vcpu_get_pc(CPUState *cpu, bool exit_context_valid)
|
|||
{
|
||||
if (cpu->vcpu_dirty) {
|
||||
/* The CPU registers have been modified by other parts of QEMU. */
|
||||
CPUArchState *env = cpu_env(cpu);
|
||||
return env->eip;
|
||||
return cpu_env(cpu)->eip;
|
||||
} else if (exit_context_valid) {
|
||||
/*
|
||||
* The CPU registers have not been modified by neither other parts
|
||||
|
@ -1439,12 +1434,11 @@ static vaddr whpx_vcpu_get_pc(CPUState *cpu, bool exit_context_valid)
|
|||
|
||||
static int whpx_handle_halt(CPUState *cpu)
|
||||
{
|
||||
CPUX86State *env = cpu_env(cpu);
|
||||
int ret = 0;
|
||||
|
||||
bql_lock();
|
||||
if (!((cpu->interrupt_request & CPU_INTERRUPT_HARD) &&
|
||||
(env->eflags & IF_MASK)) &&
|
||||
(cpu_env(cpu)->eflags & IF_MASK)) &&
|
||||
!(cpu->interrupt_request & CPU_INTERRUPT_NMI)) {
|
||||
cpu->exception_index = EXCP_HLT;
|
||||
cpu->halted = true;
|
||||
|
|
|
@ -91,18 +91,12 @@ void G_NORETURN do_raise_exception(CPULoongArchState *env,
|
|||
|
||||
static void loongarch_cpu_set_pc(CPUState *cs, vaddr value)
|
||||
{
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
|
||||
set_pc(env, value);
|
||||
set_pc(cpu_env(cs), value);
|
||||
}
|
||||
|
||||
static vaddr loongarch_cpu_get_pc(CPUState *cs)
|
||||
{
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
|
||||
return env->pc;
|
||||
return cpu_env(cs)->pc;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
|
@ -157,8 +151,7 @@ static inline bool cpu_loongarch_hw_interrupts_pending(CPULoongArchState *env)
|
|||
#ifndef CONFIG_USER_ONLY
|
||||
static void loongarch_cpu_do_interrupt(CPUState *cs)
|
||||
{
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
bool update_badinstr = 1;
|
||||
int cause = -1;
|
||||
const char *name;
|
||||
|
@ -308,8 +301,7 @@ static void loongarch_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr,
|
|||
MemTxResult response,
|
||||
uintptr_t retaddr)
|
||||
{
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
|
||||
if (access_type == MMU_INST_FETCH) {
|
||||
do_raise_exception(env, EXCCODE_ADEF, retaddr);
|
||||
|
@ -321,8 +313,7 @@ static void loongarch_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr,
|
|||
static bool loongarch_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
||||
{
|
||||
if (interrupt_request & CPU_INTERRUPT_HARD) {
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
|
||||
if (cpu_loongarch_hw_interrupts_enabled(env) &&
|
||||
cpu_loongarch_hw_interrupts_pending(env)) {
|
||||
|
@ -339,21 +330,15 @@ static bool loongarch_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
|||
static void loongarch_cpu_synchronize_from_tb(CPUState *cs,
|
||||
const TranslationBlock *tb)
|
||||
{
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
|
||||
tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL));
|
||||
set_pc(env, tb->pc);
|
||||
set_pc(cpu_env(cs), tb->pc);
|
||||
}
|
||||
|
||||
static void loongarch_restore_state_to_opc(CPUState *cs,
|
||||
const TranslationBlock *tb,
|
||||
const uint64_t *data)
|
||||
{
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
|
||||
set_pc(env, data[0]);
|
||||
set_pc(cpu_env(cs), data[0]);
|
||||
}
|
||||
#endif /* CONFIG_TCG */
|
||||
|
||||
|
@ -362,12 +347,10 @@ static bool loongarch_cpu_has_work(CPUState *cs)
|
|||
#ifdef CONFIG_USER_ONLY
|
||||
return true;
|
||||
#else
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
bool has_work = false;
|
||||
|
||||
if ((cs->interrupt_request & CPU_INTERRUPT_HARD) &&
|
||||
cpu_loongarch_hw_interrupts_pending(env)) {
|
||||
cpu_loongarch_hw_interrupts_pending(cpu_env(cs))) {
|
||||
has_work = true;
|
||||
}
|
||||
|
||||
|
@ -509,9 +492,8 @@ static void loongarch_max_initfn(Object *obj)
|
|||
static void loongarch_cpu_reset_hold(Object *obj)
|
||||
{
|
||||
CPUState *cs = CPU(obj);
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
LoongArchCPUClass *lacc = LOONGARCH_CPU_GET_CLASS(cpu);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
LoongArchCPUClass *lacc = LOONGARCH_CPU_GET_CLASS(obj);
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
|
||||
if (lacc->parent_phases.hold) {
|
||||
lacc->parent_phases.hold(obj);
|
||||
|
@ -694,8 +676,7 @@ static ObjectClass *loongarch_cpu_class_by_name(const char *cpu_model)
|
|||
|
||||
void loongarch_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
{
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
int i;
|
||||
|
||||
qemu_fprintf(f, " PC=%016" PRIx64 " ", env->pc);
|
||||
|
|
|
@ -218,8 +218,7 @@ int get_physical_address(CPULoongArchState *env, hwaddr *physical,
|
|||
|
||||
hwaddr loongarch_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
|
||||
{
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
hwaddr phys_addr;
|
||||
int prot;
|
||||
|
||||
|
|
|
@ -33,8 +33,7 @@ void write_fcc(CPULoongArchState *env, uint64_t val)
|
|||
|
||||
int loongarch_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||
{
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
uint64_t val;
|
||||
|
||||
if (0 <= n && n < 32) {
|
||||
|
@ -60,8 +59,7 @@ int loongarch_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
|||
|
||||
int loongarch_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
{
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
target_ulong tmp;
|
||||
int read_length;
|
||||
int length = 0;
|
||||
|
|
|
@ -37,8 +37,7 @@ static int kvm_loongarch_get_regs_core(CPUState *cs)
|
|||
int ret = 0;
|
||||
int i;
|
||||
struct kvm_regs regs;
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
|
||||
/* Get the current register set as KVM seems it */
|
||||
ret = kvm_vcpu_ioctl(cs, KVM_GET_REGS, ®s);
|
||||
|
@ -61,8 +60,7 @@ static int kvm_loongarch_put_regs_core(CPUState *cs)
|
|||
int ret = 0;
|
||||
int i;
|
||||
struct kvm_regs regs;
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
|
||||
/* Set the registers based on QEMU's view of things */
|
||||
for (i = 0; i < 32; i++) {
|
||||
|
@ -81,8 +79,7 @@ static int kvm_loongarch_put_regs_core(CPUState *cs)
|
|||
static int kvm_loongarch_get_csr(CPUState *cs)
|
||||
{
|
||||
int ret = 0;
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
|
||||
ret |= kvm_get_one_reg(cs, KVM_IOC_CSRID(LOONGARCH_CSR_CRMD),
|
||||
&env->CSR_CRMD);
|
||||
|
@ -252,8 +249,7 @@ static int kvm_loongarch_get_csr(CPUState *cs)
|
|||
static int kvm_loongarch_put_csr(CPUState *cs, int level)
|
||||
{
|
||||
int ret = 0;
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
|
||||
ret |= kvm_set_one_reg(cs, KVM_IOC_CSRID(LOONGARCH_CSR_CRMD),
|
||||
&env->CSR_CRMD);
|
||||
|
@ -429,9 +425,7 @@ static int kvm_loongarch_get_regs_fp(CPUState *cs)
|
|||
{
|
||||
int ret, i;
|
||||
struct kvm_fpu fpu;
|
||||
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
|
||||
ret = kvm_vcpu_ioctl(cs, KVM_GET_FPU, &fpu);
|
||||
if (ret < 0) {
|
||||
|
@ -455,9 +449,7 @@ static int kvm_loongarch_put_regs_fp(CPUState *cs)
|
|||
{
|
||||
int ret, i;
|
||||
struct kvm_fpu fpu;
|
||||
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
|
||||
fpu.fcsr = env->fcsr0;
|
||||
fpu.fcc = 0;
|
||||
|
@ -486,8 +478,7 @@ static int kvm_loongarch_get_mpstate(CPUState *cs)
|
|||
{
|
||||
int ret = 0;
|
||||
struct kvm_mp_state mp_state;
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
|
||||
if (cap_has_mp_state) {
|
||||
ret = kvm_vcpu_ioctl(cs, KVM_GET_MP_STATE, &mp_state);
|
||||
|
@ -504,12 +495,8 @@ static int kvm_loongarch_get_mpstate(CPUState *cs)
|
|||
static int kvm_loongarch_put_mpstate(CPUState *cs)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
|
||||
struct kvm_mp_state mp_state = {
|
||||
.mp_state = env->mp_state
|
||||
.mp_state = cpu_env(cs)->mp_state
|
||||
};
|
||||
|
||||
if (cap_has_mp_state) {
|
||||
|
@ -526,8 +513,7 @@ static int kvm_loongarch_get_cpucfg(CPUState *cs)
|
|||
{
|
||||
int i, ret = 0;
|
||||
uint64_t val;
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
|
||||
for (i = 0; i < 21; i++) {
|
||||
ret = kvm_get_one_reg(cs, KVM_IOC_CPUCFG(i), &val);
|
||||
|
@ -548,8 +534,7 @@ static int kvm_check_cpucfg2(CPUState *cs)
|
|||
.attr = 2,
|
||||
.addr = (uint64_t)&val,
|
||||
};
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
|
||||
ret = kvm_vcpu_ioctl(cs, KVM_HAS_DEVICE_ATTR, &attr);
|
||||
|
||||
|
@ -574,8 +559,7 @@ static int kvm_check_cpucfg2(CPUState *cs)
|
|||
static int kvm_loongarch_put_cpucfg(CPUState *cs)
|
||||
{
|
||||
int i, ret = 0;
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
uint64_t val;
|
||||
|
||||
for (i = 0; i < 21; i++) {
|
||||
|
@ -757,8 +741,7 @@ bool kvm_arch_cpu_check_are_resettable(void)
|
|||
int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run)
|
||||
{
|
||||
int ret = 0;
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
MemTxAttrs attrs = {};
|
||||
|
||||
attrs.requester_id = env_cpu(env)->cpu_index;
|
||||
|
|
|
@ -449,8 +449,7 @@ bool loongarch_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
|
|||
MMUAccessType access_type, int mmu_idx,
|
||||
bool probe, uintptr_t retaddr)
|
||||
{
|
||||
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
hwaddr physical;
|
||||
int prot;
|
||||
int ret;
|
||||
|
|
|
@ -282,10 +282,9 @@ static uint64_t make_address_pc(DisasContext *ctx, uint64_t addr)
|
|||
|
||||
static void loongarch_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
|
||||
{
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
DisasContext *ctx = container_of(dcbase, DisasContext, base);
|
||||
|
||||
ctx->opcode = translator_ldl(env, &ctx->base, ctx->base.pc_next);
|
||||
ctx->opcode = translator_ldl(cpu_env(cs), &ctx->base, ctx->base.pc_next);
|
||||
|
||||
if (!decode(ctx, ctx->opcode)) {
|
||||
qemu_log_mask(LOG_UNIMP, "Error: unknown opcode. "
|
||||
|
|
|
@ -73,10 +73,9 @@ static void m68k_unset_feature(CPUM68KState *env, int feature)
|
|||
|
||||
static void m68k_cpu_reset_hold(Object *obj)
|
||||
{
|
||||
CPUState *s = CPU(obj);
|
||||
M68kCPU *cpu = M68K_CPU(s);
|
||||
M68kCPUClass *mcc = M68K_CPU_GET_CLASS(cpu);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUState *cs = CPU(obj);
|
||||
M68kCPUClass *mcc = M68K_CPU_GET_CLASS(obj);
|
||||
CPUM68KState *env = cpu_env(cs);
|
||||
floatx80 nan = floatx80_default_nan(NULL);
|
||||
int i;
|
||||
|
||||
|
@ -122,8 +121,7 @@ static ObjectClass *m68k_cpu_class_by_name(const char *cpu_model)
|
|||
|
||||
static void m5206_cpu_initfn(Object *obj)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(obj);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(CPU(obj));
|
||||
|
||||
m68k_set_feature(env, M68K_FEATURE_CF_ISA_A);
|
||||
m68k_set_feature(env, M68K_FEATURE_MOVEFROMSR_PRIV);
|
||||
|
@ -132,8 +130,7 @@ static void m5206_cpu_initfn(Object *obj)
|
|||
/* Base feature set, including isns. for m68k family */
|
||||
static void m68000_cpu_initfn(Object *obj)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(obj);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(CPU(obj));
|
||||
|
||||
m68k_set_feature(env, M68K_FEATURE_M68K);
|
||||
m68k_set_feature(env, M68K_FEATURE_USP);
|
||||
|
@ -147,8 +144,7 @@ static void m68000_cpu_initfn(Object *obj)
|
|||
*/
|
||||
static void m68010_cpu_initfn(Object *obj)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(obj);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(CPU(obj));
|
||||
|
||||
m68000_cpu_initfn(obj);
|
||||
m68k_set_feature(env, M68K_FEATURE_M68010);
|
||||
|
@ -168,8 +164,7 @@ static void m68010_cpu_initfn(Object *obj)
|
|||
*/
|
||||
static void m68020_cpu_initfn(Object *obj)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(obj);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(CPU(obj));
|
||||
|
||||
m68010_cpu_initfn(obj);
|
||||
m68k_unset_feature(env, M68K_FEATURE_M68010);
|
||||
|
@ -199,8 +194,7 @@ static void m68020_cpu_initfn(Object *obj)
|
|||
*/
|
||||
static void m68030_cpu_initfn(Object *obj)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(obj);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(CPU(obj));
|
||||
|
||||
m68020_cpu_initfn(obj);
|
||||
m68k_unset_feature(env, M68K_FEATURE_M68020);
|
||||
|
@ -226,8 +220,7 @@ static void m68030_cpu_initfn(Object *obj)
|
|||
*/
|
||||
static void m68040_cpu_initfn(Object *obj)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(obj);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(CPU(obj));
|
||||
|
||||
m68030_cpu_initfn(obj);
|
||||
m68k_unset_feature(env, M68K_FEATURE_M68030);
|
||||
|
@ -247,8 +240,7 @@ static void m68040_cpu_initfn(Object *obj)
|
|||
*/
|
||||
static void m68060_cpu_initfn(Object *obj)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(obj);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(CPU(obj));
|
||||
|
||||
m68040_cpu_initfn(obj);
|
||||
m68k_unset_feature(env, M68K_FEATURE_M68040);
|
||||
|
@ -261,8 +253,7 @@ static void m68060_cpu_initfn(Object *obj)
|
|||
|
||||
static void m5208_cpu_initfn(Object *obj)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(obj);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(CPU(obj));
|
||||
|
||||
m68k_set_feature(env, M68K_FEATURE_CF_ISA_A);
|
||||
m68k_set_feature(env, M68K_FEATURE_CF_ISA_APLUSC);
|
||||
|
@ -274,8 +265,7 @@ static void m5208_cpu_initfn(Object *obj)
|
|||
|
||||
static void cfv4e_cpu_initfn(Object *obj)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(obj);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(CPU(obj));
|
||||
|
||||
m68k_set_feature(env, M68K_FEATURE_CF_ISA_A);
|
||||
m68k_set_feature(env, M68K_FEATURE_CF_ISA_B);
|
||||
|
@ -288,8 +278,7 @@ static void cfv4e_cpu_initfn(Object *obj)
|
|||
|
||||
static void any_cpu_initfn(Object *obj)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(obj);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(CPU(obj));
|
||||
|
||||
m68k_set_feature(env, M68K_FEATURE_CF_ISA_A);
|
||||
m68k_set_feature(env, M68K_FEATURE_CF_ISA_B);
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
|
||||
int m68k_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(cs);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(cs);
|
||||
|
||||
if (n < 8) {
|
||||
/* D0-D7 */
|
||||
|
@ -50,8 +49,7 @@ int m68k_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
|||
|
||||
int m68k_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(cs);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(cs);
|
||||
uint32_t tmp;
|
||||
|
||||
tmp = ldl_p(mem_buf);
|
||||
|
|
|
@ -906,8 +906,7 @@ txfail:
|
|||
|
||||
hwaddr m68k_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(cs);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(cs);
|
||||
hwaddr phys_addr;
|
||||
int prot;
|
||||
int access_type;
|
||||
|
@ -955,8 +954,7 @@ bool m68k_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
|
|||
MMUAccessType qemu_access_type, int mmu_idx,
|
||||
bool probe, uintptr_t retaddr)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(cs);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(cs);
|
||||
hwaddr physical;
|
||||
int prot;
|
||||
int access_type;
|
||||
|
@ -984,7 +982,7 @@ bool m68k_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
|
|||
access_type |= ACCESS_SUPER;
|
||||
}
|
||||
|
||||
ret = get_physical_address(&cpu->env, &physical, &prot,
|
||||
ret = get_physical_address(env, &physical, &prot,
|
||||
address, access_type, &page_size);
|
||||
if (likely(ret == 0)) {
|
||||
tlb_set_page(cs, address & TARGET_PAGE_MASK,
|
||||
|
|
|
@ -77,8 +77,7 @@ static int host_to_gdb_errno(int err)
|
|||
|
||||
static void m68k_semi_u32_cb(CPUState *cs, uint64_t ret, int err)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(cs);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(cs);
|
||||
|
||||
target_ulong args = env->dregs[1];
|
||||
if (put_user_u32(ret, args) ||
|
||||
|
@ -95,8 +94,7 @@ static void m68k_semi_u32_cb(CPUState *cs, uint64_t ret, int err)
|
|||
|
||||
static void m68k_semi_u64_cb(CPUState *cs, uint64_t ret, int err)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(cs);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(cs);
|
||||
|
||||
target_ulong args = env->dregs[1];
|
||||
if (put_user_u32(ret >> 32, args) ||
|
||||
|
|
|
@ -441,10 +441,7 @@ static void do_interrupt_all(CPUM68KState *env, int is_hw)
|
|||
|
||||
void m68k_cpu_do_interrupt(CPUState *cs)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(cs);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
|
||||
do_interrupt_all(env, 0);
|
||||
do_interrupt_all(cpu_env(cs), 0);
|
||||
}
|
||||
|
||||
static inline void do_interrupt_m68k_hardirq(CPUM68KState *env)
|
||||
|
@ -457,8 +454,7 @@ void m68k_cpu_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr,
|
|||
int mmu_idx, MemTxAttrs attrs,
|
||||
MemTxResult response, uintptr_t retaddr)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(cs);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(cs);
|
||||
|
||||
cpu_restore_state(cs, retaddr);
|
||||
|
||||
|
@ -511,8 +507,7 @@ void m68k_cpu_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr,
|
|||
|
||||
bool m68k_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(cs);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(cs);
|
||||
|
||||
if (interrupt_request & CPU_INTERRUPT_HARD
|
||||
&& ((env->sr & SR_I) >> SR_I_SHIFT) < env->pending_level) {
|
||||
|
|
|
@ -6100,8 +6100,7 @@ static double floatx80_to_double(CPUM68KState *env, uint16_t high, uint64_t low)
|
|||
|
||||
void m68k_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
{
|
||||
M68kCPU *cpu = M68K_CPU(cs);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
CPUM68KState *env = cpu_env(cs);
|
||||
int i;
|
||||
uint16_t sr;
|
||||
for (i = 0; i < 8; i++) {
|
||||
|
|
|
@ -183,9 +183,9 @@ static void microblaze_cpu_set_irq(void *opaque, int irq, int level)
|
|||
|
||||
static void mb_cpu_reset_hold(Object *obj)
|
||||
{
|
||||
CPUState *s = CPU(obj);
|
||||
MicroBlazeCPU *cpu = MICROBLAZE_CPU(s);
|
||||
MicroBlazeCPUClass *mcc = MICROBLAZE_CPU_GET_CLASS(cpu);
|
||||
CPUState *cs = CPU(obj);
|
||||
MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
|
||||
MicroBlazeCPUClass *mcc = MICROBLAZE_CPU_GET_CLASS(obj);
|
||||
CPUMBState *env = &cpu->env;
|
||||
|
||||
if (mcc->parent_phases.hold) {
|
||||
|
|
|
@ -110,9 +110,8 @@ int mb_cpu_gdb_read_stack_protect(CPUState *cs, GByteArray *mem_buf, int n)
|
|||
|
||||
int mb_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
{
|
||||
MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
|
||||
CPUClass *cc = CPU_GET_CLASS(cs);
|
||||
CPUMBState *env = &cpu->env;
|
||||
CPUMBState *env = cpu_env(cs);
|
||||
uint32_t tmp;
|
||||
|
||||
if (n > cc->gdb_num_core_regs) {
|
||||
|
|
|
@ -252,8 +252,7 @@ hwaddr mb_cpu_get_phys_page_attrs_debug(CPUState *cs, vaddr addr,
|
|||
|
||||
bool mb_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
||||
{
|
||||
MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
|
||||
CPUMBState *env = &cpu->env;
|
||||
CPUMBState *env = cpu_env(cs);
|
||||
|
||||
if ((interrupt_request & CPU_INTERRUPT_HARD)
|
||||
&& (env->msr & MSR_IE)
|
||||
|
|
|
@ -1630,7 +1630,6 @@ static void mb_tr_insn_start(DisasContextBase *dcb, CPUState *cs)
|
|||
static void mb_tr_translate_insn(DisasContextBase *dcb, CPUState *cs)
|
||||
{
|
||||
DisasContext *dc = container_of(dcb, DisasContext, base);
|
||||
CPUMBState *env = cpu_env(cs);
|
||||
uint32_t ir;
|
||||
|
||||
/* TODO: This should raise an exception, not terminate qemu. */
|
||||
|
@ -1641,7 +1640,7 @@ static void mb_tr_translate_insn(DisasContextBase *dcb, CPUState *cs)
|
|||
|
||||
dc->tb_flags_to_set = 0;
|
||||
|
||||
ir = cpu_ldl_code(env, dc->base.pc_next);
|
||||
ir = cpu_ldl_code(cpu_env(cs), dc->base.pc_next);
|
||||
if (!decode(dc, ir)) {
|
||||
trap_illegal(dc, true);
|
||||
}
|
||||
|
@ -1800,8 +1799,7 @@ void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_insns,
|
|||
|
||||
void mb_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
{
|
||||
MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
|
||||
CPUMBState *env = &cpu->env;
|
||||
CPUMBState *env = cpu_env(cs);
|
||||
uint32_t iflags;
|
||||
int i;
|
||||
|
||||
|
|
|
@ -80,8 +80,7 @@ static void fpu_dump_state(CPUMIPSState *env, FILE *f, int flags)
|
|||
|
||||
static void mips_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
int i;
|
||||
|
||||
qemu_fprintf(f, "pc=0x" TARGET_FMT_lx " HI=0x" TARGET_FMT_lx
|
||||
|
@ -123,9 +122,7 @@ void cpu_set_exception_base(int vp_index, target_ulong address)
|
|||
|
||||
static void mips_cpu_set_pc(CPUState *cs, vaddr value)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
|
||||
mips_env_set_pc(&cpu->env, value);
|
||||
mips_env_set_pc(cpu_env(cs), value);
|
||||
}
|
||||
|
||||
static vaddr mips_cpu_get_pc(CPUState *cs)
|
||||
|
@ -137,8 +134,7 @@ static vaddr mips_cpu_get_pc(CPUState *cs)
|
|||
|
||||
static bool mips_cpu_has_work(CPUState *cs)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
bool has_work = false;
|
||||
|
||||
/*
|
||||
|
@ -193,7 +189,7 @@ static void mips_cpu_reset_hold(Object *obj)
|
|||
{
|
||||
CPUState *cs = CPU(obj);
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
MIPSCPUClass *mcc = MIPS_CPU_GET_CLASS(cpu);
|
||||
MIPSCPUClass *mcc = MIPS_CPU_GET_CLASS(obj);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
|
||||
if (mcc->parent_phases.hold) {
|
||||
|
@ -433,10 +429,7 @@ static void mips_cpu_reset_hold(Object *obj)
|
|||
|
||||
static void mips_cpu_disas_set_info(CPUState *s, disassemble_info *info)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(s);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
|
||||
if (!(env->insn_flags & ISA_NANOMIPS32)) {
|
||||
if (!(cpu_env(s)->insn_flags & ISA_NANOMIPS32)) {
|
||||
#if TARGET_BIG_ENDIAN
|
||||
info->print_insn = print_insn_big_mips;
|
||||
#else
|
||||
|
|
|
@ -25,8 +25,7 @@
|
|||
|
||||
int mips_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
|
||||
if (n < 32) {
|
||||
return gdb_get_regl(mem_buf, env->active_tc.gpr[n]);
|
||||
|
@ -78,8 +77,7 @@ int mips_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
|||
|
||||
int mips_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
target_ulong tmp;
|
||||
|
||||
tmp = ldtul_p(mem_buf);
|
||||
|
|
|
@ -63,8 +63,7 @@ int kvm_arch_irqchip_create(KVMState *s)
|
|||
|
||||
int kvm_arch_init_vcpu(CPUState *cs)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
int ret = 0;
|
||||
|
||||
qemu_add_vm_change_state_handler(kvm_mips_update_state, cs);
|
||||
|
@ -460,8 +459,7 @@ static inline int kvm_mips_change_one_reg(CPUState *cs, uint64_t reg_id,
|
|||
*/
|
||||
static int kvm_mips_save_count(CPUState *cs)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
uint64_t count_ctl;
|
||||
int err, ret = 0;
|
||||
|
||||
|
@ -502,8 +500,7 @@ static int kvm_mips_save_count(CPUState *cs)
|
|||
*/
|
||||
static int kvm_mips_restore_count(CPUState *cs)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
uint64_t count_ctl;
|
||||
int err_dc, err, ret = 0;
|
||||
|
||||
|
@ -590,8 +587,7 @@ static void kvm_mips_update_state(void *opaque, bool running, RunState state)
|
|||
|
||||
static int kvm_mips_put_fpu_registers(CPUState *cs, int level)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
int err, ret = 0;
|
||||
unsigned int i;
|
||||
|
||||
|
@ -670,8 +666,7 @@ static int kvm_mips_put_fpu_registers(CPUState *cs, int level)
|
|||
|
||||
static int kvm_mips_get_fpu_registers(CPUState *cs)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
int err, ret = 0;
|
||||
unsigned int i;
|
||||
|
||||
|
@ -751,8 +746,7 @@ static int kvm_mips_get_fpu_registers(CPUState *cs)
|
|||
|
||||
static int kvm_mips_put_cp0_registers(CPUState *cs, int level)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
int err, ret = 0;
|
||||
|
||||
(void)level;
|
||||
|
@ -974,8 +968,7 @@ static int kvm_mips_put_cp0_registers(CPUState *cs, int level)
|
|||
|
||||
static int kvm_mips_get_cp0_registers(CPUState *cs)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
int err, ret = 0;
|
||||
|
||||
err = kvm_mips_get_one_reg(cs, KVM_REG_MIPS_CP0_INDEX, &env->CP0_Index);
|
||||
|
@ -1181,8 +1174,7 @@ static int kvm_mips_get_cp0_registers(CPUState *cs)
|
|||
|
||||
int kvm_arch_put_registers(CPUState *cs, int level)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
struct kvm_regs regs;
|
||||
int ret;
|
||||
int i;
|
||||
|
@ -1217,8 +1209,7 @@ int kvm_arch_put_registers(CPUState *cs, int level)
|
|||
|
||||
int kvm_arch_get_registers(CPUState *cs)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
int ret = 0;
|
||||
struct kvm_regs regs;
|
||||
int i;
|
||||
|
|
|
@ -230,8 +230,7 @@ int get_physical_address(CPUMIPSState *env, hwaddr *physical,
|
|||
|
||||
hwaddr mips_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
hwaddr phys_addr;
|
||||
int prot;
|
||||
|
||||
|
|
|
@ -79,8 +79,7 @@ void helper_wait(CPUMIPSState *env)
|
|||
|
||||
void mips_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
|
||||
tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL));
|
||||
env->active_tc.PC = tb->pc;
|
||||
|
|
|
@ -279,8 +279,7 @@ void mips_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
|
|||
MMUAccessType access_type,
|
||||
int mmu_idx, uintptr_t retaddr)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
int error_code = 0;
|
||||
int excp;
|
||||
|
||||
|
@ -306,9 +305,8 @@ void mips_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr,
|
|||
int mmu_idx, MemTxAttrs attrs,
|
||||
MemTxResult response, uintptr_t retaddr)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
MIPSCPUClass *mcc = MIPS_CPU_GET_CLASS(cpu);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
MIPSCPUClass *mcc = MIPS_CPU_GET_CLASS(cs);
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
|
||||
if (access_type == MMU_INST_FETCH) {
|
||||
do_raise_exception(env, EXCP_IBE, retaddr);
|
||||
|
|
|
@ -90,8 +90,7 @@ static void debug_post_eret(CPUMIPSState *env)
|
|||
|
||||
bool mips_io_recompile_replay_branch(CPUState *cs, const TranslationBlock *tb)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
|
||||
if ((env->hflags & MIPS_HFLAG_BMASK) != 0
|
||||
&& !(cs->tcg_cflags & CF_PCREL) && env->active_tc.PC != tb->pc) {
|
||||
|
|
|
@ -906,8 +906,7 @@ bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
|
|||
MMUAccessType access_type, int mmu_idx,
|
||||
bool probe, uintptr_t retaddr)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
hwaddr physical;
|
||||
int prot;
|
||||
int ret = TLBRET_BADADDR;
|
||||
|
@ -1340,8 +1339,7 @@ void mips_cpu_do_interrupt(CPUState *cs)
|
|||
bool mips_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
||||
{
|
||||
if (interrupt_request & CPU_INTERRUPT_HARD) {
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
|
||||
if (cpu_mips_hw_interrupts_enabled(env) &&
|
||||
cpu_mips_hw_interrupts_pending(env)) {
|
||||
|
|
|
@ -15566,8 +15566,7 @@ void mips_restore_state_to_opc(CPUState *cs,
|
|||
const TranslationBlock *tb,
|
||||
const uint64_t *data)
|
||||
{
|
||||
MIPSCPU *cpu = MIPS_CPU(cs);
|
||||
CPUMIPSState *env = &cpu->env;
|
||||
CPUMIPSState *env = cpu_env(cs);
|
||||
|
||||
env->active_tc.PC = data[0];
|
||||
env->hflags &= ~MIPS_HFLAG_BMASK;
|
||||
|
|
|
@ -28,28 +28,19 @@
|
|||
|
||||
static void nios2_cpu_set_pc(CPUState *cs, vaddr value)
|
||||
{
|
||||
Nios2CPU *cpu = NIOS2_CPU(cs);
|
||||
CPUNios2State *env = &cpu->env;
|
||||
|
||||
env->pc = value;
|
||||
cpu_env(cs)->pc = value;
|
||||
}
|
||||
|
||||
static vaddr nios2_cpu_get_pc(CPUState *cs)
|
||||
{
|
||||
Nios2CPU *cpu = NIOS2_CPU(cs);
|
||||
CPUNios2State *env = &cpu->env;
|
||||
|
||||
return env->pc;
|
||||
return cpu_env(cs)->pc;
|
||||
}
|
||||
|
||||
static void nios2_restore_state_to_opc(CPUState *cs,
|
||||
const TranslationBlock *tb,
|
||||
const uint64_t *data)
|
||||
{
|
||||
Nios2CPU *cpu = NIOS2_CPU(cs);
|
||||
CPUNios2State *env = &cpu->env;
|
||||
|
||||
env->pc = data[0];
|
||||
cpu_env(cs)->pc = data[0];
|
||||
}
|
||||
|
||||
static bool nios2_cpu_has_work(CPUState *cs)
|
||||
|
@ -67,7 +58,7 @@ static void nios2_cpu_reset_hold(Object *obj)
|
|||
{
|
||||
CPUState *cs = CPU(obj);
|
||||
Nios2CPU *cpu = NIOS2_CPU(cs);
|
||||
Nios2CPUClass *ncc = NIOS2_CPU_GET_CLASS(cpu);
|
||||
Nios2CPUClass *ncc = NIOS2_CPU_GET_CLASS(obj);
|
||||
CPUNios2State *env = &cpu->env;
|
||||
|
||||
if (ncc->parent_phases.hold) {
|
||||
|
|
|
@ -287,8 +287,7 @@ void nios2_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
|
|||
MMUAccessType access_type,
|
||||
int mmu_idx, uintptr_t retaddr)
|
||||
{
|
||||
Nios2CPU *cpu = NIOS2_CPU(cs);
|
||||
CPUNios2State *env = &cpu->env;
|
||||
CPUNios2State *env = cpu_env(cs);
|
||||
|
||||
env->ctrl[CR_BADADDR] = addr;
|
||||
cs->exception_index = EXCP_UNALIGN;
|
||||
|
|
|
@ -75,8 +75,7 @@ static int host_to_gdb_errno(int err)
|
|||
|
||||
static void nios2_semi_u32_cb(CPUState *cs, uint64_t ret, int err)
|
||||
{
|
||||
Nios2CPU *cpu = NIOS2_CPU(cs);
|
||||
CPUNios2State *env = &cpu->env;
|
||||
CPUNios2State *env = cpu_env(cs);
|
||||
target_ulong args = env->regs[R_ARG1];
|
||||
|
||||
if (put_user_u32(ret, args) ||
|
||||
|
@ -93,8 +92,7 @@ static void nios2_semi_u32_cb(CPUState *cs, uint64_t ret, int err)
|
|||
|
||||
static void nios2_semi_u64_cb(CPUState *cs, uint64_t ret, int err)
|
||||
{
|
||||
Nios2CPU *cpu = NIOS2_CPU(cs);
|
||||
CPUNios2State *env = &cpu->env;
|
||||
CPUNios2State *env = cpu_env(cs);
|
||||
target_ulong args = env->regs[R_ARG1];
|
||||
|
||||
if (put_user_u32(ret >> 32, args) ||
|
||||
|
|
|
@ -970,7 +970,6 @@ static void nios2_tr_insn_start(DisasContextBase *dcbase, CPUState *cs)
|
|||
static void nios2_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
|
||||
{
|
||||
DisasContext *dc = container_of(dcbase, DisasContext, base);
|
||||
CPUNios2State *env = cpu_env(cs);
|
||||
const Nios2Instruction *instr;
|
||||
uint32_t code, pc;
|
||||
uint8_t op;
|
||||
|
@ -980,7 +979,7 @@ static void nios2_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
|
|||
dc->base.pc_next = pc + 4;
|
||||
|
||||
/* Decode an instruction */
|
||||
code = cpu_ldl_code(env, pc);
|
||||
code = cpu_ldl_code(cpu_env(cs), pc);
|
||||
op = get_opcode(code);
|
||||
|
||||
if (unlikely(op >= ARRAY_SIZE(i_type_instructions))) {
|
||||
|
|
|
@ -87,9 +87,9 @@ static void openrisc_disas_set_info(CPUState *cpu, disassemble_info *info)
|
|||
|
||||
static void openrisc_cpu_reset_hold(Object *obj)
|
||||
{
|
||||
CPUState *s = CPU(obj);
|
||||
OpenRISCCPU *cpu = OPENRISC_CPU(s);
|
||||
OpenRISCCPUClass *occ = OPENRISC_CPU_GET_CLASS(cpu);
|
||||
CPUState *cs = CPU(obj);
|
||||
OpenRISCCPU *cpu = OPENRISC_CPU(cs);
|
||||
OpenRISCCPUClass *occ = OPENRISC_CPU_GET_CLASS(obj);
|
||||
|
||||
if (occ->parent_phases.hold) {
|
||||
occ->parent_phases.hold(obj);
|
||||
|
@ -100,7 +100,7 @@ static void openrisc_cpu_reset_hold(Object *obj)
|
|||
cpu->env.pc = 0x100;
|
||||
cpu->env.sr = SR_FO | SR_SM;
|
||||
cpu->env.lock_addr = -1;
|
||||
s->exception_index = -1;
|
||||
cs->exception_index = -1;
|
||||
cpu_set_fpcsr(&cpu->env, 0);
|
||||
|
||||
set_float_detect_tininess(float_tininess_before_rounding,
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
|
||||
int openrisc_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||
{
|
||||
OpenRISCCPU *cpu = OPENRISC_CPU(cs);
|
||||
CPUOpenRISCState *env = &cpu->env;
|
||||
CPUOpenRISCState *env = cpu_env(cs);
|
||||
|
||||
if (n < 32) {
|
||||
return gdb_get_reg32(mem_buf, cpu_get_gpr(env, n));
|
||||
|
@ -48,9 +47,8 @@ int openrisc_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
|||
|
||||
int openrisc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
{
|
||||
OpenRISCCPU *cpu = OPENRISC_CPU(cs);
|
||||
CPUClass *cc = CPU_GET_CLASS(cs);
|
||||
CPUOpenRISCState *env = &cpu->env;
|
||||
CPUOpenRISCState *env = cpu_env(cs);
|
||||
uint32_t tmp;
|
||||
|
||||
if (n > cc->gdb_num_core_regs) {
|
||||
|
|
|
@ -29,8 +29,7 @@
|
|||
|
||||
void openrisc_cpu_do_interrupt(CPUState *cs)
|
||||
{
|
||||
OpenRISCCPU *cpu = OPENRISC_CPU(cs);
|
||||
CPUOpenRISCState *env = &cpu->env;
|
||||
CPUOpenRISCState *env = cpu_env(cs);
|
||||
int exception = cs->exception_index;
|
||||
|
||||
env->epcr = env->pc;
|
||||
|
@ -105,8 +104,7 @@ void openrisc_cpu_do_interrupt(CPUState *cs)
|
|||
|
||||
bool openrisc_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
||||
{
|
||||
OpenRISCCPU *cpu = OPENRISC_CPU(cs);
|
||||
CPUOpenRISCState *env = &cpu->env;
|
||||
CPUOpenRISCState *env = cpu_env(cs);
|
||||
int idx = -1;
|
||||
|
||||
if ((interrupt_request & CPU_INTERRUPT_HARD) && (env->sr & SR_IEE)) {
|
||||
|
|
|
@ -1564,8 +1564,7 @@ static void openrisc_tr_insn_start(DisasContextBase *dcbase, CPUState *cs)
|
|||
static void openrisc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
|
||||
{
|
||||
DisasContext *dc = container_of(dcbase, DisasContext, base);
|
||||
OpenRISCCPU *cpu = OPENRISC_CPU(cs);
|
||||
uint32_t insn = translator_ldl(&cpu->env, &dc->base, dc->base.pc_next);
|
||||
uint32_t insn = translator_ldl(cpu_env(cs), &dc->base, dc->base.pc_next);
|
||||
|
||||
if (!decode(dc, insn)) {
|
||||
gen_illegal_exception(dc);
|
||||
|
@ -1668,8 +1667,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
|||
|
||||
void openrisc_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
{
|
||||
OpenRISCCPU *cpu = OPENRISC_CPU(cs);
|
||||
CPUOpenRISCState *env = &cpu->env;
|
||||
CPUOpenRISCState *env = cpu_env(cs);
|
||||
int i;
|
||||
|
||||
qemu_fprintf(f, "PC=%08x\n", env->pc);
|
||||
|
|
|
@ -7108,9 +7108,9 @@ static int ppc_cpu_mmu_index(CPUState *cs, bool ifetch)
|
|||
|
||||
static void ppc_cpu_reset_hold(Object *obj)
|
||||
{
|
||||
CPUState *s = CPU(obj);
|
||||
PowerPCCPU *cpu = POWERPC_CPU(s);
|
||||
PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
|
||||
CPUState *cs = CPU(obj);
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(obj);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
target_ulong msr;
|
||||
int i;
|
||||
|
@ -7159,8 +7159,8 @@ static void ppc_cpu_reset_hold(Object *obj)
|
|||
env->nip = env->hreset_vector | env->excp_prefix;
|
||||
|
||||
if (tcg_enabled()) {
|
||||
cpu_breakpoint_remove_all(s, BP_CPU);
|
||||
cpu_watchpoint_remove_all(s, BP_CPU);
|
||||
cpu_breakpoint_remove_all(cs, BP_CPU);
|
||||
cpu_watchpoint_remove_all(cs, BP_CPU);
|
||||
if (env->mmu_model != POWERPC_MMU_REAL) {
|
||||
ppc_tlb_invalidate_all(env);
|
||||
}
|
||||
|
@ -7174,7 +7174,7 @@ static void ppc_cpu_reset_hold(Object *obj)
|
|||
env->reserve_addr = (target_ulong)-1ULL;
|
||||
/* Be sure no exception or interrupt is pending */
|
||||
env->pending_interrupts = 0;
|
||||
s->exception_index = POWERPC_EXCP_NONE;
|
||||
cs->exception_index = POWERPC_EXCP_NONE;
|
||||
env->error_code = 0;
|
||||
ppc_irq_reset(cpu);
|
||||
|
||||
|
@ -7196,12 +7196,9 @@ static void ppc_cpu_reset_hold(Object *obj)
|
|||
|
||||
static bool ppc_cpu_is_big_endian(CPUState *cs)
|
||||
{
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
|
||||
cpu_synchronize_state(cs);
|
||||
|
||||
return !FIELD_EX64(env->msr, MSR, LE);
|
||||
return !FIELD_EX64(cpu_env(cs)->msr, MSR, LE);
|
||||
}
|
||||
|
||||
static bool ppc_get_irq_stats(InterruptStatsProvider *obj,
|
||||
|
@ -7288,8 +7285,7 @@ static bool ppc_pvr_match_default(PowerPCCPUClass *pcc, uint32_t pvr, bool best)
|
|||
|
||||
static void ppc_disas_set_info(CPUState *cs, disassemble_info *info)
|
||||
{
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
CPUPPCState *env = cpu_env(cs);
|
||||
|
||||
if ((env->hflags >> MSR_LE) & 1) {
|
||||
info->endian = BFD_ENDIAN_LITTLE;
|
||||
|
@ -7445,8 +7441,7 @@ void ppc_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
|||
#define RGPL 4
|
||||
#define RFPL 4
|
||||
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
CPUPPCState *env = cpu_env(cs);
|
||||
int i;
|
||||
|
||||
qemu_fprintf(f, "NIP " TARGET_FMT_lx " LR " TARGET_FMT_lx " CTR "
|
||||
|
|
|
@ -2597,8 +2597,7 @@ void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, target_ulong vector)
|
|||
|
||||
bool ppc_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
||||
{
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
CPUPPCState *env = cpu_env(cs);
|
||||
int interrupt;
|
||||
|
||||
if ((interrupt_request & CPU_INTERRUPT_HARD) == 0) {
|
||||
|
|
|
@ -108,8 +108,7 @@ void ppc_maybe_bswap_register(CPUPPCState *env, uint8_t *mem_buf, int len)
|
|||
|
||||
int ppc_cpu_gdb_read_register(CPUState *cs, GByteArray *buf, int n)
|
||||
{
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
CPUPPCState *env = cpu_env(cs);
|
||||
uint8_t *mem_buf;
|
||||
int r = ppc_gdb_register_len(n);
|
||||
|
||||
|
@ -152,8 +151,7 @@ int ppc_cpu_gdb_read_register(CPUState *cs, GByteArray *buf, int n)
|
|||
|
||||
int ppc_cpu_gdb_read_register_apple(CPUState *cs, GByteArray *buf, int n)
|
||||
{
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
CPUPPCState *env = cpu_env(cs);
|
||||
uint8_t *mem_buf;
|
||||
int r = ppc_gdb_register_len_apple(n);
|
||||
|
||||
|
@ -206,8 +204,7 @@ int ppc_cpu_gdb_read_register_apple(CPUState *cs, GByteArray *buf, int n)
|
|||
|
||||
int ppc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
{
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
CPUPPCState *env = cpu_env(cs);
|
||||
int r = ppc_gdb_register_len(n);
|
||||
|
||||
if (!r) {
|
||||
|
@ -253,8 +250,7 @@ int ppc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
|||
}
|
||||
int ppc_cpu_gdb_write_register_apple(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
{
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
CPUPPCState *env = cpu_env(cs);
|
||||
int r = ppc_gdb_register_len_apple(n);
|
||||
|
||||
if (!r) {
|
||||
|
|
|
@ -546,8 +546,7 @@ static void kvm_sw_tlb_put(PowerPCCPU *cpu)
|
|||
|
||||
static void kvm_get_one_spr(CPUState *cs, uint64_t id, int spr)
|
||||
{
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
CPUPPCState *env = cpu_env(cs);
|
||||
/* Init 'val' to avoid "uninitialised value" Valgrind warnings */
|
||||
union {
|
||||
uint32_t u32;
|
||||
|
@ -581,8 +580,7 @@ static void kvm_get_one_spr(CPUState *cs, uint64_t id, int spr)
|
|||
|
||||
static void kvm_put_one_spr(CPUState *cs, uint64_t id, int spr)
|
||||
{
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
CPUPPCState *env = cpu_env(cs);
|
||||
union {
|
||||
uint32_t u32;
|
||||
uint64_t u64;
|
||||
|
@ -615,8 +613,7 @@ static void kvm_put_one_spr(CPUState *cs, uint64_t id, int spr)
|
|||
|
||||
static int kvm_put_fp(CPUState *cs)
|
||||
{
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
CPUPPCState *env = cpu_env(cs);
|
||||
struct kvm_one_reg reg;
|
||||
int i;
|
||||
int ret;
|
||||
|
@ -635,8 +632,8 @@ static int kvm_put_fp(CPUState *cs)
|
|||
|
||||
for (i = 0; i < 32; i++) {
|
||||
uint64_t vsr[2];
|
||||
uint64_t *fpr = cpu_fpr_ptr(&cpu->env, i);
|
||||
uint64_t *vsrl = cpu_vsrl_ptr(&cpu->env, i);
|
||||
uint64_t *fpr = cpu_fpr_ptr(env, i);
|
||||
uint64_t *vsrl = cpu_vsrl_ptr(env, i);
|
||||
|
||||
#if HOST_BIG_ENDIAN
|
||||
vsr[0] = float64_val(*fpr);
|
||||
|
@ -682,8 +679,7 @@ static int kvm_put_fp(CPUState *cs)
|
|||
|
||||
static int kvm_get_fp(CPUState *cs)
|
||||
{
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
CPUPPCState *env = cpu_env(cs);
|
||||
struct kvm_one_reg reg;
|
||||
int i;
|
||||
int ret;
|
||||
|
@ -704,8 +700,8 @@ static int kvm_get_fp(CPUState *cs)
|
|||
|
||||
for (i = 0; i < 32; i++) {
|
||||
uint64_t vsr[2];
|
||||
uint64_t *fpr = cpu_fpr_ptr(&cpu->env, i);
|
||||
uint64_t *vsrl = cpu_vsrl_ptr(&cpu->env, i);
|
||||
uint64_t *fpr = cpu_fpr_ptr(env, i);
|
||||
uint64_t *vsrl = cpu_vsrl_ptr(env, i);
|
||||
|
||||
reg.addr = (uintptr_t) &vsr;
|
||||
reg.id = vsx ? KVM_REG_PPC_VSR(i) : KVM_REG_PPC_FPR(i);
|
||||
|
|
|
@ -137,8 +137,7 @@ static int ppc_cpu_get_reg_num(const char *numstr, int maxnum, int *pregnum)
|
|||
int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval)
|
||||
{
|
||||
int i, regnum;
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
CPUPPCState *env = cpu_env(cs);
|
||||
|
||||
/* General purpose registers */
|
||||
if ((qemu_tolower(name[0]) == 'r') &&
|
||||
|
|
|
@ -27,8 +27,7 @@ void ppc_cpu_record_sigsegv(CPUState *cs, vaddr address,
|
|||
MMUAccessType access_type,
|
||||
bool maperr, uintptr_t retaddr)
|
||||
{
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
CPUPPCState *env = cpu_env(cs);
|
||||
int exception, error_code;
|
||||
|
||||
/*
|
||||
|
|
|
@ -926,7 +926,7 @@ static void riscv_cpu_reset_hold(Object *obj)
|
|||
#endif
|
||||
CPUState *cs = CPU(obj);
|
||||
RISCVCPU *cpu = RISCV_CPU(cs);
|
||||
RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cpu);
|
||||
RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(obj);
|
||||
CPURISCVState *env = &cpu->env;
|
||||
|
||||
if (mcc->parent_phases.hold) {
|
||||
|
|
|
@ -71,9 +71,9 @@ static int riscv_cpu_mmu_index(CPUState *cs, bool ifunc)
|
|||
|
||||
static void rx_cpu_reset_hold(Object *obj)
|
||||
{
|
||||
RXCPU *cpu = RX_CPU(obj);
|
||||
RXCPUClass *rcc = RX_CPU_GET_CLASS(cpu);
|
||||
CPURXState *env = &cpu->env;
|
||||
CPUState *cs = CPU(obj);
|
||||
RXCPUClass *rcc = RX_CPU_GET_CLASS(obj);
|
||||
CPURXState *env = cpu_env(cs);
|
||||
uint32_t *resetvec;
|
||||
|
||||
if (rcc->parent_phases.hold) {
|
||||
|
|
|
@ -21,8 +21,7 @@
|
|||
|
||||
int rx_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||
{
|
||||
RXCPU *cpu = RX_CPU(cs);
|
||||
CPURXState *env = &cpu->env;
|
||||
CPURXState *env = cpu_env(cs);
|
||||
|
||||
switch (n) {
|
||||
case 0 ... 15:
|
||||
|
@ -53,8 +52,7 @@ int rx_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
|||
|
||||
int rx_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
{
|
||||
RXCPU *cpu = RX_CPU(cs);
|
||||
CPURXState *env = &cpu->env;
|
||||
CPURXState *env = cpu_env(cs);
|
||||
uint32_t psw;
|
||||
switch (n) {
|
||||
case 0 ... 15:
|
||||
|
|
|
@ -45,8 +45,7 @@ void rx_cpu_unpack_psw(CPURXState *env, uint32_t psw, int rte)
|
|||
#define INT_FLAGS (CPU_INTERRUPT_HARD | CPU_INTERRUPT_FIR)
|
||||
void rx_cpu_do_interrupt(CPUState *cs)
|
||||
{
|
||||
RXCPU *cpu = RX_CPU(cs);
|
||||
CPURXState *env = &cpu->env;
|
||||
CPURXState *env = cpu_env(cs);
|
||||
int do_irq = cs->interrupt_request & INT_FLAGS;
|
||||
uint32_t save_psw;
|
||||
|
||||
|
@ -122,8 +121,7 @@ void rx_cpu_do_interrupt(CPUState *cs)
|
|||
|
||||
bool rx_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
||||
{
|
||||
RXCPU *cpu = RX_CPU(cs);
|
||||
CPURXState *env = &cpu->env;
|
||||
CPURXState *env = cpu_env(cs);
|
||||
int accept = 0;
|
||||
/* hardware interrupt (Normal) */
|
||||
if ((interrupt_request & CPU_INTERRUPT_HARD) &&
|
||||
|
|
|
@ -131,8 +131,7 @@ static int bdsp_s(DisasContext *ctx, int d)
|
|||
|
||||
void rx_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
{
|
||||
RXCPU *cpu = RX_CPU(cs);
|
||||
CPURXState *env = &cpu->env;
|
||||
CPURXState *env = cpu_env(cs);
|
||||
int i;
|
||||
uint32_t psw;
|
||||
|
||||
|
@ -2195,9 +2194,8 @@ static bool trans_WAIT(DisasContext *ctx, arg_WAIT *a)
|
|||
|
||||
static void rx_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
|
||||
{
|
||||
CPURXState *env = cpu_env(cs);
|
||||
DisasContext *ctx = container_of(dcbase, DisasContext, base);
|
||||
ctx->env = env;
|
||||
ctx->env = cpu_env(cs);
|
||||
ctx->tb_flags = ctx->base.tb->flags;
|
||||
}
|
||||
|
||||
|
|
|
@ -503,6 +503,7 @@ static void error_prepend_missing_feat(const char *name, void *opaque)
|
|||
static void check_compatibility(const S390CPUModel *max_model,
|
||||
const S390CPUModel *model, Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
S390FeatBitmap missing;
|
||||
|
||||
if (model->def->gen > max_model->def->gen) {
|
||||
|
@ -566,6 +567,7 @@ S390CPUModel *get_max_cpu_model(Error **errp)
|
|||
|
||||
void s390_realize_cpu_model(CPUState *cs, Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
Error *err = NULL;
|
||||
S390CPUClass *xcc = S390_CPU_GET_CLASS(cs);
|
||||
S390CPU *cpu = S390_CPU(cs);
|
||||
|
|
|
@ -71,8 +71,7 @@ static void superh_restore_state_to_opc(CPUState *cs,
|
|||
static bool superh_io_recompile_replay_branch(CPUState *cs,
|
||||
const TranslationBlock *tb)
|
||||
{
|
||||
SuperHCPU *cpu = SUPERH_CPU(cs);
|
||||
CPUSH4State *env = &cpu->env;
|
||||
CPUSH4State *env = cpu_env(cs);
|
||||
|
||||
if ((env->flags & (TB_FLAG_DELAY_SLOT | TB_FLAG_DELAY_SLOT_COND))
|
||||
&& !(cs->tcg_cflags & CF_PCREL) && env->pc != tb->pc) {
|
||||
|
@ -106,10 +105,9 @@ static int sh4_cpu_mmu_index(CPUState *cs, bool ifetch)
|
|||
|
||||
static void superh_cpu_reset_hold(Object *obj)
|
||||
{
|
||||
CPUState *s = CPU(obj);
|
||||
SuperHCPU *cpu = SUPERH_CPU(s);
|
||||
SuperHCPUClass *scc = SUPERH_CPU_GET_CLASS(cpu);
|
||||
CPUSH4State *env = &cpu->env;
|
||||
CPUState *cs = CPU(obj);
|
||||
SuperHCPUClass *scc = SUPERH_CPU_GET_CLASS(obj);
|
||||
CPUSH4State *env = cpu_env(cs);
|
||||
|
||||
if (scc->parent_phases.hold) {
|
||||
scc->parent_phases.hold(obj);
|
||||
|
@ -159,8 +157,7 @@ out:
|
|||
|
||||
static void sh7750r_cpu_initfn(Object *obj)
|
||||
{
|
||||
SuperHCPU *cpu = SUPERH_CPU(obj);
|
||||
CPUSH4State *env = &cpu->env;
|
||||
CPUSH4State *env = cpu_env(CPU(obj));
|
||||
|
||||
env->id = SH_CPU_SH7750R;
|
||||
env->features = SH_FEATURE_BCR3_AND_BCR4;
|
||||
|
@ -177,8 +174,7 @@ static void sh7750r_class_init(ObjectClass *oc, void *data)
|
|||
|
||||
static void sh7751r_cpu_initfn(Object *obj)
|
||||
{
|
||||
SuperHCPU *cpu = SUPERH_CPU(obj);
|
||||
CPUSH4State *env = &cpu->env;
|
||||
CPUSH4State *env = cpu_env(CPU(obj));
|
||||
|
||||
env->id = SH_CPU_SH7751R;
|
||||
env->features = SH_FEATURE_BCR3_AND_BCR4;
|
||||
|
@ -195,8 +191,7 @@ static void sh7751r_class_init(ObjectClass *oc, void *data)
|
|||
|
||||
static void sh7785_cpu_initfn(Object *obj)
|
||||
{
|
||||
SuperHCPU *cpu = SUPERH_CPU(obj);
|
||||
CPUSH4State *env = &cpu->env;
|
||||
CPUSH4State *env = cpu_env(CPU(obj));
|
||||
|
||||
env->id = SH_CPU_SH7785;
|
||||
env->features = SH_FEATURE_SH4A;
|
||||
|
@ -231,8 +226,7 @@ static void superh_cpu_realizefn(DeviceState *dev, Error **errp)
|
|||
|
||||
static void superh_cpu_initfn(Object *obj)
|
||||
{
|
||||
SuperHCPU *cpu = SUPERH_CPU(obj);
|
||||
CPUSH4State *env = &cpu->env;
|
||||
CPUSH4State *env = cpu_env(CPU(obj));
|
||||
|
||||
env->movcal_backup_tail = &(env->movcal_backup);
|
||||
}
|
||||
|
|
|
@ -26,8 +26,7 @@
|
|||
|
||||
int superh_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||
{
|
||||
SuperHCPU *cpu = SUPERH_CPU(cs);
|
||||
CPUSH4State *env = &cpu->env;
|
||||
CPUSH4State *env = cpu_env(cs);
|
||||
|
||||
switch (n) {
|
||||
case 0 ... 7:
|
||||
|
@ -76,8 +75,7 @@ int superh_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
|||
|
||||
int superh_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
{
|
||||
SuperHCPU *cpu = SUPERH_CPU(cs);
|
||||
CPUSH4State *env = &cpu->env;
|
||||
CPUSH4State *env = cpu_env(cs);
|
||||
|
||||
switch (n) {
|
||||
case 0 ... 7:
|
||||
|
|
|
@ -55,8 +55,7 @@ int cpu_sh4_is_cached(CPUSH4State *env, target_ulong addr)
|
|||
|
||||
void superh_cpu_do_interrupt(CPUState *cs)
|
||||
{
|
||||
SuperHCPU *cpu = SUPERH_CPU(cs);
|
||||
CPUSH4State *env = &cpu->env;
|
||||
CPUSH4State *env = cpu_env(cs);
|
||||
int do_irq = cs->interrupt_request & CPU_INTERRUPT_HARD;
|
||||
int do_exp, irq_vector = cs->exception_index;
|
||||
|
||||
|
@ -432,11 +431,10 @@ static int get_physical_address(CPUSH4State * env, target_ulong * physical,
|
|||
|
||||
hwaddr superh_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
|
||||
{
|
||||
SuperHCPU *cpu = SUPERH_CPU(cs);
|
||||
target_ulong physical;
|
||||
int prot;
|
||||
|
||||
if (get_physical_address(&cpu->env, &physical, &prot, addr, MMU_DATA_LOAD)
|
||||
if (get_physical_address(cpu_env(cs), &physical, &prot, addr, MMU_DATA_LOAD)
|
||||
== MMU_OK) {
|
||||
return physical;
|
||||
}
|
||||
|
@ -782,11 +780,8 @@ int cpu_sh4_is_cached(CPUSH4State * env, target_ulong addr)
|
|||
bool superh_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
||||
{
|
||||
if (interrupt_request & CPU_INTERRUPT_HARD) {
|
||||
SuperHCPU *cpu = SUPERH_CPU(cs);
|
||||
CPUSH4State *env = &cpu->env;
|
||||
|
||||
/* Delay slots are indivisible, ignore interrupts */
|
||||
if (env->flags & TB_FLAG_DELAY_SLOT_MASK) {
|
||||
if (cpu_env(cs)->flags & TB_FLAG_DELAY_SLOT_MASK) {
|
||||
return false;
|
||||
} else {
|
||||
superh_cpu_do_interrupt(cs);
|
||||
|
@ -800,8 +795,7 @@ bool superh_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
|
|||
MMUAccessType access_type, int mmu_idx,
|
||||
bool probe, uintptr_t retaddr)
|
||||
{
|
||||
SuperHCPU *cpu = SUPERH_CPU(cs);
|
||||
CPUSH4State *env = &cpu->env;
|
||||
CPUSH4State *env = cpu_env(cs);
|
||||
int ret;
|
||||
|
||||
target_ulong physical;
|
||||
|
|
|
@ -29,9 +29,7 @@ void superh_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
|
|||
MMUAccessType access_type,
|
||||
int mmu_idx, uintptr_t retaddr)
|
||||
{
|
||||
CPUSH4State *env = cpu_env(cs);
|
||||
|
||||
env->tea = addr;
|
||||
cpu_env(cs)->tea = addr;
|
||||
switch (access_type) {
|
||||
case MMU_INST_FETCH:
|
||||
case MMU_DATA_LOAD:
|
||||
|
|
|
@ -159,8 +159,7 @@ void sh4_translate_init(void)
|
|||
|
||||
void superh_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
{
|
||||
SuperHCPU *cpu = SUPERH_CPU(cs);
|
||||
CPUSH4State *env = &cpu->env;
|
||||
CPUSH4State *env = cpu_env(cs);
|
||||
int i;
|
||||
|
||||
qemu_fprintf(f, "pc=0x%08x sr=0x%08x pr=0x%08x fpscr=0x%08x\n",
|
||||
|
@ -2186,7 +2185,6 @@ static void decode_gusa(DisasContext *ctx, CPUSH4State *env)
|
|||
static void sh4_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
|
||||
{
|
||||
DisasContext *ctx = container_of(dcbase, DisasContext, base);
|
||||
CPUSH4State *env = cpu_env(cs);
|
||||
uint32_t tbflags;
|
||||
int bound;
|
||||
|
||||
|
@ -2196,7 +2194,7 @@ static void sh4_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
|
|||
/* We don't know if the delayed pc came from a dynamic or static branch,
|
||||
so assume it is a dynamic branch. */
|
||||
ctx->delayed_pc = -1; /* use delayed pc from env pointer */
|
||||
ctx->features = env->features;
|
||||
ctx->features = cpu_env(cs)->features;
|
||||
ctx->has_movcal = (tbflags & TB_FLAG_PENDING_MOVCA);
|
||||
ctx->gbank = ((tbflags & (1 << SR_MD)) &&
|
||||
(tbflags & (1 << SR_RB))) * 0x10;
|
||||
|
|
|
@ -31,10 +31,9 @@
|
|||
|
||||
static void sparc_cpu_reset_hold(Object *obj)
|
||||
{
|
||||
CPUState *s = CPU(obj);
|
||||
SPARCCPU *cpu = SPARC_CPU(s);
|
||||
SPARCCPUClass *scc = SPARC_CPU_GET_CLASS(cpu);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUState *cs = CPU(obj);
|
||||
SPARCCPUClass *scc = SPARC_CPU_GET_CLASS(obj);
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
|
||||
if (scc->parent_phases.hold) {
|
||||
scc->parent_phases.hold(obj);
|
||||
|
@ -83,8 +82,7 @@ static void sparc_cpu_reset_hold(Object *obj)
|
|||
static bool sparc_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
||||
{
|
||||
if (interrupt_request & CPU_INTERRUPT_HARD) {
|
||||
SPARCCPU *cpu = SPARC_CPU(cs);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
|
||||
if (cpu_interrupts_enabled(env) && env->interrupt_index > 0) {
|
||||
int pil = env->interrupt_index & 0xf;
|
||||
|
@ -613,8 +611,7 @@ static void cpu_print_cc(FILE *f, uint32_t cc)
|
|||
|
||||
static void sparc_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
{
|
||||
SPARCCPU *cpu = SPARC_CPU(cs);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
int i, x;
|
||||
|
||||
qemu_fprintf(f, "pc: " TARGET_FMT_lx " npc: " TARGET_FMT_lx "\n", env->pc,
|
||||
|
@ -711,11 +708,8 @@ static void sparc_cpu_synchronize_from_tb(CPUState *cs,
|
|||
|
||||
static bool sparc_cpu_has_work(CPUState *cs)
|
||||
{
|
||||
SPARCCPU *cpu = SPARC_CPU(cs);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
|
||||
return (cs->interrupt_request & CPU_INTERRUPT_HARD) &&
|
||||
cpu_interrupts_enabled(env);
|
||||
cpu_interrupts_enabled(cpu_env(cs));
|
||||
}
|
||||
|
||||
static int sparc_cpu_mmu_index(CPUState *cs, bool ifetch)
|
||||
|
@ -777,8 +771,7 @@ static void sparc_cpu_realizefn(DeviceState *dev, Error **errp)
|
|||
CPUState *cs = CPU(dev);
|
||||
SPARCCPUClass *scc = SPARC_CPU_GET_CLASS(dev);
|
||||
Error *local_err = NULL;
|
||||
SPARCCPU *cpu = SPARC_CPU(dev);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
|
||||
#if defined(CONFIG_USER_ONLY)
|
||||
/* We are emulating the kernel, which will trap and emulate float128. */
|
||||
|
|
|
@ -29,8 +29,7 @@
|
|||
|
||||
int sparc_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||
{
|
||||
SPARCCPU *cpu = SPARC_CPU(cs);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
|
||||
if (n < 8) {
|
||||
/* g0..g7 */
|
||||
|
|
|
@ -99,8 +99,7 @@ void cpu_check_irqs(CPUSPARCState *env)
|
|||
|
||||
void sparc_cpu_do_interrupt(CPUState *cs)
|
||||
{
|
||||
SPARCCPU *cpu = SPARC_CPU(cs);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
int cwp, intno = cs->exception_index;
|
||||
|
||||
if (qemu_loglevel_mask(CPU_LOG_INT)) {
|
||||
|
|
|
@ -130,8 +130,7 @@ void cpu_check_irqs(CPUSPARCState *env)
|
|||
|
||||
void sparc_cpu_do_interrupt(CPUState *cs)
|
||||
{
|
||||
SPARCCPU *cpu = SPARC_CPU(cs);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
int intno = cs->exception_index;
|
||||
trap_state *tsptr;
|
||||
|
||||
|
|
|
@ -418,8 +418,7 @@ static void sparc_raise_mmu_fault(CPUState *cs, hwaddr addr,
|
|||
bool is_write, bool is_exec, int is_asi,
|
||||
unsigned size, uintptr_t retaddr)
|
||||
{
|
||||
SPARCCPU *cpu = SPARC_CPU(cs);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
int fault_type;
|
||||
|
||||
#ifdef DEBUG_UNASSIGNED
|
||||
|
@ -480,8 +479,7 @@ static void sparc_raise_mmu_fault(CPUState *cs, hwaddr addr,
|
|||
bool is_write, bool is_exec, int is_asi,
|
||||
unsigned size, uintptr_t retaddr)
|
||||
{
|
||||
SPARCCPU *cpu = SPARC_CPU(cs);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
|
||||
#ifdef DEBUG_UNASSIGNED
|
||||
printf("Unassigned mem access to " HWADDR_FMT_plx " from " TARGET_FMT_lx
|
||||
|
|
|
@ -206,8 +206,7 @@ bool sparc_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
|
|||
MMUAccessType access_type, int mmu_idx,
|
||||
bool probe, uintptr_t retaddr)
|
||||
{
|
||||
SPARCCPU *cpu = SPARC_CPU(cs);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
CPUTLBEntryFull full = {};
|
||||
target_ulong vaddr;
|
||||
int error_code = 0, access_index;
|
||||
|
@ -391,8 +390,7 @@ void dump_mmu(CPUSPARCState *env)
|
|||
int sparc_cpu_memory_rw_debug(CPUState *cs, vaddr address,
|
||||
uint8_t *buf, int len, bool is_write)
|
||||
{
|
||||
SPARCCPU *cpu = SPARC_CPU(cs);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
target_ulong addr = address;
|
||||
int i;
|
||||
int len1;
|
||||
|
@ -759,8 +757,7 @@ bool sparc_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
|
|||
MMUAccessType access_type, int mmu_idx,
|
||||
bool probe, uintptr_t retaddr)
|
||||
{
|
||||
SPARCCPU *cpu = SPARC_CPU(cs);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
CPUTLBEntryFull full = {};
|
||||
int error_code = 0, access_index;
|
||||
|
||||
|
@ -898,8 +895,7 @@ hwaddr cpu_get_phys_page_nofault(CPUSPARCState *env, target_ulong addr,
|
|||
|
||||
hwaddr sparc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
|
||||
{
|
||||
SPARCCPU *cpu = SPARC_CPU(cs);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
hwaddr phys_addr;
|
||||
int mmu_idx = cpu_mmu_index(cs, false);
|
||||
|
||||
|
@ -916,8 +912,7 @@ G_NORETURN void sparc_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
|
|||
int mmu_idx,
|
||||
uintptr_t retaddr)
|
||||
{
|
||||
SPARCCPU *cpu = SPARC_CPU(cs);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
|
||||
#ifdef TARGET_SPARC64
|
||||
env->dmmu.sfsr = build_sfsr(env, mmu_idx, access_type);
|
||||
|
|
|
@ -4844,13 +4844,12 @@ TRANS(FCMPEq, ALL, do_fcmpq, a, true)
|
|||
static void sparc_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
|
||||
{
|
||||
DisasContext *dc = container_of(dcbase, DisasContext, base);
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
int bound;
|
||||
|
||||
dc->pc = dc->base.pc_first;
|
||||
dc->npc = (target_ulong)dc->base.tb->cs_base;
|
||||
dc->mem_idx = dc->base.tb->flags & TB_FLAG_MMU_MASK;
|
||||
dc->def = &env->def;
|
||||
dc->def = &cpu_env(cs)->def;
|
||||
dc->fpu_enabled = tb_fpu_enabled(dc->base.tb->flags);
|
||||
dc->address_mask_32bit = tb_am_enabled(dc->base.tb->flags);
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
|
@ -4900,10 +4899,9 @@ static void sparc_tr_insn_start(DisasContextBase *dcbase, CPUState *cs)
|
|||
static void sparc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
|
||||
{
|
||||
DisasContext *dc = container_of(dcbase, DisasContext, base);
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
unsigned int insn;
|
||||
|
||||
insn = translator_ldl(env, &dc->base, dc->pc);
|
||||
insn = translator_ldl(cpu_env(cs), &dc->base, dc->pc);
|
||||
dc->base.pc_next += 4;
|
||||
|
||||
if (!decode(dc, insn)) {
|
||||
|
@ -5106,8 +5104,7 @@ void sparc_restore_state_to_opc(CPUState *cs,
|
|||
const TranslationBlock *tb,
|
||||
const uint64_t *data)
|
||||
{
|
||||
SPARCCPU *cpu = SPARC_CPU(cs);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUSPARCState *env = cpu_env(cs);
|
||||
target_ulong pc = data[0];
|
||||
target_ulong npc = data[1];
|
||||
|
||||
|
|
|
@ -36,52 +36,38 @@ static const gchar *tricore_gdb_arch_name(CPUState *cs)
|
|||
|
||||
static void tricore_cpu_set_pc(CPUState *cs, vaddr value)
|
||||
{
|
||||
TriCoreCPU *cpu = TRICORE_CPU(cs);
|
||||
CPUTriCoreState *env = &cpu->env;
|
||||
|
||||
env->PC = value & ~(target_ulong)1;
|
||||
cpu_env(cs)->PC = value & ~(target_ulong)1;
|
||||
}
|
||||
|
||||
static vaddr tricore_cpu_get_pc(CPUState *cs)
|
||||
{
|
||||
TriCoreCPU *cpu = TRICORE_CPU(cs);
|
||||
CPUTriCoreState *env = &cpu->env;
|
||||
|
||||
return env->PC;
|
||||
return cpu_env(cs)->PC;
|
||||
}
|
||||
|
||||
static void tricore_cpu_synchronize_from_tb(CPUState *cs,
|
||||
const TranslationBlock *tb)
|
||||
{
|
||||
TriCoreCPU *cpu = TRICORE_CPU(cs);
|
||||
CPUTriCoreState *env = &cpu->env;
|
||||
|
||||
tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL));
|
||||
env->PC = tb->pc;
|
||||
cpu_env(cs)->PC = tb->pc;
|
||||
}
|
||||
|
||||
static void tricore_restore_state_to_opc(CPUState *cs,
|
||||
const TranslationBlock *tb,
|
||||
const uint64_t *data)
|
||||
{
|
||||
TriCoreCPU *cpu = TRICORE_CPU(cs);
|
||||
CPUTriCoreState *env = &cpu->env;
|
||||
|
||||
env->PC = data[0];
|
||||
cpu_env(cs)->PC = data[0];
|
||||
}
|
||||
|
||||
static void tricore_cpu_reset_hold(Object *obj)
|
||||
{
|
||||
CPUState *s = CPU(obj);
|
||||
TriCoreCPU *cpu = TRICORE_CPU(s);
|
||||
TriCoreCPUClass *tcc = TRICORE_CPU_GET_CLASS(cpu);
|
||||
CPUTriCoreState *env = &cpu->env;
|
||||
CPUState *cs = CPU(obj);
|
||||
TriCoreCPUClass *tcc = TRICORE_CPU_GET_CLASS(obj);
|
||||
|
||||
if (tcc->parent_phases.hold) {
|
||||
tcc->parent_phases.hold(obj);
|
||||
}
|
||||
|
||||
cpu_state_reset(env);
|
||||
cpu_state_reset(cpu_env(cs));
|
||||
}
|
||||
|
||||
static bool tricore_cpu_has_work(CPUState *cs)
|
||||
|
|
|
@ -106,8 +106,7 @@ static void tricore_cpu_gdb_write_csfr(CPUTriCoreState *env, int n,
|
|||
|
||||
int tricore_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||
{
|
||||
TriCoreCPU *cpu = TRICORE_CPU(cs);
|
||||
CPUTriCoreState *env = &cpu->env;
|
||||
CPUTriCoreState *env = cpu_env(cs);
|
||||
|
||||
if (n < 16) { /* data registers */
|
||||
return gdb_get_reg32(mem_buf, env->gpr_d[n]);
|
||||
|
@ -121,8 +120,7 @@ int tricore_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
|||
|
||||
int tricore_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
{
|
||||
TriCoreCPU *cpu = TRICORE_CPU(cs);
|
||||
CPUTriCoreState *env = &cpu->env;
|
||||
CPUTriCoreState *env = cpu_env(cs);
|
||||
uint32_t tmp;
|
||||
|
||||
tmp = ldl_p(mem_buf);
|
||||
|
|
|
@ -67,8 +67,7 @@ bool tricore_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
|
|||
MMUAccessType rw, int mmu_idx,
|
||||
bool probe, uintptr_t retaddr)
|
||||
{
|
||||
TriCoreCPU *cpu = TRICORE_CPU(cs);
|
||||
CPUTriCoreState *env = &cpu->env;
|
||||
CPUTriCoreState *env = cpu_env(cs);
|
||||
hwaddr physical;
|
||||
int prot;
|
||||
int ret = 0;
|
||||
|
|
|
@ -95,8 +95,7 @@ enum {
|
|||
|
||||
void tricore_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
{
|
||||
TriCoreCPU *cpu = TRICORE_CPU(cs);
|
||||
CPUTriCoreState *env = &cpu->env;
|
||||
CPUTriCoreState *env = cpu_env(cs);
|
||||
uint32_t psw;
|
||||
int i;
|
||||
|
||||
|
|
|
@ -95,10 +95,9 @@ bool xtensa_abi_call0(void)
|
|||
|
||||
static void xtensa_cpu_reset_hold(Object *obj)
|
||||
{
|
||||
CPUState *s = CPU(obj);
|
||||
XtensaCPU *cpu = XTENSA_CPU(s);
|
||||
XtensaCPUClass *xcc = XTENSA_CPU_GET_CLASS(cpu);
|
||||
CPUXtensaState *env = &cpu->env;
|
||||
CPUState *cs = CPU(obj);
|
||||
XtensaCPUClass *xcc = XTENSA_CPU_GET_CLASS(obj);
|
||||
CPUXtensaState *env = cpu_env(cs);
|
||||
bool dfpu = xtensa_option_enabled(env->config,
|
||||
XTENSA_OPTION_DFP_COPROCESSOR);
|
||||
|
||||
|
@ -132,7 +131,7 @@ static void xtensa_cpu_reset_hold(Object *obj)
|
|||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
reset_mmu(env);
|
||||
s->halted = env->runstall;
|
||||
cs->halted = env->runstall;
|
||||
#endif
|
||||
set_no_signaling_nans(!dfpu, &env->fp_status);
|
||||
set_use_first_nan(!dfpu, &env->fp_status);
|
||||
|
|
|
@ -66,8 +66,7 @@ void HELPER(wsr_ibreaka)(CPUXtensaState *env, uint32_t i, uint32_t v)
|
|||
|
||||
bool xtensa_debug_check_breakpoint(CPUState *cs)
|
||||
{
|
||||
XtensaCPU *cpu = XTENSA_CPU(cs);
|
||||
CPUXtensaState *env = &cpu->env;
|
||||
CPUXtensaState *env = cpu_env(cs);
|
||||
unsigned int i;
|
||||
|
||||
if (xtensa_get_cintlevel(env) >= env->config->debug_level) {
|
||||
|
|
|
@ -205,8 +205,7 @@ static void handle_interrupt(CPUXtensaState *env)
|
|||
/* Called from cpu_handle_interrupt with BQL held */
|
||||
void xtensa_cpu_do_interrupt(CPUState *cs)
|
||||
{
|
||||
XtensaCPU *cpu = XTENSA_CPU(cs);
|
||||
CPUXtensaState *env = &cpu->env;
|
||||
CPUXtensaState *env = cpu_env(cs);
|
||||
|
||||
if (cs->exception_index == EXC_IRQ) {
|
||||
qemu_log_mask(CPU_LOG_INT,
|
||||
|
|
|
@ -65,8 +65,7 @@ void xtensa_count_regs(const XtensaConfig *config,
|
|||
|
||||
int xtensa_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||
{
|
||||
XtensaCPU *cpu = XTENSA_CPU(cs);
|
||||
CPUXtensaState *env = &cpu->env;
|
||||
CPUXtensaState *env = cpu_env(cs);
|
||||
const XtensaGdbReg *reg = env->config->gdb_regmap.reg + n;
|
||||
#ifdef CONFIG_USER_ONLY
|
||||
int num_regs = env->config->gdb_regmap.num_core_regs;
|
||||
|
@ -120,8 +119,7 @@ int xtensa_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
|||
|
||||
int xtensa_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
{
|
||||
XtensaCPU *cpu = XTENSA_CPU(cs);
|
||||
CPUXtensaState *env = &cpu->env;
|
||||
CPUXtensaState *env = cpu_env(cs);
|
||||
uint32_t tmp;
|
||||
const XtensaGdbReg *reg = env->config->gdb_regmap.reg + n;
|
||||
#ifdef CONFIG_USER_ONLY
|
||||
|
|
|
@ -217,8 +217,7 @@ static uint32_t check_hw_breakpoints(CPUXtensaState *env)
|
|||
|
||||
void xtensa_breakpoint_handler(CPUState *cs)
|
||||
{
|
||||
XtensaCPU *cpu = XTENSA_CPU(cs);
|
||||
CPUXtensaState *env = &cpu->env;
|
||||
CPUXtensaState *env = cpu_env(cs);
|
||||
|
||||
if (cs->watchpoint_hit) {
|
||||
if (cs->watchpoint_hit->flags & BP_CPU) {
|
||||
|
@ -266,8 +265,7 @@ bool xtensa_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
|
|||
MMUAccessType access_type, int mmu_idx,
|
||||
bool probe, uintptr_t retaddr)
|
||||
{
|
||||
XtensaCPU *cpu = XTENSA_CPU(cs);
|
||||
CPUXtensaState *env = &cpu->env;
|
||||
CPUXtensaState *env = cpu_env(cs);
|
||||
uint32_t paddr;
|
||||
uint32_t page_size;
|
||||
unsigned access;
|
||||
|
@ -297,8 +295,7 @@ void xtensa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr,
|
|||
int mmu_idx, MemTxAttrs attrs,
|
||||
MemTxResult response, uintptr_t retaddr)
|
||||
{
|
||||
XtensaCPU *cpu = XTENSA_CPU(cs);
|
||||
CPUXtensaState *env = &cpu->env;
|
||||
CPUXtensaState *env = cpu_env(cs);
|
||||
|
||||
cpu_restore_state(cs, retaddr);
|
||||
HELPER(exception_cause_vaddr)(env, env->pc,
|
||||
|
|
|
@ -1127,10 +1127,9 @@ static void xtensa_tr_init_disas_context(DisasContextBase *dcbase,
|
|||
CPUState *cpu)
|
||||
{
|
||||
DisasContext *dc = container_of(dcbase, DisasContext, base);
|
||||
CPUXtensaState *env = cpu_env(cpu);
|
||||
uint32_t tb_flags = dc->base.tb->flags;
|
||||
|
||||
dc->config = env->config;
|
||||
dc->config = cpu_env(cpu)->config;
|
||||
dc->pc = dc->base.pc_first;
|
||||
dc->ring = tb_flags & XTENSA_TBFLAG_RING_MASK;
|
||||
dc->cring = (tb_flags & XTENSA_TBFLAG_EXCM) ? 0 : dc->ring;
|
||||
|
@ -1248,8 +1247,7 @@ void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_insns,
|
|||
|
||||
void xtensa_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
{
|
||||
XtensaCPU *cpu = XTENSA_CPU(cs);
|
||||
CPUXtensaState *env = &cpu->env;
|
||||
CPUXtensaState *env = cpu_env(cs);
|
||||
xtensa_isa isa = env->config->isa;
|
||||
int i, j;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue