ARM_Interpreter::ARM_Interpreter() { state = new ARMul_State; state->m_MemoryMap = NULL; ARMul_EmulateInit(); memset(state, 0, sizeof(ARMul_State)); ARMul_NewState(state); state->abort_model = 0; state->cpu = (cpu_config_t*)&arm11_cpu_info; state->bigendSig = LOW; ARMul_SelectProcessor(state, ARM_v6_Prop | ARM_v5_Prop | ARM_v5e_Prop); state->lateabtSig = LOW; // Reset the core to initial state ARMul_CoProInit(state); ARMul_Reset(state); state->NextInstr = RESUME; // NOTE: This will be overwritten by LoadContext state->Emulate = 3; state->pc = state->Reg[15] = 0x00000000; state->Reg[13] = 0x10000000; // Set stack pointer to the top of the stack state->servaddr = 0xFFFF0000; }
static void init () { static int done; if (!done) { ARMul_EmulateInit(); state = ARMul_NewState (); state->bigendSig = (big_endian ? HIGH : LOW); ARMul_MemoryInit(state, mem_size); ARMul_OSInit(state); ARMul_CoProInit(state); state->verbose = verbosity; done = 1; } }
void ARMul_SelectProcessor (ARMul_State * state, unsigned properties) { if (properties & ARM_Fix26_Prop) { state->prog32Sig = LOW; state->data32Sig = LOW; } else { state->prog32Sig = HIGH; state->data32Sig = HIGH; } /* 2004-05-09 chy below line sould be in skyeye_mach_XXX.c 's XXX_mach_init function */ // state->lateabtSig = HIGH; state->is_v4 = (properties & (ARM_v4_Prop | ARM_v5_Prop)) ? HIGH : LOW; state->is_v5 = (properties & ARM_v5_Prop) ? HIGH : LOW; state->is_v5e = (properties & ARM_v5e_Prop) ? HIGH : LOW; state->is_XScale = (properties & ARM_XScale_Prop) ? HIGH : LOW; state->is_iWMMXt = (properties & ARM_iWMMXt_Prop) ? HIGH : LOW; /* state->is_v6 = LOW */; /* jeff.du 2010-08-05 */ state->is_v6 = (properties & ARM_v6_Prop) ? HIGH : LOW; state->is_ep9312 = (properties & ARM_ep9312_Prop) ? HIGH : LOW; //chy 2005-09-19 state->is_pxa27x = (properties & ARM_PXA27X_Prop) ? HIGH : LOW; /* shenoubang 2012-3-11 */ state->is_v7 = (properties & ARM_v7_Prop) ? HIGH : LOW; /* Only initialse the coprocessor support once we know what kind of chip we are dealing with. */ ARMul_CoProInit (state); }