From 05089ecb12f317c8112b5ded97feb52399b600fb Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 12 Mar 2018 15:11:48 -0400 Subject: [PATCH] target/mips/helper: Perform comparison pass with qemu Keeps code and formatting in sync with qemu --- qemu/target/mips/helper.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/qemu/target/mips/helper.c b/qemu/target/mips/helper.c index 7b957958..a4961c4b 100644 --- a/qemu/target/mips/helper.c +++ b/qemu/target/mips/helper.c @@ -204,8 +204,8 @@ static int get_physical_address (CPUMIPSState *env, hwaddr *physical, int *prot, target_ulong real_address, int rw, int access_type, int mmu_idx) { -#if defined(TARGET_MIPS64) /* User mode can only access useg/xuseg */ +#if defined(TARGET_MIPS64) int user_mode = mmu_idx == MIPS_HFLAG_UM; int supervisor_mode = mmu_idx == MIPS_HFLAG_SM; int kernel_mode = !user_mode && !supervisor_mode; @@ -317,7 +317,6 @@ static int get_physical_address (CPUMIPSState *env, hwaddr *physical, access_type, mmu_idx, env->CP0_SegCtl0, 0x1FFFFFFF); } - return ret; } @@ -783,6 +782,7 @@ void mips_cpu_do_interrupt(CPUState *cs) set_hflags_for_handler(env); break; case EXCP_EXT_INTERRUPT: + cause = 0; if (env->CP0_Cause & (1 << CP0Ca_IV)) { uint32_t spacing = (env->CP0_IntCtl >> CP0IntCtl_VS) & 0x1f; @@ -803,7 +803,6 @@ void mips_cpu_do_interrupt(CPUState *cs) /* Find the highest-priority interrupt. */ while (pending >>= 1) { vector++; - } } offset = 0x200 + (vector * (spacing << 5)); @@ -923,7 +922,7 @@ void mips_cpu_do_interrupt(CPUState *cs) goto set_EPC; case EXCP_DWATCH: cause = 23; - /* XXX: TODO: manage defered watch exceptions */ + /* XXX: TODO: manage deferred watch exceptions */ goto set_EPC; case EXCP_MCHECK: cause = 24; @@ -989,7 +988,7 @@ void mips_cpu_do_interrupt(CPUState *cs) cs->exception_index = EXCP_NONE; } -bool mips_cpu_exec_interrupt(CPUState *cs, int interrupt_request) // qq +bool mips_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { if (interrupt_request & CPU_INTERRUPT_HARD) { MIPSCPU *cpu = MIPS_CPU(cs->uc, cs); @@ -1067,7 +1066,6 @@ void r4k_invalidate_tlb (CPUMIPSState *env, int idx, int use_extra) } #endif - void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env, uint32_t exception, int error_code,