void ARMul_MCRR (ARMul_State * state, ARMword instr, ARMword source1, ARMword source2) { unsigned cpab; //if (!CP_ACCESS_ALLOWED (state, CPNum)) { if (!state->MCRR[CPNum]) { ARMul_UndefInstr (state, instr); return; } cpab = (state->MCRR[CPNum]) (state, ARMul_FIRST, instr, source1, source2); while (cpab == ARMul_BUSY) { ARMul_Icycles (state, 1, 0); if (IntPending (state)) { cpab = (state->MCRR[CPNum]) (state, ARMul_INTERRUPT, instr, 0, 0); return; } else cpab = (state->MCRR[CPNum]) (state, ARMul_BUSY, instr, source1, source2); } if (cpab == ARMul_CANT) { printf ("In %s, CoProcesscor returned CANT, CPnum is %x, instr %x, source %x %x\n", __FUNCTION__, CPNum, instr, source1, source2); ARMul_Abort (state, ARMul_UndefinedInstrV); } else { BUSUSEDINCPCN; ARMul_Ccycles (state, 1, 0); } }
ARMword ARMul_MRC(ARMul_State *state,ARMword instr) {unsigned cpab ; ARMword result = 0 ; cpab = (state->MRC[CPNum])(state,ARMul_FIRST,instr,&result) ; while (cpab == ARMul_BUSY) { ARMul_Icycles(state,1,0) ; if (IntPending(state)) { cpab = (state->MRC[CPNum])(state,ARMul_INTERRUPT,instr,0) ; return(0) ; } else cpab = (state->MRC[CPNum])(state,ARMul_BUSY,instr,&result) ; } if (cpab == ARMul_CANT) { ARMul_Abort(state,ARMul_UndefinedInstrV) ; result = ECC ; /* Parent will destroy the flags otherwise */ } else { BUSUSEDINCPCN ; ARMul_Ccycles(state,1,0) ; ARMul_Icycles(state,1,0) ; } return(result) ; }
void ARMul_MCR (ARMul_State * state, ARMword instr, ARMword source) { unsigned cpab; if (! CP_ACCESS_ALLOWED (state, CPNum)) { ARMul_UndefInstr (state, instr); return; } cpab = (state->MCR[CPNum]) (state, ARMul_FIRST, instr, source); while (cpab == ARMul_BUSY) { ARMul_Icycles (state, 1, 0); if (IntPending (state)) { cpab = (state->MCR[CPNum]) (state, ARMul_INTERRUPT, instr, 0); return; } else cpab = (state->MCR[CPNum]) (state, ARMul_BUSY, instr, source); } if (cpab == ARMul_CANT) ARMul_Abort (state, ARMul_UndefinedInstrV); else { BUSUSEDINCPCN; ARMul_Ccycles (state, 1, 0); } }
ARMword ARMul_MRC (ARMul_State * state, ARMword instr) { int cm = BITS(0, 3) & 0xf; int cp = BITS(5, 7) & 0x7; int rd = BITS(12, 15) & 0xf; int cn = BITS(16, 19) & 0xf; int cpopc = BITS(21, 23) & 0x7; if (cn == 13 && cm == 0 && cp == 3) { //c13,c0,3; returns CPU svc buffer ARMword result = HLE::CallMRC(instr); if (result != -1) { return result; } } //DEBUG("SKYEYE ARMul_MRC p%d, %d, r%d, c%d, c%d, %d\n", CPNum, cpopc, rd, cn, cm, cp); //DEBUG("plutoo: MRC not implemented\n"); //return; unsigned cpab; ARMword result = 0; //printf("SKYEYE ARMul_MRC, CPnum is %x, instr %x\n",CPNum, instr); //if (!CP_ACCESS_ALLOWED (state, CPNum)) { if (!state->MRC[CPNum]) { //chy 2004-07-19 should fix in the future????!!!! DEBUG("SKYEYE ARMul_MRC,NOT ALLOWed UndefInstr CPnum is %x, instr %x\n", CPNum, instr); ARMul_UndefInstr (state, instr); return -1; } cpab = (state->MRC[CPNum]) (state, ARMul_FIRST, instr, &result); while (cpab == ARMul_BUSY) { ARMul_Icycles (state, 1, 0); if (IntPending (state)) { cpab = (state->MRC[CPNum]) (state, ARMul_INTERRUPT, instr, 0); return (0); } else cpab = (state->MRC[CPNum]) (state, ARMul_BUSY, instr, &result); } if (cpab == ARMul_CANT) { printf ("SKYEYE ARMul_MRC,CANT UndefInstr CPnum is %x, instr %x\n", CPNum, instr); ARMul_Abort (state, ARMul_UndefinedInstrV); /* Parent will destroy the flags otherwise. */ result = ECC; } else { BUSUSEDINCPCN; ARMul_Ccycles (state, 1, 0); ARMul_Icycles (state, 1, 0); } return result; }
void ARMul_MCR (ARMul_State * state, ARMword instr, ARMword source) { unsigned cpab; int cm = BITS(0, 3) & 0xf; int cp = BITS(5, 7) & 0x7; int rd = BITS(12, 15) & 0xf; int cn = BITS(16, 19) & 0xf; int cpopc = BITS(21, 23) & 0x7; if (CPNum == 15 && source == 0) //Cache flush { return; } //printf("SKYEYE ARMul_MCR, CPnum is %x, source %x\n",CPNum, source); //if (!CP_ACCESS_ALLOWED (state, CPNum)) { if (!state->MCR[CPNum]) { //chy 2004-07-19 should fix in the future ????!!!! DEBUG("SKYEYE ARMul_MCR, ACCESS_not ALLOWed, UndefinedInstr CPnum is %x, source %x\n",CPNum, source); ARMul_UndefInstr (state, instr); return; } //DEBUG("SKYEYE ARMul_MCR p%d, %d, r%d, c%d, c%d, %d\n", CPNum, cpopc, rd, cn, cm, cp); //DEBUG("plutoo: MCR not implemented\n"); //exit(1); //return; cpab = (state->MCR[CPNum]) (state, ARMul_FIRST, instr, source); while (cpab == ARMul_BUSY) { ARMul_Icycles (state, 1, 0); if (IntPending (state)) { cpab = (state->MCR[CPNum]) (state, ARMul_INTERRUPT, instr, 0); return; } else cpab = (state->MCR[CPNum]) (state, ARMul_BUSY, instr, source); } if (cpab == ARMul_CANT) { DEBUG("SKYEYE ARMul_MCR, CANT, UndefinedInstr %x CPnum is %x, source %x\n", instr, CPNum, source); //ichfly todo //ARMul_Abort (state, ARMul_UndefinedInstrV); } else { BUSUSEDINCPCN; ARMul_Ccycles (state, 1, 0); } }
ARMword ARMul_MRC (ARMul_State * state, ARMword instr) { unsigned cpab; ARMword result = HLE::CallMRC(instr); if (result != -1) { return result; } //printf("SKYEYE ARMul_MRC, CPnum is %x, instr %x\n",CPNum, instr); if (!CP_ACCESS_ALLOWED (state, CPNum)) { //chy 2004-07-19 should fix in the future????!!!! //printf("SKYEYE ARMul_MRC,NOT ALLOWed UndefInstr CPnum is %x, instr %x\n",CPNum, instr); ARMul_UndefInstr (state, instr); return -1; } cpab = (state->MRC[CPNum]) (state, ARMul_FIRST, instr, &result); while (cpab == ARMul_BUSY) { ARMul_Icycles (state, 1, 0); if (IntPending (state)) { cpab = (state->MRC[CPNum]) (state, ARMul_INTERRUPT, instr, 0); return (0); } else cpab = (state->MRC[CPNum]) (state, ARMul_BUSY, instr, &result); } if (cpab == ARMul_CANT) { printf ("SKYEYE ARMul_MRC,CANT UndefInstr CPnum is %x, instr %x\n", CPNum, instr); ARMul_Abort (state, ARMul_UndefinedInstrV); /* Parent will destroy the flags otherwise. */ result = ECC; } else { BUSUSEDINCPCN; ARMul_Ccycles (state, 1, 0); ARMul_Icycles (state, 1, 0); } return result; }
void ARMul_MCR (ARMul_State * state, ARMword instr, ARMword source) { unsigned cpab; u32 num = CPNum; //printf("SKYEYE ARMul_MCR, CPnum is %x, source %x\n",CPNum, source); //if (!CP_ACCESS_ALLOWED (state, CPNum)) { if (!state->MCR[CPNum]) { //chy 2004-07-19 should fix in the future ????!!!! //printf("SKYEYE ARMul_MCR, ACCESS_not ALLOWed, UndefinedInstr CPnum is %x, source %x\n",CPNum, source); ARMul_UndefInstr (state, instr); return; } //DEBUG("plutoo: MCR not implemented\n"); //exit(1); //return; cpab = (state->MCR[CPNum]) (state, ARMul_FIRST, instr, source); while (cpab == ARMul_BUSY) { ARMul_Icycles (state, 1, 0); if (IntPending (state)) { cpab = (state->MCR[CPNum]) (state, ARMul_INTERRUPT, instr, 0); return; } else cpab = (state->MCR[CPNum]) (state, ARMul_BUSY, instr, source); } if (cpab == ARMul_CANT) { DEBUG("SKYEYE ARMul_MCR, CANT, UndefinedInstr %x CPnum is %x, source %x\n", instr, CPNum, source); //ichfly todo //ARMul_Abort (state, ARMul_UndefinedInstrV); } else { BUSUSEDINCPCN; ARMul_Ccycles (state, 1, 0); } }
void ARMul_MRRC (ARMul_State * state, ARMword instr, ARMword * dest1, ARMword * dest2) { unsigned cpab; ARMword result1 = 0; ARMword result2 = 0; if (!CP_ACCESS_ALLOWED (state, CPNum)) { ARMul_UndefInstr (state, instr); return; } cpab = (state->MRRC[CPNum]) (state, ARMul_FIRST, instr, &result1, &result2); while (cpab == ARMul_BUSY) { ARMul_Icycles (state, 1, 0); if (IntPending (state)) { cpab = (state->MRRC[CPNum]) (state, ARMul_INTERRUPT, instr, 0, 0); return; } else cpab = (state->MRRC[CPNum]) (state, ARMul_BUSY, instr, &result1, &result2); } if (cpab == ARMul_CANT) { printf ("In %s, CoProcesscor returned CANT, CPnum is %x, instr %x\n", __FUNCTION__, CPNum, instr); ARMul_Abort (state, ARMul_UndefinedInstrV); } else { BUSUSEDINCPCN; ARMul_Ccycles (state, 1, 0); ARMul_Icycles (state, 1, 0); } *dest1 = result1; *dest2 = result2; }
void ARMul_MCR (ARMul_State * state, ARMword instr, ARMword source) { unsigned cpab; //printf("SKYEYE ARMul_MCR, CPnum is %x, source %x\n",CPNum, source); if (!CP_ACCESS_ALLOWED (state, CPNum)) { //chy 2004-07-19 should fix in the future ????!!!! //printf("SKYEYE ARMul_MCR, ACCESS_not ALLOWed, UndefinedInstr CPnum is %x, source %x\n",CPNum, source); ARMul_UndefInstr (state, instr); return; } cpab = (state->MCR[CPNum]) (state, ARMul_FIRST, instr, source); while (cpab == ARMul_BUSY) { ARMul_Icycles (state, 1, 0); if (IntPending (state)) { cpab = (state->MCR[CPNum]) (state, ARMul_INTERRUPT, instr, 0); return; } else cpab = (state->MCR[CPNum]) (state, ARMul_BUSY, instr, source); } if (cpab == ARMul_CANT) { printf ("SKYEYE ARMul_MCR, CANT, UndefinedInstr CPnum is %x, source %x\n", CPNum, source); ARMul_Abort (state, ARMul_UndefinedInstrV); } else { BUSUSEDINCPCN; ARMul_Ccycles (state, 1, 0); } }