|
|
|
@ -15,22 +15,23 @@
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|
|
|
|
|
|
|
|
|
//#include <util.h>
|
|
|
|
|
|
|
|
|
|
#include "core/arm/interpreter/armdefs.h"
|
|
|
|
|
#include "core/arm/interpreter/armemu.h"
|
|
|
|
|
#include "core/arm/interpreter/skyeye_defs.h"
|
|
|
|
|
#include "core/hle/coprocessor.h"
|
|
|
|
|
#include "core/arm/disassembler/arm_disasm.h"
|
|
|
|
|
|
|
|
|
|
unsigned xscale_cp15_cp_access_allowed (ARMul_State * state, unsigned reg,
|
|
|
|
|
unsigned cpnum);
|
|
|
|
|
//#include "ansidecl.h"
|
|
|
|
|
//#include "skyeye.h"
|
|
|
|
|
//extern int skyeye_instr_debug;
|
|
|
|
|
/* Definitions for the support routines. */
|
|
|
|
|
|
|
|
|
|
static ARMword ModeToBank (ARMword);
|
|
|
|
|
static void EnvokeList (ARMul_State *, unsigned int, unsigned int);
|
|
|
|
|
|
|
|
|
|
struct EventNode
|
|
|
|
|
{ /* An event list node. */
|
|
|
|
|
struct EventNode {
|
|
|
|
|
/* An event list node. */
|
|
|
|
|
unsigned (*func) (ARMul_State *); /* The function to call. */
|
|
|
|
|
struct EventNode *next;
|
|
|
|
|
};
|
|
|
|
@ -76,9 +77,9 @@ ARMword
|
|
|
|
|
ARMul_GetNextPC (ARMul_State * state)
|
|
|
|
|
{
|
|
|
|
|
if (state->Mode > SVC26MODE)
|
|
|
|
|
return state->Reg[15] + isize;
|
|
|
|
|
return state->Reg[15] + INSN_SIZE;
|
|
|
|
|
else
|
|
|
|
|
return (state->Reg[15] + isize) & R15PCBITS;
|
|
|
|
|
return (state->Reg[15] + INSN_SIZE) & R15PCBITS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* This routine sets the value of the PC. */
|
|
|
|
@ -213,13 +214,13 @@ ARMul_CPSRAltered (ARMul_State * state)
|
|
|
|
|
|
|
|
|
|
oldmode = state->Mode;
|
|
|
|
|
|
|
|
|
|
if (state->Mode != (state->Cpsr & MODEBITS)) {
|
|
|
|
|
/*if (state->Mode != (state->Cpsr & MODEBITS)) {
|
|
|
|
|
state->Mode =
|
|
|
|
|
ARMul_SwitchMode (state, state->Mode,
|
|
|
|
|
state->Cpsr & MODEBITS);
|
|
|
|
|
|
|
|
|
|
state->NtransSig = (state->Mode & 3) ? HIGH : LOW;
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
//state->Cpsr &= ~MODEBITS;
|
|
|
|
|
|
|
|
|
|
ASSIGNINT (state->Cpsr & INTBITS);
|
|
|
|
@ -244,13 +245,11 @@ ARMul_CPSRAltered (ARMul_State * state)
|
|
|
|
|
state->Emulate = CHANGEMODE;
|
|
|
|
|
state->Reg[15] = ECC | ER15INT | EMODE | R15PC;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
if (state->Mode > SVC26MODE) {
|
|
|
|
|
state->Emulate = CHANGEMODE;
|
|
|
|
|
state->Reg[15] = R15PC;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
} else
|
|
|
|
|
state->Reg[15] = ECC | ER15INT | EMODE | R15PC;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -406,12 +405,10 @@ ARMul_NegZero (ARMul_State * state, ARMword result)
|
|
|
|
|
if (NEG (result)) {
|
|
|
|
|
SETN;
|
|
|
|
|
CLEARZ;
|
|
|
|
|
}
|
|
|
|
|
else if (result == 0) {
|
|
|
|
|
} else if (result == 0) {
|
|
|
|
|
CLEARN;
|
|
|
|
|
SETZ;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
CLEARN;
|
|
|
|
|
CLEARZ;
|
|
|
|
|
}
|
|
|
|
@ -482,12 +479,13 @@ ARMul_LDC (ARMul_State * state, ARMword instr, ARMword address)
|
|
|
|
|
|
|
|
|
|
UNDEF_LSCPCBaseWb;
|
|
|
|
|
//printf("SKYEYE ARMul_LDC, CPnum is %x, instr %x, addr %x\n",CPNum, instr, address);
|
|
|
|
|
/*chy 2004-05-23 should update this function in the future,should concern dataabort*/
|
|
|
|
|
/*chy 2004-05-23 should update this function in the future,should concern dataabort*/
|
|
|
|
|
// chy 2004-05-25 , fix it now,so needn't printf
|
|
|
|
|
// printf("SKYEYE ARMul_LDC, should update this function!!!!!\n");
|
|
|
|
|
//exit(-1);
|
|
|
|
|
|
|
|
|
|
if (!CP_ACCESS_ALLOWED (state, CPNum)) {
|
|
|
|
|
//if (!CP_ACCESS_ALLOWED (state, CPNum)) {
|
|
|
|
|
if (!state->LDC[CPNum]) {
|
|
|
|
|
/*
|
|
|
|
|
printf
|
|
|
|
|
("SKYEYE ARMul_LDC,NOT ALLOW, underinstr, CPnum is %x, instr %x, addr %x\n",
|
|
|
|
@ -497,8 +495,8 @@ ARMul_LDC (ARMul_State * state, ARMword instr, ARMword address)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//if (ADDREXCEPT (address))
|
|
|
|
|
// INTERNALABORT (address);
|
|
|
|
|
/*if (ADDREXCEPT (address))
|
|
|
|
|
INTERNALABORT (address);*/
|
|
|
|
|
|
|
|
|
|
cpab = (state->LDC[CPNum]) (state, ARMul_FIRST, instr, 0);
|
|
|
|
|
while (cpab == ARMul_BUSY) {
|
|
|
|
@ -508,8 +506,7 @@ ARMul_LDC (ARMul_State * state, ARMword instr, ARMword address)
|
|
|
|
|
cpab = (state->LDC[CPNum]) (state, ARMul_INTERRUPT,
|
|
|
|
|
instr, 0);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
} else
|
|
|
|
|
cpab = (state->LDC[CPNum]) (state, ARMul_BUSY, instr,
|
|
|
|
|
0);
|
|
|
|
|
}
|
|
|
|
@ -531,10 +528,10 @@ ARMul_LDC (ARMul_State * state, ARMword instr, ARMword address)
|
|
|
|
|
|
|
|
|
|
BUSUSEDINCPCN;
|
|
|
|
|
//chy 2004-05-25
|
|
|
|
|
/*
|
|
|
|
|
/*
|
|
|
|
|
if (BIT (21))
|
|
|
|
|
LSBase = state->Base;
|
|
|
|
|
*/
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
cpab = (state->LDC[CPNum]) (state, ARMul_DATA, instr, data);
|
|
|
|
|
|
|
|
|
@ -549,7 +546,7 @@ ARMul_LDC (ARMul_State * state, ARMword instr, ARMword address)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//chy 2004-05-25
|
|
|
|
|
L_ldc_takeabort:
|
|
|
|
|
L_ldc_takeabort:
|
|
|
|
|
if (BIT (21)) {
|
|
|
|
|
if (!
|
|
|
|
|
((state->abortSig || state->Aborted)
|
|
|
|
@ -581,7 +578,8 @@ ARMul_STC (ARMul_State * state, ARMword instr, ARMword address)
|
|
|
|
|
// printf("SKYEYE ARMul_STC, should update this function!!!!!\n");
|
|
|
|
|
|
|
|
|
|
//exit(-1);
|
|
|
|
|
if (!CP_ACCESS_ALLOWED (state, CPNum)) {
|
|
|
|
|
//if (!CP_ACCESS_ALLOWED (state, CPNum)) {
|
|
|
|
|
if (!state->STC[CPNum]) {
|
|
|
|
|
/*
|
|
|
|
|
printf
|
|
|
|
|
("SKYEYE ARMul_STC,NOT ALLOW, undefinstr, CPnum is %x, instr %x, addr %x\n",
|
|
|
|
@ -591,8 +589,8 @@ ARMul_STC (ARMul_State * state, ARMword instr, ARMword address)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//if (ADDREXCEPT (address) || VECTORACCESS (address))
|
|
|
|
|
// INTERNALABORT (address);
|
|
|
|
|
/*if (ADDREXCEPT (address) || VECTORACCESS (address))
|
|
|
|
|
INTERNALABORT (address);*/
|
|
|
|
|
|
|
|
|
|
cpab = (state->STC[CPNum]) (state, ARMul_FIRST, instr, &data);
|
|
|
|
|
while (cpab == ARMul_BUSY) {
|
|
|
|
@ -601,8 +599,7 @@ ARMul_STC (ARMul_State * state, ARMword instr, ARMword address)
|
|
|
|
|
cpab = (state->STC[CPNum]) (state, ARMul_INTERRUPT,
|
|
|
|
|
instr, 0);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
} else
|
|
|
|
|
cpab = (state->STC[CPNum]) (state, ARMul_BUSY, instr,
|
|
|
|
|
&data);
|
|
|
|
|
}
|
|
|
|
@ -616,16 +613,16 @@ ARMul_STC (ARMul_State * state, ARMword instr, ARMword address)
|
|
|
|
|
CPTAKEABORT;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
#ifndef MODE32
|
|
|
|
|
/*#ifndef MODE32
|
|
|
|
|
if (ADDREXCEPT (address) || VECTORACCESS (address))
|
|
|
|
|
INTERNALABORT (address);
|
|
|
|
|
#endif
|
|
|
|
|
#endif*/
|
|
|
|
|
BUSUSEDINCPCN;
|
|
|
|
|
//chy 2004-05-25
|
|
|
|
|
/*
|
|
|
|
|
/*
|
|
|
|
|
if (BIT (21))
|
|
|
|
|
LSBase = state->Base;
|
|
|
|
|
*/
|
|
|
|
|
*/
|
|
|
|
|
cpab = (state->STC[CPNum]) (state, ARMul_DATA, instr, &data);
|
|
|
|
|
ARMul_StoreWordN (state, address, data);
|
|
|
|
|
//chy 2004-05-25
|
|
|
|
@ -641,7 +638,7 @@ ARMul_STC (ARMul_State * state, ARMword instr, ARMword address)
|
|
|
|
|
goto L_stc_takeabort;
|
|
|
|
|
}
|
|
|
|
|
//chy 2004-05-25
|
|
|
|
|
L_stc_takeabort:
|
|
|
|
|
L_stc_takeabort:
|
|
|
|
|
if (BIT (21)) {
|
|
|
|
|
if (!
|
|
|
|
|
((state->abortSig || state->Aborted)
|
|
|
|
@ -659,15 +656,31 @@ 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 (!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);
|
|
|
|
|
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) {
|
|
|
|
@ -677,17 +690,15 @@ ARMul_MCR (ARMul_State * state, ARMword instr, ARMword source)
|
|
|
|
|
cpab = (state->MCR[CPNum]) (state, ARMul_INTERRUPT,
|
|
|
|
|
instr, 0);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
} else
|
|
|
|
|
cpab = (state->MCR[CPNum]) (state, ARMul_BUSY, instr,
|
|
|
|
|
source);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (cpab == ARMul_CANT) {
|
|
|
|
|
printf ("SKYEYE ARMul_MCR, CANT, UndefinedInstr %x CPnum is %x, source %x\n", instr, CPNum, source);
|
|
|
|
|
ARMul_Abort (state, ARMul_UndefinedInstrV);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
@ -700,7 +711,8 @@ ARMul_MCRR (ARMul_State * state, ARMword instr, ARMword source1, ARMword source2
|
|
|
|
|
{
|
|
|
|
|
unsigned cpab;
|
|
|
|
|
|
|
|
|
|
if (!CP_ACCESS_ALLOWED (state, CPNum)) {
|
|
|
|
|
//if (!CP_ACCESS_ALLOWED (state, CPNum)) {
|
|
|
|
|
if (!state->MCRR[CPNum]) {
|
|
|
|
|
ARMul_UndefInstr (state, instr);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -714,16 +726,14 @@ ARMul_MCRR (ARMul_State * state, ARMword instr, ARMword source1, ARMword source2
|
|
|
|
|
cpab = (state->MCRR[CPNum]) (state, ARMul_INTERRUPT,
|
|
|
|
|
instr, 0, 0);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
} 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 {
|
|
|
|
|
} else {
|
|
|
|
|
BUSUSEDINCPCN;
|
|
|
|
|
ARMul_Ccycles (state, 1, 0);
|
|
|
|
|
}
|
|
|
|
@ -731,21 +741,34 @@ ARMul_MCRR (ARMul_State * state, ARMword instr, ARMword source1, ARMword source2
|
|
|
|
|
|
|
|
|
|
/* This function does the Busy-Waiting for an MRC instruction. */
|
|
|
|
|
|
|
|
|
|
ARMword
|
|
|
|
|
ARMul_MRC (ARMul_State * state, ARMword instr)
|
|
|
|
|
ARMword ARMul_MRC (ARMul_State * state, ARMword instr)
|
|
|
|
|
{
|
|
|
|
|
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 (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 (!CP_ACCESS_ALLOWED (state, CPNum)) {
|
|
|
|
|
if (!state->MRC[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);
|
|
|
|
|
DEBUG("SKYEYE ARMul_MRC,NOT ALLOWed UndefInstr CPnum is %x, instr %x\n", CPNum, instr);
|
|
|
|
|
ARMul_UndefInstr (state, instr);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
@ -757,8 +780,7 @@ ARMul_MRC (ARMul_State * state, ARMword instr)
|
|
|
|
|
cpab = (state->MRC[CPNum]) (state, ARMul_INTERRUPT,
|
|
|
|
|
instr, 0);
|
|
|
|
|
return (0);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
} else
|
|
|
|
|
cpab = (state->MRC[CPNum]) (state, ARMul_BUSY, instr,
|
|
|
|
|
&result);
|
|
|
|
|
}
|
|
|
|
@ -767,8 +789,7 @@ ARMul_MRC (ARMul_State * state, ARMword instr)
|
|
|
|
|
ARMul_Abort (state, ARMul_UndefinedInstrV);
|
|
|
|
|
/* Parent will destroy the flags otherwise. */
|
|
|
|
|
result = ECC;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
BUSUSEDINCPCN;
|
|
|
|
|
ARMul_Ccycles (state, 1, 0);
|
|
|
|
|
ARMul_Icycles (state, 1, 0);
|
|
|
|
@ -786,7 +807,8 @@ ARMul_MRRC (ARMul_State * state, ARMword instr, ARMword * dest1, ARMword * dest2
|
|
|
|
|
ARMword result1 = 0;
|
|
|
|
|
ARMword result2 = 0;
|
|
|
|
|
|
|
|
|
|
if (!CP_ACCESS_ALLOWED (state, CPNum)) {
|
|
|
|
|
//if (!CP_ACCESS_ALLOWED (state, CPNum)) {
|
|
|
|
|
if (!state->MRRC[CPNum]) {
|
|
|
|
|
ARMul_UndefInstr (state, instr);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -798,16 +820,14 @@ ARMul_MRRC (ARMul_State * state, ARMword instr, ARMword * dest1, ARMword * dest2
|
|
|
|
|
cpab = (state->MRRC[CPNum]) (state, ARMul_INTERRUPT,
|
|
|
|
|
instr, 0, 0);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
} 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 {
|
|
|
|
|
} else {
|
|
|
|
|
BUSUSEDINCPCN;
|
|
|
|
|
ARMul_Ccycles (state, 1, 0);
|
|
|
|
|
ARMul_Icycles (state, 1, 0);
|
|
|
|
@ -824,7 +844,8 @@ ARMul_CDP (ARMul_State * state, ARMword instr)
|
|
|
|
|
{
|
|
|
|
|
unsigned cpab;
|
|
|
|
|
|
|
|
|
|
if (!CP_ACCESS_ALLOWED (state, CPNum)) {
|
|
|
|
|
//if (!CP_ACCESS_ALLOWED (state, CPNum)) {
|
|
|
|
|
if (!state->CDP[CPNum]) {
|
|
|
|
|
ARMul_UndefInstr (state, instr);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -835,8 +856,7 @@ ARMul_CDP (ARMul_State * state, ARMword instr)
|
|
|
|
|
cpab = (state->CDP[CPNum]) (state, ARMul_INTERRUPT,
|
|
|
|
|
instr);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
} else
|
|
|
|
|
cpab = (state->CDP[CPNum]) (state, ARMul_BUSY, instr);
|
|
|
|
|
}
|
|
|
|
|
if (cpab == ARMul_CANT)
|
|
|
|
@ -850,6 +870,8 @@ ARMul_CDP (ARMul_State * state, ARMword instr)
|
|
|
|
|
void
|
|
|
|
|
ARMul_UndefInstr (ARMul_State * state, ARMword instr)
|
|
|
|
|
{
|
|
|
|
|
/*SKYEYE_LOG_IN_CLR(RED, "In %s, line = %d, undef instr: 0x%x\n",
|
|
|
|
|
__func__, __LINE__, instr);*/
|
|
|
|
|
char buff[512];
|
|
|
|
|
ARM_Disasm disasm = ARM_Disasm();
|
|
|
|
|
disasm.disasm(state->pc, instr, buff);
|
|
|
|
@ -866,12 +888,10 @@ IntPending (ARMul_State * state)
|
|
|
|
|
if (state->NresetSig == LOW) {
|
|
|
|
|
ARMul_Abort (state, ARMul_ResetV);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
else if (!state->NfiqSig && !FFLAG) {
|
|
|
|
|
} else if (!state->NfiqSig && !FFLAG) {
|
|
|
|
|
ARMul_Abort (state, ARMul_FIQV);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
else if (!state->NirqSig && !IFLAG) {
|
|
|
|
|
} else if (!state->NirqSig && !IFLAG) {
|
|
|
|
|
ARMul_Abort (state, ARMul_IRQV);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
@ -882,7 +902,7 @@ IntPending (ARMul_State * state)
|
|
|
|
|
/* Align a word access to a non word boundary. */
|
|
|
|
|
|
|
|
|
|
ARMword
|
|
|
|
|
ARMul_Align (ARMul_State *state, ARMword address, ARMword data)
|
|
|
|
|
ARMul_Align (ARMul_State* state, ARMword address, ARMword data)
|
|
|
|
|
{
|
|
|
|
|
/* This code assumes the address is really unaligned,
|
|
|
|
|
as a shift by 32 is undefined in C. */
|
|
|
|
@ -907,7 +927,11 @@ ARMul_ScheduleEvent (ARMul_State * state, unsigned int delay,
|
|
|
|
|
state->Now = ARMul_Time (state);
|
|
|
|
|
when = (state->Now + delay) % EVENTLISTSIZE;
|
|
|
|
|
event = (struct EventNode *) malloc (sizeof (struct EventNode));
|
|
|
|
|
_dbg_assert_msg_(ARM11, event, "SKYEYE:ARMul_ScheduleEvent: malloc event error\n");
|
|
|
|
|
if (!event) {
|
|
|
|
|
printf ("SKYEYE:ARMul_ScheduleEvent: malloc event error\n");
|
|
|
|
|
exit(-1);
|
|
|
|
|
//skyeye_exit (-1);
|
|
|
|
|
}
|
|
|
|
|
event->func = what;
|
|
|
|
|
event->next = *(state->EventPtr + when);
|
|
|
|
|
*(state->EventPtr + when) = event;
|
|
|
|
|