armemu.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555
  1. /* armemu.h -- ARMulator emulation macros: ARM6 Instruction Emulator.
  2. Copyright (C) 1994 Advanced RISC Machines Ltd.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, see <http://www.gnu.org/licenses/>. */
  13. extern ARMword isize;
  14. extern int trace;
  15. extern int disas;
  16. extern int trace_funcs;
  17. extern void print_insn (ARMword);
  18. /* Condition code values. */
  19. #define EQ 0
  20. #define NE 1
  21. #define CS 2
  22. #define CC 3
  23. #define MI 4
  24. #define PL 5
  25. #define VS 6
  26. #define VC 7
  27. #define HI 8
  28. #define LS 9
  29. #define GE 10
  30. #define LT 11
  31. #define GT 12
  32. #define LE 13
  33. #define AL 14
  34. #define NV 15
  35. /* Shift Opcodes. */
  36. #define LSL 0
  37. #define LSR 1
  38. #define ASR 2
  39. #define ROR 3
  40. /* Macros to twiddle the status flags and mode. */
  41. #define NBIT ((unsigned)1L << 31)
  42. #define ZBIT (1L << 30)
  43. #define CBIT (1L << 29)
  44. #define VBIT (1L << 28)
  45. #define SBIT (1L << 27)
  46. #define GE0 (1L << 16)
  47. #define GE1 (1L << 17)
  48. #define GE2 (1L << 18)
  49. #define GE3 (1L << 19)
  50. #define IBIT (1L << 7)
  51. #define FBIT (1L << 6)
  52. #define IFBITS (3L << 6)
  53. #define R15IBIT (1L << 27)
  54. #define R15FBIT (1L << 26)
  55. #define R15IFBITS (3L << 26)
  56. #define POS(i) ( (~(i)) >> 31 )
  57. #define NEG(i) ( (i) >> 31 )
  58. #ifdef MODET /* Thumb support. */
  59. /* ??? This bit is actually in the low order bit of the PC in the hardware.
  60. It isn't clear if the simulator needs to model that or not. */
  61. #define TBIT (1L << 5)
  62. #define TFLAG state->TFlag
  63. #define SETT state->TFlag = 1
  64. #define CLEART state->TFlag = 0
  65. #define ASSIGNT(res) state->TFlag = res
  66. #define INSN_SIZE (TFLAG ? 2 : 4)
  67. #else
  68. #define INSN_SIZE 4
  69. #endif
  70. #define NFLAG state->NFlag
  71. #define SETN state->NFlag = 1
  72. #define CLEARN state->NFlag = 0
  73. #define ASSIGNN(res) state->NFlag = res
  74. #define ZFLAG state->ZFlag
  75. #define SETZ state->ZFlag = 1
  76. #define CLEARZ state->ZFlag = 0
  77. #define ASSIGNZ(res) state->ZFlag = res
  78. #define CFLAG state->CFlag
  79. #define SETC state->CFlag = 1
  80. #define CLEARC state->CFlag = 0
  81. #define ASSIGNC(res) state->CFlag = res
  82. #define VFLAG state->VFlag
  83. #define SETV state->VFlag = 1
  84. #define CLEARV state->VFlag = 0
  85. #define ASSIGNV(res) state->VFlag = res
  86. #define SFLAG state->SFlag
  87. #define SETS state->SFlag = 1
  88. #define CLEARS state->SFlag = 0
  89. #define ASSIGNS(res) state->SFlag = res
  90. #define IFLAG (state->IFFlags >> 1)
  91. #define FFLAG (state->IFFlags & 1)
  92. #define IFFLAGS state->IFFlags
  93. #define ASSIGNINT(res) state->IFFlags = (((res) >> 6) & 3)
  94. #define ASSIGNR15INT(res) state->IFFlags = (((res) >> 26) & 3) ;
  95. #define PSR_FBITS (0xff000000L)
  96. #define PSR_SBITS (0x00ff0000L)
  97. #define PSR_XBITS (0x0000ff00L)
  98. #define PSR_CBITS (0x000000ffL)
  99. #if defined MODE32 || defined MODET
  100. #define CCBITS (0xf8000000L)
  101. #else
  102. #define CCBITS (0xf0000000L)
  103. #endif
  104. #define INTBITS (0xc0L)
  105. #if defined MODET && defined MODE32
  106. #define PCBITS (0xffffffffL)
  107. #else
  108. #define PCBITS (0xfffffffcL)
  109. #endif
  110. #define MODEBITS (0x1fL)
  111. #define R15INTBITS (3L << 26)
  112. #if defined MODET && defined MODE32
  113. #define R15PCBITS (0x03ffffffL)
  114. #else
  115. #define R15PCBITS (0x03fffffcL)
  116. #endif
  117. #define R15PCMODEBITS (0x03ffffffL)
  118. #define R15MODEBITS (0x3L)
  119. #ifdef MODE32
  120. #define PCMASK PCBITS
  121. #define PCWRAP(pc) (pc)
  122. #else
  123. #define PCMASK R15PCBITS
  124. #define PCWRAP(pc) ((pc) & R15PCBITS)
  125. #endif
  126. #define PC (state->Reg[15] & PCMASK)
  127. #define R15CCINTMODE (state->Reg[15] & (CCBITS | R15INTBITS | R15MODEBITS))
  128. #define R15INT (state->Reg[15] & R15INTBITS)
  129. #define R15INTPC (state->Reg[15] & (R15INTBITS | R15PCBITS))
  130. #define R15INTPCMODE (state->Reg[15] & (R15INTBITS | R15PCBITS | R15MODEBITS))
  131. #define R15INTMODE (state->Reg[15] & (R15INTBITS | R15MODEBITS))
  132. #define R15PC (state->Reg[15] & R15PCBITS)
  133. #define R15PCMODE (state->Reg[15] & (R15PCBITS | R15MODEBITS))
  134. #define R15MODE (state->Reg[15] & R15MODEBITS)
  135. #define ECC ((NFLAG << 31) | (ZFLAG << 30) | (CFLAG << 29) | (VFLAG << 28) | (SFLAG << 27))
  136. #define EINT (IFFLAGS << 6)
  137. #define ER15INT (IFFLAGS << 26)
  138. #define EMODE (state->Mode)
  139. #ifdef MODET
  140. #define CPSR (ECC | EINT | EMODE | (TFLAG << 5))
  141. #else
  142. #define CPSR (ECC | EINT | EMODE)
  143. #endif
  144. #ifdef MODE32
  145. #define PATCHR15
  146. #else
  147. #define PATCHR15 state->Reg[15] = ECC | ER15INT | EMODE | R15PC
  148. #endif
  149. #define GETSPSR(bank) (ARMul_GetSPSR (state, EMODE))
  150. #define SETPSR_F(d,s) d = ((d) & ~PSR_FBITS) | ((s) & PSR_FBITS)
  151. #define SETPSR_S(d,s) d = ((d) & ~PSR_SBITS) | ((s) & PSR_SBITS)
  152. #define SETPSR_X(d,s) d = ((d) & ~PSR_XBITS) | ((s) & PSR_XBITS)
  153. #define SETPSR_C(d,s) d = ((d) & ~PSR_CBITS) | ((s) & PSR_CBITS)
  154. #define SETR15PSR(s) \
  155. do \
  156. { \
  157. if (state->Mode == USER26MODE) \
  158. { \
  159. state->Reg[15] = ((s) & CCBITS) | R15PC | ER15INT | EMODE; \
  160. ASSIGNN ((state->Reg[15] & NBIT) != 0); \
  161. ASSIGNZ ((state->Reg[15] & ZBIT) != 0); \
  162. ASSIGNC ((state->Reg[15] & CBIT) != 0); \
  163. ASSIGNV ((state->Reg[15] & VBIT) != 0); \
  164. } \
  165. else \
  166. { \
  167. state->Reg[15] = R15PC | ((s) & (CCBITS | R15INTBITS | R15MODEBITS)); \
  168. ARMul_R15Altered (state); \
  169. } \
  170. } \
  171. while (0)
  172. #define SETABORT(i, m, d) \
  173. do \
  174. { \
  175. int SETABORT_mode = (m); \
  176. \
  177. ARMul_SetSPSR (state, SETABORT_mode, ARMul_GetCPSR (state)); \
  178. ARMul_SetCPSR (state, ((ARMul_GetCPSR (state) & ~(EMODE | TBIT)) \
  179. | (i) | SETABORT_mode)); \
  180. state->Reg[14] = temp - (d); \
  181. } \
  182. while (0)
  183. #ifndef MODE32
  184. #define VECTORS 0x20
  185. #define LEGALADDR 0x03ffffff
  186. #define VECTORACCESS(address) (address < VECTORS && ARMul_MODE26BIT && state->prog32Sig)
  187. #define ADDREXCEPT(address) (address > LEGALADDR && !state->data32Sig)
  188. #endif
  189. #define INTERNALABORT(address) \
  190. do \
  191. { \
  192. if (address < VECTORS) \
  193. state->Aborted = ARMul_DataAbortV; \
  194. else \
  195. state->Aborted = ARMul_AddrExceptnV; \
  196. } \
  197. while (0)
  198. #ifdef MODE32
  199. #define TAKEABORT ARMul_Abort (state, ARMul_DataAbortV)
  200. #else
  201. #define TAKEABORT \
  202. do \
  203. { \
  204. if (state->Aborted == ARMul_AddrExceptnV) \
  205. ARMul_Abort (state, ARMul_AddrExceptnV); \
  206. else \
  207. ARMul_Abort (state, ARMul_DataAbortV); \
  208. } \
  209. while (0)
  210. #endif
  211. #define CPTAKEABORT \
  212. do \
  213. { \
  214. if (!state->Aborted) \
  215. ARMul_Abort (state, ARMul_UndefinedInstrV); \
  216. else if (state->Aborted == ARMul_AddrExceptnV) \
  217. ARMul_Abort (state, ARMul_AddrExceptnV); \
  218. else \
  219. ARMul_Abort (state, ARMul_DataAbortV); \
  220. } \
  221. while (0);
  222. /* Different ways to start the next instruction. */
  223. #define SEQ 0
  224. #define NONSEQ 1
  225. #define PCINCEDSEQ 2
  226. #define PCINCEDNONSEQ 3
  227. #define PRIMEPIPE 4
  228. #define RESUME 8
  229. #define NORMALCYCLE state->NextInstr = 0
  230. #define BUSUSEDN state->NextInstr |= 1 /* The next fetch will be an N cycle. */
  231. #define BUSUSEDINCPCS \
  232. do \
  233. { \
  234. if (! state->is_v4) \
  235. { \
  236. /* A standard PC inc and an S cycle. */ \
  237. state->Reg[15] += isize; \
  238. state->NextInstr = (state->NextInstr & 0xff) | 2; \
  239. } \
  240. } \
  241. while (0)
  242. #define BUSUSEDINCPCN \
  243. do \
  244. { \
  245. if (state->is_v4) \
  246. BUSUSEDN; \
  247. else \
  248. { \
  249. /* A standard PC inc and an N cycle. */ \
  250. state->Reg[15] += isize; \
  251. state->NextInstr |= 3; \
  252. } \
  253. } \
  254. while (0)
  255. #define INCPC \
  256. do \
  257. { \
  258. /* A standard PC inc. */ \
  259. state->Reg[15] += isize; \
  260. state->NextInstr |= 2; \
  261. } \
  262. while (0)
  263. #define FLUSHPIPE state->NextInstr |= PRIMEPIPE
  264. /* Cycle based emulation. */
  265. #define OUTPUTCP(i,a,b)
  266. #define NCYCLE
  267. #define SCYCLE
  268. #define ICYCLE
  269. #define CCYCLE
  270. #define NEXTCYCLE(c)
  271. /* Macros to extract parts of instructions. */
  272. #define DESTReg (BITS (12, 15))
  273. #define LHSReg (BITS (16, 19))
  274. #define RHSReg (BITS ( 0, 3))
  275. #define DEST (state->Reg[DESTReg])
  276. #ifdef MODE32
  277. #ifdef MODET
  278. #define LHS ((LHSReg == 15) ? (state->Reg[15] & 0xFFFFFFFC): (state->Reg[LHSReg]))
  279. #else
  280. #define LHS (state->Reg[LHSReg])
  281. #endif
  282. #else
  283. #define LHS ((LHSReg == 15) ? R15PC : (state->Reg[LHSReg]))
  284. #endif
  285. #define MULDESTReg (BITS (16, 19))
  286. #define MULLHSReg (BITS ( 0, 3))
  287. #define MULRHSReg (BITS ( 8, 11))
  288. #define MULACCReg (BITS (12, 15))
  289. #define DPImmRHS (ARMul_ImmedTable[BITS(0, 11)])
  290. #define DPSImmRHS temp = BITS(0,11) ; \
  291. rhs = ARMul_ImmedTable[temp] ; \
  292. if (temp > 255) /* There was a shift. */ \
  293. ASSIGNC (rhs >> 31) ;
  294. #ifdef MODE32
  295. #define DPRegRHS ((BITS (4,11) == 0) ? state->Reg[RHSReg] \
  296. : GetDPRegRHS (state, instr))
  297. #define DPSRegRHS ((BITS (4,11) == 0) ? state->Reg[RHSReg] \
  298. : GetDPSRegRHS (state, instr))
  299. #else
  300. #define DPRegRHS ((BITS (0, 11) < 15) ? state->Reg[RHSReg] \
  301. : GetDPRegRHS (state, instr))
  302. #define DPSRegRHS ((BITS (0, 11) < 15) ? state->Reg[RHSReg] \
  303. : GetDPSRegRHS (state, instr))
  304. #endif
  305. #define LSBase state->Reg[LHSReg]
  306. #define LSImmRHS (BITS(0,11))
  307. #ifdef MODE32
  308. #define LSRegRHS ((BITS (4, 11) == 0) ? state->Reg[RHSReg] \
  309. : GetLSRegRHS (state, instr))
  310. #else
  311. #define LSRegRHS ((BITS (0, 11) < 15) ? state->Reg[RHSReg] \
  312. : GetLSRegRHS (state, instr))
  313. #endif
  314. #define LSMNumRegs ((ARMword) ARMul_BitList[BITS (0, 7)] + \
  315. (ARMword) ARMul_BitList[BITS (8, 15)] )
  316. #define LSMBaseFirst ((LHSReg == 0 && BIT (0)) || \
  317. (BIT (LHSReg) && BITS (0, LHSReg - 1) == 0))
  318. #define SWAPSRC (state->Reg[RHSReg])
  319. #define LSCOff (BITS (0, 7) << 2)
  320. #define CPNum BITS (8, 11)
  321. /* Determine if access to coprocessor CP is permitted.
  322. The XScale has a register in CP15 which controls access to CP0 - CP13. */
  323. #define CP_ACCESS_ALLOWED(STATE, CP) \
  324. ( ((CP) >= 14) \
  325. || (! (STATE)->is_XScale) \
  326. || (read_cp15_reg (15, 0, 1) & (1 << (CP))))
  327. /* Macro to rotate n right by b bits. */
  328. #define ROTATER(n, b) (((n) >> (b)) | ((n) << (32 - (b))))
  329. /* Macros to store results of instructions. */
  330. #define WRITEDEST(d) \
  331. do \
  332. { \
  333. if (DESTReg == 15) \
  334. WriteR15 (state, d); \
  335. else \
  336. DEST = d; \
  337. } \
  338. while (0)
  339. #define WRITESDEST(d) \
  340. do \
  341. { \
  342. if (DESTReg == 15) \
  343. WriteSR15 (state, d); \
  344. else \
  345. { \
  346. DEST = d; \
  347. ARMul_NegZero (state, d); \
  348. } \
  349. } \
  350. while (0)
  351. #define WRITEDESTB(d) \
  352. do \
  353. { \
  354. if (DESTReg == 15) \
  355. WriteR15Load (state, d); \
  356. else \
  357. DEST = d; \
  358. } \
  359. while (0)
  360. #define BYTETOBUS(data) ((data & 0xff) | \
  361. ((data & 0xff) << 8) | \
  362. ((data & 0xff) << 16) | \
  363. ((data & 0xff) << 24))
  364. #define BUSTOBYTE(address, data) \
  365. do \
  366. { \
  367. if (state->bigendSig) \
  368. temp = (data >> (((address ^ 3) & 3) << 3)) & 0xff; \
  369. else \
  370. temp = (data >> ((address & 3) << 3)) & 0xff; \
  371. } \
  372. while (0)
  373. #define LOADMULT(instr, address, wb) LoadMult (state, instr, address, wb)
  374. #define LOADSMULT(instr, address, wb) LoadSMult (state, instr, address, wb)
  375. #define STOREMULT(instr, address, wb) StoreMult (state, instr, address, wb)
  376. #define STORESMULT(instr, address, wb) StoreSMult (state, instr, address, wb)
  377. #define POSBRANCH ((instr & 0x7fffff) << 2)
  378. #define NEGBRANCH ((0xff000000 |(instr & 0xffffff)) << 2)
  379. /* Values for Emulate. */
  380. #define STOP 0 /* stop */
  381. #define CHANGEMODE 1 /* change mode */
  382. #define ONCE 2 /* execute just one interation */
  383. #define RUN 3 /* continuous execution */
  384. /* Stuff that is shared across modes. */
  385. extern unsigned ARMul_MultTable[]; /* Number of I cycles for a mult. */
  386. extern ARMword ARMul_ImmedTable[]; /* Immediate DP LHS values. */
  387. extern char ARMul_BitList[]; /* Number of bits in a byte table. */
  388. #define EVENTLISTSIZE 1024L
  389. /* Thumb support. */
  390. typedef enum
  391. {
  392. t_undefined, /* Undefined Thumb instruction. */
  393. t_decoded, /* Instruction decoded to ARM equivalent. */
  394. t_branch /* Thumb branch (already processed). */
  395. }
  396. tdstate;
  397. #define t_resolved t_branch
  398. /* Macros to scrutinize instructions. The dummy do loop is to keep the compiler
  399. happy when the statement is used in an otherwise empty else statement. */
  400. #define UNDEF_Test do { ; } while (0)
  401. #define UNDEF_Shift do { ; } while (0)
  402. #define UNDEF_MSRPC do { ; } while (0)
  403. #define UNDEF_MRSPC do { ; } while (0)
  404. #define UNDEF_MULPCDest do { ; } while (0)
  405. #define UNDEF_MULDestEQOp1 do { ; } while (0)
  406. #define UNDEF_LSRBPC do { ; } while (0)
  407. #define UNDEF_LSRBaseEQOffWb do { ; } while (0)
  408. #define UNDEF_LSRBaseEQDestWb do { ; } while (0)
  409. #define UNDEF_LSRPCBaseWb do { ; } while (0)
  410. #define UNDEF_LSRPCOffWb do { ; } while (0)
  411. #define UNDEF_LSMNoRegs do { ; } while (0)
  412. #define UNDEF_LSMPCBase do { ; } while (0)
  413. #define UNDEF_LSMUserBankWb do { ; } while (0)
  414. #define UNDEF_LSMBaseInListWb do { ; } while (0)
  415. #define UNDEF_SWPPC do { ; } while (0)
  416. #define UNDEF_CoProHS do { ; } while (0)
  417. #define UNDEF_MCRPC do { ; } while (0)
  418. #define UNDEF_LSCPCBaseWb do { ; } while (0)
  419. #define UNDEF_UndefNotBounced do { ; } while (0)
  420. #define UNDEF_ShortInt do { ; } while (0)
  421. #define UNDEF_IllegalMode do { ; } while (0)
  422. #define UNDEF_Prog32SigChange do { ; } while (0)
  423. #define UNDEF_Data32SigChange do { ; } while (0)
  424. /* Prototypes for exported functions. */
  425. extern unsigned ARMul_NthReg (ARMword, unsigned);
  426. extern int AddOverflow (ARMword, ARMword, ARMword);
  427. extern int SubOverflow (ARMword, ARMword, ARMword);
  428. extern ARMword ARMul_Emulate26 (ARMul_State *);
  429. extern ARMword ARMul_Emulate32 (ARMul_State *);
  430. extern unsigned IntPending (ARMul_State *);
  431. extern void ARMul_CPSRAltered (ARMul_State *);
  432. extern void ARMul_R15Altered (ARMul_State *);
  433. extern ARMword ARMul_GetPC (ARMul_State *);
  434. extern ARMword ARMul_GetNextPC (ARMul_State *);
  435. extern ARMword ARMul_GetR15 (ARMul_State *);
  436. extern ARMword ARMul_GetCPSR (ARMul_State *);
  437. extern void ARMul_EnvokeEvent (ARMul_State *);
  438. extern unsigned long ARMul_Time (ARMul_State *);
  439. extern void ARMul_NegZero (ARMul_State *, ARMword);
  440. extern void ARMul_SetPC (ARMul_State *, ARMword);
  441. extern void ARMul_SetR15 (ARMul_State *, ARMword);
  442. extern void ARMul_SetCPSR (ARMul_State *, ARMword);
  443. extern ARMword ARMul_GetSPSR (ARMul_State *, ARMword);
  444. extern void ARMul_Abort26 (ARMul_State *, ARMword);
  445. extern void ARMul_Abort32 (ARMul_State *, ARMword);
  446. extern ARMword ARMul_MRC (ARMul_State *, ARMword);
  447. extern void ARMul_CDP (ARMul_State *, ARMword);
  448. extern void ARMul_LDC (ARMul_State *, ARMword, ARMword);
  449. extern void ARMul_STC (ARMul_State *, ARMword, ARMword);
  450. extern void ARMul_MCR (ARMul_State *, ARMword, ARMword);
  451. extern void ARMul_SetSPSR (ARMul_State *, ARMword, ARMword);
  452. extern ARMword ARMul_SwitchMode (ARMul_State *, ARMword, ARMword);
  453. extern ARMword ARMul_Align (ARMul_State *, ARMword, ARMword);
  454. extern ARMword ARMul_SwitchMode (ARMul_State *, ARMword, ARMword);
  455. extern void ARMul_MSRCpsr (ARMul_State *, ARMword, ARMword);
  456. extern void ARMul_SubOverflow (ARMul_State *, ARMword, ARMword, ARMword);
  457. extern void ARMul_AddOverflow (ARMul_State *, ARMword, ARMword, ARMword);
  458. extern void ARMul_SubCarry (ARMul_State *, ARMword, ARMword, ARMword);
  459. extern void ARMul_AddCarry (ARMul_State *, ARMword, ARMword, ARMword);
  460. extern tdstate ARMul_ThumbDecode (ARMul_State *, ARMword, ARMword, ARMword *);
  461. extern ARMword ARMul_GetReg (ARMul_State *, unsigned, unsigned);
  462. extern void ARMul_SetReg (ARMul_State *, unsigned, unsigned, ARMword);
  463. extern void ARMul_ScheduleEvent (ARMul_State *, unsigned long, unsigned (*) (ARMul_State *));
  464. /* Coprocessor support functions. */
  465. extern unsigned ARMul_CoProInit (ARMul_State *);
  466. extern void ARMul_CoProExit (ARMul_State *);
  467. extern void ARMul_CoProAttach (ARMul_State *, unsigned, ARMul_CPInits *, ARMul_CPExits *,
  468. ARMul_LDCs *, ARMul_STCs *, ARMul_MRCs *, ARMul_MCRs *,
  469. ARMul_CDPs *, ARMul_CPReads *, ARMul_CPWrites *);
  470. extern void ARMul_CoProDetach (ARMul_State *, unsigned);
  471. extern ARMword read_cp15_reg (unsigned, unsigned, unsigned);
  472. extern unsigned DSPLDC4 (ARMul_State *, unsigned, ARMword, ARMword);
  473. extern unsigned DSPMCR4 (ARMul_State *, unsigned, ARMword, ARMword);
  474. extern unsigned DSPMRC4 (ARMul_State *, unsigned, ARMword, ARMword *);
  475. extern unsigned DSPSTC4 (ARMul_State *, unsigned, ARMword, ARMword *);
  476. extern unsigned DSPCDP4 (ARMul_State *, unsigned, ARMword);
  477. extern unsigned DSPMCR5 (ARMul_State *, unsigned, ARMword, ARMword);
  478. extern unsigned DSPMRC5 (ARMul_State *, unsigned, ARMword, ARMword *);
  479. extern unsigned DSPLDC5 (ARMul_State *, unsigned, ARMword, ARMword);
  480. extern unsigned DSPSTC5 (ARMul_State *, unsigned, ARMword, ARMword *);
  481. extern unsigned DSPCDP5 (ARMul_State *, unsigned, ARMword);
  482. extern unsigned DSPMCR6 (ARMul_State *, unsigned, ARMword, ARMword);
  483. extern unsigned DSPMRC6 (ARMul_State *, unsigned, ARMword, ARMword *);
  484. extern unsigned DSPCDP6 (ARMul_State *, unsigned, ARMword);