summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/arm/interpreter/armcopro.cpp7
-rw-r--r--src/core/arm/interpreter/arminit.cpp14
-rw-r--r--src/core/arm/skyeye_common/armdefs.h12
-rw-r--r--src/core/arm/skyeye_common/armemu.h14
4 files changed, 19 insertions, 28 deletions
diff --git a/src/core/arm/interpreter/armcopro.cpp b/src/core/arm/interpreter/armcopro.cpp
index bb9ca98fe..4ae0c52e4 100644
--- a/src/core/arm/interpreter/armcopro.cpp
+++ b/src/core/arm/interpreter/armcopro.cpp
@@ -47,7 +47,7 @@ static unsigned int NoCoPro5W(ARMul_State* state, unsigned int a, ARMword b, ARM
47} 47}
48 48
49// Install co-processor instruction handlers in this routine. 49// Install co-processor instruction handlers in this routine.
50unsigned int ARMul_CoProInit(ARMul_State* state) 50void ARMul_CoProInit(ARMul_State* state)
51{ 51{
52 // Initialise tham all first. 52 // Initialise tham all first.
53 for (unsigned int i = 0; i < 16; i++) 53 for (unsigned int i = 0; i < 16; i++)
@@ -71,11 +71,10 @@ unsigned int ARMul_CoProInit(ARMul_State* state)
71 // No handlers below here. 71 // No handlers below here.
72 72
73 // Call all the initialisation routines. 73 // Call all the initialisation routines.
74 for (unsigned int i = 0; i < 16; i++) 74 for (unsigned int i = 0; i < 16; i++) {
75 if (state->CPInit[i]) 75 if (state->CPInit[i])
76 (state->CPInit[i]) (state); 76 (state->CPInit[i]) (state);
77 77 }
78 return TRUE;
79} 78}
80 79
81// Install co-processor finalisation routines in this routine. 80// Install co-processor finalisation routines in this routine.
diff --git a/src/core/arm/interpreter/arminit.cpp b/src/core/arm/interpreter/arminit.cpp
index a52d14960..7b502e240 100644
--- a/src/core/arm/interpreter/arminit.cpp
+++ b/src/core/arm/interpreter/arminit.cpp
@@ -63,24 +63,22 @@ void ARMul_EmulateInit()
63\***************************************************************************/ 63\***************************************************************************/
64ARMul_State* ARMul_NewState(ARMul_State* state) 64ARMul_State* ARMul_NewState(ARMul_State* state)
65{ 65{
66 unsigned i, j;
67
68 memset (state, 0, sizeof (ARMul_State)); 66 memset (state, 0, sizeof (ARMul_State));
69 67
70 state->Emulate = RUN; 68 state->Emulate = RUN;
71 for (i = 0; i < 16; i++) { 69 for (unsigned int i = 0; i < 16; i++) {
72 state->Reg[i] = 0; 70 state->Reg[i] = 0;
73 for (j = 0; j < 7; j++) 71 for (unsigned int j = 0; j < 7; j++)
74 state->RegBank[j][i] = 0; 72 state->RegBank[j][i] = 0;
75 } 73 }
76 for (i = 0; i < 7; i++) 74 for (unsigned int i = 0; i < 7; i++)
77 state->Spsr[i] = 0; 75 state->Spsr[i] = 0;
76
78 state->Mode = 0; 77 state->Mode = 0;
79 78
80 state->Debug = FALSE;
81 state->VectorCatch = 0; 79 state->VectorCatch = 0;
82 state->Aborted = FALSE; 80 state->Aborted = false;
83 state->Reseted = FALSE; 81 state->Reseted = false;
84 state->Inted = 3; 82 state->Inted = 3;
85 state->LastInted = 3; 83 state->LastInted = 3;
86 84
diff --git a/src/core/arm/skyeye_common/armdefs.h b/src/core/arm/skyeye_common/armdefs.h
index 778868783..ff9296e0f 100644
--- a/src/core/arm/skyeye_common/armdefs.h
+++ b/src/core/arm/skyeye_common/armdefs.h
@@ -35,11 +35,6 @@
35#define BITS(s, a, b) ((s << ((sizeof(s) * 8 - 1) - b)) >> (sizeof(s) * 8 - b + a - 1)) 35#define BITS(s, a, b) ((s << ((sizeof(s) * 8 - 1) - b)) >> (sizeof(s) * 8 - b + a - 1))
36#define BIT(s, n) ((s >> (n)) & 1) 36#define BIT(s, n) ((s >> (n)) & 1)
37 37
38#ifndef FALSE
39#define FALSE 0
40#define TRUE 1
41#endif
42
43#define LOW 0 38#define LOW 0
44#define HIGH 1 39#define HIGH 1
45#define LOWHIGH 1 40#define LOWHIGH 1
@@ -135,7 +130,6 @@ struct ARMul_State
135 unsigned char* CPData[16]; // Coprocessor data 130 unsigned char* CPData[16]; // Coprocessor data
136 unsigned char const* CPRegWords[16]; // Map of coprocessor register sizes 131 unsigned char const* CPRegWords[16]; // Map of coprocessor register sizes
137 132
138 unsigned Debug; // Show instructions as they are executed
139 unsigned NresetSig; // Reset the processor 133 unsigned NresetSig; // Reset the processor
140 unsigned NfiqSig; 134 unsigned NfiqSig;
141 unsigned NirqSig; 135 unsigned NirqSig;
@@ -180,12 +174,12 @@ So, if lateabtSig=1, then it means Late Abort Model(Base Updated Abort Model)
180*/ 174*/
181 unsigned lateabtSig; 175 unsigned lateabtSig;
182 176
183 ARMword Vector; // Synthesize aborts in cycle modes 177 bool Aborted; // Sticky flag for aborts
184 ARMword Aborted; // Sticky flag for aborts 178 bool Reseted; // Sticky flag for Reset
185 ARMword Reseted; // Sticky flag for Reset
186 ARMword Inted, LastInted; // Sticky flags for interrupts 179 ARMword Inted, LastInted; // Sticky flags for interrupts
187 ARMword Base; // Extra hand for base writeback 180 ARMword Base; // Extra hand for base writeback
188 ARMword AbortAddr; // To keep track of Prefetch aborts 181 ARMword AbortAddr; // To keep track of Prefetch aborts
182 ARMword Vector; // Synthesize aborts in cycle modes
189 183
190 // For differentiating ARM core emulaiton. 184 // For differentiating ARM core emulaiton.
191 bool is_v4; // Are we emulating a v4 architecture (or higher)? 185 bool is_v4; // Are we emulating a v4 architecture (or higher)?
diff --git a/src/core/arm/skyeye_common/armemu.h b/src/core/arm/skyeye_common/armemu.h
index 6071d447b..beee54c9a 100644
--- a/src/core/arm/skyeye_common/armemu.h
+++ b/src/core/arm/skyeye_common/armemu.h
@@ -100,10 +100,10 @@ extern ARMword ARMul_ImmedTable[]; // Immediate DP LHS values.
100extern char ARMul_BitList[]; // Number of bits in a byte table. 100extern char ARMul_BitList[]; // Number of bits in a byte table.
101 101
102// Coprocessor support functions. 102// Coprocessor support functions.
103extern unsigned ARMul_CoProInit (ARMul_State *); 103extern void ARMul_CoProInit(ARMul_State*);
104extern void ARMul_CoProExit (ARMul_State *); 104extern void ARMul_CoProExit(ARMul_State*);
105extern void ARMul_CoProAttach (ARMul_State *, unsigned, ARMul_CPInits *, 105extern void ARMul_CoProAttach(ARMul_State*, unsigned, ARMul_CPInits*,
106 ARMul_CPExits *, ARMul_LDCs *, ARMul_STCs *, 106 ARMul_CPExits*, ARMul_LDCs*, ARMul_STCs*,
107 ARMul_MRCs *, ARMul_MCRs *, ARMul_MRRCs *, ARMul_MCRRs *, 107 ARMul_MRCs*, ARMul_MCRs*, ARMul_MRRCs*, ARMul_MCRRs*,
108 ARMul_CDPs *, ARMul_CPReads *, ARMul_CPWrites *); 108 ARMul_CDPs*, ARMul_CPReads*, ARMul_CPWrites*);
109extern void ARMul_CoProDetach (ARMul_State *, unsigned); 109extern void ARMul_CoProDetach(ARMul_State*, unsigned);