Ejemplo n.º 1
0
static int mips_store_register(int rn, unsigned char * memory){
#if 0
	uint32_t v = frommem(memory);
	if(rn >= 0 && rn < 32)
		mstate->gpr[rn] = v;
	else if(rn == 32)/* SR register of CP0 */
		mstate->cp0[12] = v;
	else if(rn == 33)
		mstate->lo = v;
	else if(rn == 34)
		mstate->hi = v;
	else if(rn == 35) /* Bad Vaddr */
		mstate->cp0[8] = v;
	else if(rn == 36) /* Cause */
		mstate->cp0[13] = v;
	else if(rn == 37)
		mstate->pc = v;
	else if(rn >= 38 && rn < 70)
		mstate->fpr[rn] = v;			
	else if(rn == 70 || rn == 71 || rn == 72) /* fsr, fir, fp */
		; /* do nothing */
#endif
	generic_arch_t* arch_instance = get_arch_instance("");
	arch_instance->set_regval_by_id(rn, frommem(memory));
	return 0;
}
Ejemplo n.º 2
0
static int arm_store_register(int rn, unsigned long * memory){
	//bigendSig = state->bigendSig;
	generic_arch_t* arch_instance = get_arch_instance("");
	if(rn == CPSR_REGNUM){
		//ARMul_SetCPSR(state, frommem(memory));
		arch_instance->set_regval_by_id(rn, frommem(memory));
		return 0;
	}
	if(rn < 16)
		//ARMul_SetReg (state, state->Mode, rn, frommem (memory));
		arch_instance->set_regval_by_id(rn, frommem(memory));
	return 0;
}
Ejemplo n.º 3
0
static int cf_store_register(int rn, unsigned char * memory){
	//SKYEYE_DBG("in %s\n",__FUNCTION__);
	WORD val = frommem(memory);
	if(0 <= rn && rn < 8)
        	memory_core.d[rn] = val ;
        else if(8 <= rn && rn < 16 )
        	memory_core.a[rn-8] = val ;
        else if(16 == rn)
                        memory_core.sr = val;
        else if(17 == rn)
                        memory_core.pc = val;
	else if(rn >= 18 && rn < 29)
			; /* Do nothing */
	else
		return -1;
	return 0;
}