Update of /cvsroot/arcem/arcem In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24654
Modified Files: armemu.h armemuinstr.c armsupp.c Log Message: armemu.h, armemuinstr.c, armsupp.c - Fix MRC handling so that Rd isn't updated if the op fails/aborts. This fixes some CPU detection techniques. Index: armemuinstr.c =================================================================== RCS file: /cvsroot/arcem/arcem/armemuinstr.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- armemuinstr.c 26 Apr 2016 00:53:57 -0000 1.4 +++ armemuinstr.c 12 May 2016 22:59:29 -0000 1.5 @@ -1931,16 +1931,17 @@ } static void EMFUNCDECL26(CoMRCDataOp) (ARMul_State *state, ARMword instr) { - register ARMword temp; + ARMword temp; EMFUNC_CONDTEST if (BIT(4)) { /* MRC */ - temp = ARMul_MRC(state,instr); - if (DESTReg == 15) { - state->Reg[15] = (state->Reg[15]&~CCBITS) | (temp&CCBITS); - } - else - DEST = temp; + if (ARMul_MRC(state,instr,&temp)) { + if (DESTReg == 15) { + state->Reg[15] = (state->Reg[15]&~CCBITS) | (temp&CCBITS); + } + else + DEST = temp; + } } else /* CDP Part 2 */ ARMul_CDP(state,instr); Index: armemu.h =================================================================== RCS file: /cvsroot/arcem/arcem/armemu.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- armemu.h 12 May 2012 17:34:51 -0000 1.6 +++ armemu.h 12 May 2016 22:59:29 -0000 1.7 @@ -344,7 +344,7 @@ void ARMul_LDC(ARMul_State *state,ARMword instr,ARMword address); void ARMul_STC(ARMul_State *state,ARMword instr,ARMword address); void ARMul_MCR(ARMul_State *state,ARMword instr, ARMword source); -ARMword ARMul_MRC(ARMul_State *state,ARMword instr); +unsigned ARMul_MRC(ARMul_State *state,ARMword instr,ARMword *result); void ARMul_CDP(ARMul_State *state,ARMword instr); unsigned IntPending(ARMul_State *state); ARMword ARMul_Align(ARMul_State *state, ARMword address, ARMword data); Index: armsupp.c =================================================================== RCS file: /cvsroot/arcem/arcem/armsupp.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- armsupp.c 12 May 2012 17:34:51 -0000 1.5 +++ armsupp.c 12 May 2016 22:59:29 -0000 1.6 @@ -284,30 +284,29 @@ * This function does the Busy-Waiting for an MRC instruction. * \***************************************************************************/ -ARMword ARMul_MRC(ARMul_State *state,ARMword instr) +unsigned ARMul_MRC(ARMul_State *state,ARMword instr,ARMword *result) {unsigned cpab; - ARMword result = 0; - cpab = (state->MRC[CPNum])(state,ARMul_FIRST,instr,&result); + cpab = (state->MRC[CPNum])(state,ARMul_FIRST,instr,result); while (cpab == ARMul_BUSY) { ARMul_Icycles(state,1); if (IntPending(state)) { cpab = (state->MRC[CPNum])(state,ARMul_INTERRUPT,instr,0); - return(0); + return(FALSE); } else - cpab = (state->MRC[CPNum])(state,ARMul_BUSY,instr,&result); + 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 */ + return(FALSE); } else { BUSUSEDINCPCN; ARMul_Icycles(state,1); ARMul_Icycles(state,1); } - return(result); + return(TRUE); } /***************************************************************************\ ------------------------------------------------------------------------------ Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j -- arcem-cvs mailing list arcem-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/arcem-cvs