Просмотр исходного кода

dyncom: Remove unnecessary initialization code.

Targeting ARM version variants was only a thing on armemu.

The reset routine also does basically the same thing as NewState.
Lioncash 11 лет назад
Родитель
Сommit
03213f893e

+ 0 - 7
src/core/arm/dyncom/arm_dyncom.cpp

@@ -20,15 +20,8 @@
 ARM_DynCom::ARM_DynCom(PrivilegeMode initial_mode) {
 ARM_DynCom::ARM_DynCom(PrivilegeMode initial_mode) {
     state = Common::make_unique<ARMul_State>();
     state = Common::make_unique<ARMul_State>();
 
 
-    ARMul_NewState(state.get());
-    ARMul_SelectProcessor(state.get(), ARM_v6_Prop | ARM_v5_Prop | ARM_v5e_Prop);
-
-    state->bigendSig = LOW;
-    state->NirqSig = HIGH;
-
     // Reset the core to initial state
     // Reset the core to initial state
     ARMul_Reset(state.get());
     ARMul_Reset(state.get());
-    state->Emulate = RUN;
 
 
     // Switch to the desired privilege mode.
     // Switch to the desired privilege mode.
     switch_mode(state.get(), initial_mode);
     switch_mode(state.get(), initial_mode);

+ 2 - 30
src/core/arm/skyeye_common/arminit.cpp

@@ -19,33 +19,6 @@
 #include "core/arm/skyeye_common/armstate.h"
 #include "core/arm/skyeye_common/armstate.h"
 #include "core/arm/skyeye_common/vfp/vfp.h"
 #include "core/arm/skyeye_common/vfp/vfp.h"
 
 
-/***************************************************************************\
-*            Returns a new instantiation of the ARMulator's state           *
-\***************************************************************************/
-ARMul_State* ARMul_NewState(ARMul_State* state)
-{
-    state->Emulate = RUN;
-    state->Mode = USER32MODE;
-
-    state->lateabtSig = HIGH;
-    state->bigendSig = LOW;
-
-    return state;
-}
-
-/***************************************************************************\
-*       Call this routine to set ARMulator to model a certain processor     *
-\***************************************************************************/
-
-void ARMul_SelectProcessor(ARMul_State* state, unsigned properties)
-{
-    state->is_v4  = (properties & (ARM_v4_Prop | ARM_v5_Prop)) != 0;
-    state->is_v5  = (properties & ARM_v5_Prop) != 0;
-    state->is_v5e = (properties & ARM_v5e_Prop) != 0;
-    state->is_v6  = (properties & ARM_v6_Prop) != 0;
-    state->is_v7  = (properties & ARM_v7_Prop) != 0;
-}
-
 // Resets certain MPCore CP15 values to their ARM-defined reset values.
 // Resets certain MPCore CP15 values to their ARM-defined reset values.
 static void ResetMPCoreCP15Registers(ARMul_State* cpu)
 static void ResetMPCoreCP15Registers(ARMul_State* cpu)
 {
 {
@@ -104,9 +77,7 @@ static void ResetMPCoreCP15Registers(ARMul_State* cpu)
     cpu->CP15[CP15_TLB_DEBUG_CONTROL] = 0x00000000;
     cpu->CP15[CP15_TLB_DEBUG_CONTROL] = 0x00000000;
 }
 }
 
 
-/***************************************************************************\
-* Call this routine to set up the initial machine state (or perform a RESET *
-\***************************************************************************/
+// Performs a reset
 void ARMul_Reset(ARMul_State* state)
 void ARMul_Reset(ARMul_State* state)
 {
 {
     VFPInit(state);
     VFPInit(state);
@@ -125,4 +96,5 @@ void ARMul_Reset(ARMul_State* state)
     state->abortSig = LOW;
     state->abortSig = LOW;
 
 
     state->NumInstrs = 0;
     state->NumInstrs = 0;
+    state->Emulate = RUN;
 }
 }

+ 0 - 20
src/core/arm/skyeye_common/armstate.h

@@ -89,30 +89,11 @@ struct ARMul_State
     unsigned bigendSig;
     unsigned bigendSig;
     unsigned syscallSig;
     unsigned syscallSig;
 
 
-    // For differentiating ARM core emulation.
-    bool is_v4;     // Are we emulating a v4 architecture (or higher)?
-    bool is_v5;     // Are we emulating a v5 architecture?
-    bool is_v5e;    // Are we emulating a v5e architecture?
-    bool is_v6;     // Are we emulating a v6 architecture?
-    bool is_v7;     // Are we emulating a v7 architecture?
-
     // TODO(bunnei): Move this cache to a better place - it should be per codeset (likely per
     // TODO(bunnei): Move this cache to a better place - it should be per codeset (likely per
     // process for our purposes), not per ARMul_State (which tracks CPU core state).
     // process for our purposes), not per ARMul_State (which tracks CPU core state).
     std::unordered_map<u32, int> instruction_cache;
     std::unordered_map<u32, int> instruction_cache;
 };
 };
 
 
-/***************************************************************************\
-*                        Types of ARM we know about                         *
-\***************************************************************************/
-
-enum {
-    ARM_v4_Prop  = 0x01,
-    ARM_v5_Prop  = 0x02,
-    ARM_v5e_Prop = 0x04,
-    ARM_v6_Prop  = 0x08,
-    ARM_v7_Prop  = 0x10,
-};
-
 /***************************************************************************\
 /***************************************************************************\
 *                      The hardware vector addresses                        *
 *                      The hardware vector addresses                        *
 \***************************************************************************/
 \***************************************************************************/
@@ -167,7 +148,6 @@ enum {
 *                  Definitions of things in the emulator                     *
 *                  Definitions of things in the emulator                     *
 \***************************************************************************/
 \***************************************************************************/
 void ARMul_Reset(ARMul_State* state);
 void ARMul_Reset(ARMul_State* state);
-ARMul_State* ARMul_NewState(ARMul_State* state);
 
 
 /***************************************************************************\
 /***************************************************************************\
 *            Definitions of things in the co-processor interface             *
 *            Definitions of things in the co-processor interface             *

+ 0 - 2
src/core/arm/skyeye_common/armsupp.h

@@ -17,8 +17,6 @@ struct ARMul_State;
 bool AddOverflow(u32, u32, u32);
 bool AddOverflow(u32, u32, u32);
 bool SubOverflow(u32, u32, u32);
 bool SubOverflow(u32, u32, u32);
 
 
-void ARMul_SelectProcessor(ARMul_State*, unsigned);
-
 u32 AddWithCarry(u32, u32, u32, bool*, bool*);
 u32 AddWithCarry(u32, u32, u32, bool*, bool*);
 bool ARMul_AddOverflowQ(u32, u32);
 bool ARMul_AddOverflowQ(u32, u32);