Home | History | Annotate | Line # | Download | only in arm
      1  1.1  christos /*  armdefs.h -- ARMulator common definitions:  ARM6 Instruction Emulator.
      2  1.1  christos     Copyright (C) 1994 Advanced RISC Machines Ltd.
      3  1.6  christos 
      4  1.1  christos     This program is free software; you can redistribute it and/or modify
      5  1.1  christos     it under the terms of the GNU General Public License as published by
      6  1.1  christos     the Free Software Foundation; either version 3 of the License, or
      7  1.1  christos     (at your option) any later version.
      8  1.6  christos 
      9  1.1  christos     This program is distributed in the hope that it will be useful,
     10  1.1  christos     but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  1.1  christos     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     12  1.1  christos     GNU General Public License for more details.
     13  1.6  christos 
     14  1.1  christos     You should have received a copy of the GNU General Public License
     15  1.1  christos     along with this program; if not, see <http://www.gnu.org/licenses/>. */
     16  1.1  christos 
     17  1.8  christos #ifndef ARMDEFS_H
     18  1.8  christos #define ARMDEFS_H
     19  1.8  christos 
     20  1.1  christos #include <stdio.h>
     21  1.1  christos #include <stdlib.h>
     22  1.5  christos #include <stdint.h>
     23  1.7  christos #include <ansidecl.h>
     24  1.1  christos 
     25  1.1  christos #define FALSE 0
     26  1.1  christos #define TRUE 1
     27  1.1  christos #define LOW 0
     28  1.1  christos #define HIGH 1
     29  1.1  christos #define LOWHIGH 1
     30  1.1  christos #define HIGHLOW 2
     31  1.1  christos 
     32  1.1  christos typedef uint32_t ARMword;
     33  1.1  christos typedef int32_t ARMsword;
     34  1.1  christos typedef uint64_t ARMdword;
     35  1.1  christos typedef int64_t ARMsdword;
     36  1.1  christos typedef struct ARMul_State ARMul_State;
     37  1.1  christos 
     38  1.1  christos typedef unsigned ARMul_CPInits (ARMul_State * state);
     39  1.1  christos typedef unsigned ARMul_CPExits (ARMul_State * state);
     40  1.1  christos typedef unsigned ARMul_LDCs (ARMul_State * state, unsigned type,
     41  1.1  christos 			     ARMword instr, ARMword value);
     42  1.1  christos typedef unsigned ARMul_STCs (ARMul_State * state, unsigned type,
     43  1.1  christos 			     ARMword instr, ARMword * value);
     44  1.1  christos typedef unsigned ARMul_MRCs (ARMul_State * state, unsigned type,
     45  1.1  christos 			     ARMword instr, ARMword * value);
     46  1.1  christos typedef unsigned ARMul_MCRs (ARMul_State * state, unsigned type,
     47  1.1  christos 			     ARMword instr, ARMword value);
     48  1.1  christos typedef unsigned ARMul_CDPs (ARMul_State * state, unsigned type,
     49  1.1  christos 			     ARMword instr);
     50  1.1  christos typedef unsigned ARMul_CPReads (ARMul_State * state, unsigned reg,
     51  1.1  christos 				ARMword * value);
     52  1.1  christos typedef unsigned ARMul_CPWrites (ARMul_State * state, unsigned reg,
     53  1.1  christos 				 ARMword value);
     54  1.1  christos 
     55  1.5  christos typedef double ARMdval;	/* FIXME: Must be a 64-bit floating point type.  */
     56  1.5  christos typedef float  ARMfval;	/* FIXME: Must be a 32-bit floating point type.  */
     57  1.5  christos 
     58  1.5  christos typedef union
     59  1.5  christos {
     60  1.5  christos   ARMword  uword[2];
     61  1.5  christos   ARMsword sword[2];
     62  1.5  christos   ARMfval  fval[2];
     63  1.5  christos   ARMdword dword;
     64  1.5  christos   ARMdval  dval;
     65  1.5  christos } ARM_VFP_reg;
     66  1.5  christos 
     67  1.5  christos #define VFP_fval(N)  (state->VFP_Reg[(N)>> 1].fval[(N) & 1])
     68  1.5  christos #define VFP_uword(N) (state->VFP_Reg[(N)>> 1].uword[(N) & 1])
     69  1.5  christos #define VFP_sword(N) (state->VFP_Reg[(N)>> 1].sword[(N) & 1])
     70  1.5  christos 
     71  1.5  christos #define VFP_dval(N)  (state->VFP_Reg[(N)].dval)
     72  1.5  christos #define VFP_dword(N) (state->VFP_Reg[(N)].dword)
     73  1.5  christos 
     74  1.1  christos struct ARMul_State
     75  1.1  christos {
     76  1.1  christos   ARMword Emulate;		/* to start and stop emulation */
     77  1.1  christos   unsigned EndCondition;	/* reason for stopping */
     78  1.1  christos   ARMword Reg[16];		/* the current register file */
     79  1.1  christos   ARMword RegBank[7][16];	/* all the registers */
     80  1.1  christos   /* 40 bit accumulator.  We always keep this 64 bits wide,
     81  1.1  christos      and move only 40 bits out of it in an MRA insn.  */
     82  1.1  christos   ARMdword Accumulator;
     83  1.1  christos   ARMword Cpsr;			/* the current psr */
     84  1.1  christos   ARMword Spsr[7];		/* the exception psr's */
     85  1.1  christos   ARMword NFlag, ZFlag, CFlag, VFlag, IFFlags;	/* dummy flags for speed */
     86  1.1  christos   ARMword SFlag;
     87  1.1  christos #ifdef MODET
     88  1.1  christos   ARMword TFlag;		/* Thumb state */
     89  1.1  christos #endif
     90  1.1  christos   ARMword Bank;			/* the current register bank */
     91  1.1  christos   ARMword Mode;			/* the current mode */
     92  1.1  christos   ARMword instr, pc, temp;	/* saved register state */
     93  1.1  christos   ARMword loaded, decoded;	/* saved pipeline state */
     94  1.1  christos   unsigned long NumScycles, NumNcycles, NumIcycles, NumCcycles, NumFcycles;	/* emulated cycles used */
     95  1.1  christos   unsigned long NumInstrs;	/* the number of instructions executed */
     96  1.1  christos   unsigned NextInstr;
     97  1.1  christos   unsigned VectorCatch;		/* caught exception mask */
     98  1.1  christos   unsigned CallDebug;		/* set to call the debugger */
     99  1.1  christos   unsigned CanWatch;		/* set by memory interface if its willing to suffer the
    100  1.1  christos 				   overhead of checking for watchpoints on each memory
    101  1.1  christos 				   access */
    102  1.1  christos   unsigned MemReadDebug, MemWriteDebug;
    103  1.1  christos   unsigned long StopHandle;
    104  1.1  christos 
    105  1.1  christos   unsigned char *MemDataPtr;	/* admin data */
    106  1.1  christos   unsigned char *MemInPtr;	/* the Data In bus */
    107  1.1  christos   unsigned char *MemOutPtr;	/* the Data Out bus (which you may not need */
    108  1.1  christos   unsigned char *MemSparePtr;	/* extra space */
    109  1.1  christos   ARMword MemSize;
    110  1.1  christos 
    111  1.1  christos   unsigned char *OSptr;		/* OS Handle */
    112  1.1  christos   char *CommandLine;		/* Command Line from ARMsd */
    113  1.1  christos 
    114  1.1  christos   ARMul_CPInits *CPInit[16];	/* coprocessor initialisers */
    115  1.1  christos   ARMul_CPExits *CPExit[16];	/* coprocessor finalisers */
    116  1.1  christos   ARMul_LDCs *LDC[16];		/* LDC instruction */
    117  1.1  christos   ARMul_STCs *STC[16];		/* STC instruction */
    118  1.1  christos   ARMul_MRCs *MRC[16];		/* MRC instruction */
    119  1.1  christos   ARMul_MCRs *MCR[16];		/* MCR instruction */
    120  1.1  christos   ARMul_CDPs *CDP[16];		/* CDP instruction */
    121  1.1  christos   ARMul_CPReads *CPRead[16];	/* Read CP register */
    122  1.1  christos   ARMul_CPWrites *CPWrite[16];	/* Write CP register */
    123  1.1  christos   unsigned char *CPData[16];	/* Coprocessor data */
    124  1.1  christos   unsigned char const *CPRegWords[16];	/* map of coprocessor register sizes */
    125  1.1  christos   unsigned long LastTime;	/* Value of last call to ARMul_Time() */
    126  1.1  christos   ARMword CP14R0_CCD;		/* used to count 64 clock cycles with CP14 R0 bit
    127  1.1  christos 				   3 set */
    128  1.1  christos 
    129  1.1  christos   unsigned EventSet;		/* the number of events in the queue */
    130  1.1  christos   unsigned long Now;		/* time to the nearest cycle */
    131  1.1  christos   struct EventNode **EventPtr;	/* the event list */
    132  1.1  christos 
    133  1.1  christos   unsigned Exception;		/* enable the next four values */
    134  1.1  christos   unsigned Debug;		/* show instructions as they are executed */
    135  1.1  christos   unsigned NresetSig;		/* reset the processor */
    136  1.1  christos   unsigned NfiqSig;
    137  1.1  christos   unsigned NirqSig;
    138  1.1  christos 
    139  1.1  christos   unsigned abortSig;
    140  1.1  christos   unsigned NtransSig;
    141  1.1  christos   unsigned bigendSig;
    142  1.1  christos   unsigned prog32Sig;
    143  1.1  christos   unsigned data32Sig;
    144  1.1  christos   unsigned lateabtSig;
    145  1.1  christos   ARMword Vector;		/* synthesize aborts in cycle modes */
    146  1.1  christos   ARMword Aborted;		/* sticky flag for aborts */
    147  1.1  christos   ARMword Reseted;		/* sticky flag for Reset */
    148  1.1  christos   ARMword Inted, LastInted;	/* sticky flags for interrupts */
    149  1.1  christos   ARMword Base;			/* extra hand for base writeback */
    150  1.1  christos   ARMword AbortAddr;		/* to keep track of Prefetch aborts */
    151  1.1  christos 
    152  1.1  christos   const struct Dbg_HostosInterface *hostif;
    153  1.1  christos 
    154  1.1  christos   unsigned is_v4;		/* Are we emulating a v4 architecture (or higher) ?  */
    155  1.1  christos   unsigned is_v5;		/* Are we emulating a v5 architecture ?  */
    156  1.1  christos   unsigned is_v5e;		/* Are we emulating a v5e architecture ?  */
    157  1.1  christos   unsigned is_v6;		/* Are we emulating a v6 architecture ?  */
    158  1.1  christos   unsigned is_XScale;		/* Are we emulating an XScale architecture ?  */
    159  1.1  christos   unsigned is_iWMMXt;		/* Are we emulating an iWMMXt co-processor ?  */
    160  1.1  christos   unsigned is_ep9312;		/* Are we emulating a Cirrus Maverick co-processor ?  */
    161  1.1  christos   unsigned verbose;		/* Print various messages like the banner */
    162  1.5  christos 
    163  1.5  christos   ARM_VFP_reg  VFP_Reg[32];     /* Advanced SIMD registers.  */
    164  1.5  christos   ARMword      FPSCR;		/* Floating Point Status Register.  */
    165  1.1  christos };
    166  1.1  christos 
    167  1.1  christos /***************************************************************************\
    168  1.1  christos *                        Properties of ARM we know about                    *
    169  1.1  christos \***************************************************************************/
    170  1.1  christos 
    171  1.1  christos /* The bitflags */
    172  1.1  christos #define ARM_Fix26_Prop   0x01
    173  1.1  christos #define ARM_Nexec_Prop   0x02
    174  1.1  christos #define ARM_Debug_Prop   0x10
    175  1.1  christos #define ARM_Isync_Prop   ARM_Debug_Prop
    176  1.1  christos #define ARM_Lock_Prop    0x20
    177  1.1  christos #define ARM_v4_Prop      0x40
    178  1.1  christos #define ARM_v5_Prop      0x80
    179  1.1  christos #define ARM_v5e_Prop     0x100
    180  1.1  christos #define ARM_XScale_Prop  0x200
    181  1.1  christos #define ARM_ep9312_Prop  0x400
    182  1.1  christos #define ARM_iWMMXt_Prop  0x800
    183  1.1  christos #define ARM_v6_Prop      0x1000
    184  1.1  christos 
    185  1.1  christos /***************************************************************************\
    186  1.1  christos *                   Macros to extract instruction fields                    *
    187  1.1  christos \***************************************************************************/
    188  1.1  christos 
    189  1.8  christos #undef BIT /* common/sim-bits.h conflict :( */
    190  1.1  christos #define BIT(n) ( (ARMword)(instr>>(n))&1)	/* bit n of instruction */
    191  1.1  christos #define BITS(m,n) ( (ARMword)(instr<<(31-(n))) >> ((31-(n))+(m)) )	/* bits m to n of instr */
    192  1.1  christos #define TOPBITS(n) (instr >> (n))	/* bits 31 to n of instr */
    193  1.1  christos 
    194  1.1  christos /***************************************************************************\
    195  1.1  christos *                      The hardware vector addresses                        *
    196  1.1  christos \***************************************************************************/
    197  1.1  christos 
    198  1.1  christos #define ARMResetV 0L
    199  1.1  christos #define ARMUndefinedInstrV 4L
    200  1.1  christos #define ARMSWIV 8L
    201  1.1  christos #define ARMPrefetchAbortV 12L
    202  1.1  christos #define ARMDataAbortV 16L
    203  1.1  christos #define ARMAddrExceptnV 20L
    204  1.1  christos #define ARMIRQV 24L
    205  1.1  christos #define ARMFIQV 28L
    206  1.1  christos #define ARMErrorV 32L		/* This is an offset, not an address ! */
    207  1.1  christos 
    208  1.1  christos #define ARMul_ResetV ARMResetV
    209  1.1  christos #define ARMul_UndefinedInstrV ARMUndefinedInstrV
    210  1.1  christos #define ARMul_SWIV ARMSWIV
    211  1.1  christos #define ARMul_PrefetchAbortV ARMPrefetchAbortV
    212  1.1  christos #define ARMul_DataAbortV ARMDataAbortV
    213  1.1  christos #define ARMul_AddrExceptnV ARMAddrExceptnV
    214  1.1  christos #define ARMul_IRQV ARMIRQV
    215  1.1  christos #define ARMul_FIQV ARMFIQV
    216  1.1  christos 
    217  1.1  christos /***************************************************************************\
    218  1.1  christos *                          Mode and Bank Constants                          *
    219  1.1  christos \***************************************************************************/
    220  1.1  christos 
    221  1.1  christos #define USER26MODE   0L
    222  1.1  christos #define FIQ26MODE    1L
    223  1.1  christos #define IRQ26MODE    2L
    224  1.1  christos #define SVC26MODE    3L
    225  1.1  christos #define USER32MODE  16L
    226  1.1  christos #define FIQ32MODE   17L
    227  1.1  christos #define IRQ32MODE   18L
    228  1.1  christos #define SVC32MODE   19L
    229  1.1  christos #define ABORT32MODE 23L
    230  1.1  christos #define UNDEF32MODE 27L
    231  1.1  christos #define SYSTEMMODE  31L
    232  1.1  christos 
    233  1.1  christos #define ARM32BITMODE (state->Mode > 3)
    234  1.1  christos #define ARM26BITMODE (state->Mode <= 3)
    235  1.1  christos #define ARMMODE (state->Mode)
    236  1.1  christos #define ARMul_MODEBITS 0x1fL
    237  1.1  christos #define ARMul_MODE32BIT ARM32BITMODE
    238  1.1  christos #define ARMul_MODE26BIT ARM26BITMODE
    239  1.1  christos 
    240  1.1  christos #define USERBANK 0
    241  1.1  christos #define FIQBANK 1
    242  1.1  christos #define IRQBANK 2
    243  1.1  christos #define SVCBANK 3
    244  1.1  christos #define ABORTBANK 4
    245  1.1  christos #define UNDEFBANK 5
    246  1.1  christos #define DUMMYBANK 6
    247  1.1  christos #define SYSTEMBANK USERBANK
    248  1.1  christos 
    249  1.1  christos #define BANK_CAN_ACCESS_SPSR(bank)  \
    250  1.1  christos   ((bank) != USERBANK && (bank) != SYSTEMBANK && (bank) != DUMMYBANK)
    251  1.1  christos 
    252  1.1  christos /***************************************************************************\
    253  1.1  christos *                  Definitons of things in the emulator                     *
    254  1.1  christos \***************************************************************************/
    255  1.1  christos 
    256  1.1  christos extern void ARMul_EmulateInit (void);
    257  1.1  christos extern ARMul_State *ARMul_NewState (void);
    258  1.1  christos extern void ARMul_Reset (ARMul_State * state);
    259  1.1  christos extern ARMword ARMul_DoProg (ARMul_State * state);
    260  1.1  christos extern ARMword ARMul_DoInstr (ARMul_State * state);
    261  1.1  christos 
    262  1.1  christos /***************************************************************************\
    263  1.1  christos *                Definitons of things for event handling                    *
    264  1.1  christos \***************************************************************************/
    265  1.1  christos 
    266  1.1  christos extern void ARMul_ScheduleEvent (ARMul_State * state, unsigned long delay,
    267  1.1  christos 				 unsigned (*func) ());
    268  1.1  christos extern void ARMul_EnvokeEvent (ARMul_State * state);
    269  1.1  christos extern unsigned long ARMul_Time (ARMul_State * state);
    270  1.1  christos 
    271  1.1  christos /***************************************************************************\
    272  1.1  christos *                          Useful support routines                          *
    273  1.1  christos \***************************************************************************/
    274  1.1  christos 
    275  1.1  christos extern ARMword ARMul_GetReg (ARMul_State * state, unsigned mode,
    276  1.1  christos 			     unsigned reg);
    277  1.1  christos extern void ARMul_SetReg (ARMul_State * state, unsigned mode, unsigned reg,
    278  1.1  christos 			  ARMword value);
    279  1.1  christos extern ARMword ARMul_GetPC (ARMul_State * state);
    280  1.1  christos extern ARMword ARMul_GetNextPC (ARMul_State * state);
    281  1.1  christos extern void ARMul_SetPC (ARMul_State * state, ARMword value);
    282  1.1  christos extern ARMword ARMul_GetR15 (ARMul_State * state);
    283  1.1  christos extern void ARMul_SetR15 (ARMul_State * state, ARMword value);
    284  1.1  christos 
    285  1.1  christos extern ARMword ARMul_GetCPSR (ARMul_State * state);
    286  1.1  christos extern void ARMul_SetCPSR (ARMul_State * state, ARMword value);
    287  1.1  christos extern ARMword ARMul_GetSPSR (ARMul_State * state, ARMword mode);
    288  1.1  christos extern void ARMul_SetSPSR (ARMul_State * state, ARMword mode, ARMword value);
    289  1.1  christos 
    290  1.1  christos /***************************************************************************\
    291  1.1  christos *                  Definitons of things to handle aborts                    *
    292  1.1  christos \***************************************************************************/
    293  1.1  christos 
    294  1.1  christos extern void ARMul_Abort (ARMul_State * state, ARMword address);
    295  1.1  christos #define ARMul_ABORTWORD 0xefffffff	/* SWI -1 */
    296  1.1  christos #define ARMul_PREFETCHABORT(address) if (state->AbortAddr == 1) \
    297  1.1  christos                                         state->AbortAddr = (address & ~3L)
    298  1.1  christos #define ARMul_DATAABORT(address) state->abortSig = HIGH ; \
    299  1.1  christos                                  state->Aborted = ARMul_DataAbortV ;
    300  1.1  christos #define ARMul_CLEARABORT state->abortSig = LOW
    301  1.1  christos 
    302  1.1  christos /***************************************************************************\
    303  1.1  christos *              Definitons of things in the memory interface                 *
    304  1.1  christos \***************************************************************************/
    305  1.1  christos 
    306  1.1  christos extern unsigned ARMul_MemoryInit (ARMul_State * state,
    307  1.1  christos 				  unsigned long initmemsize);
    308  1.1  christos extern void ARMul_MemoryExit (ARMul_State * state);
    309  1.1  christos 
    310  1.1  christos extern ARMword ARMul_LoadInstrS (ARMul_State * state, ARMword address,
    311  1.1  christos 				 ARMword isize);
    312  1.1  christos extern ARMword ARMul_LoadInstrN (ARMul_State * state, ARMword address,
    313  1.1  christos 				 ARMword isize);
    314  1.1  christos extern ARMword ARMul_ReLoadInstr (ARMul_State * state, ARMword address,
    315  1.1  christos 				  ARMword isize);
    316  1.1  christos 
    317  1.1  christos extern ARMword ARMul_LoadWordS (ARMul_State * state, ARMword address);
    318  1.1  christos extern ARMword ARMul_LoadWordN (ARMul_State * state, ARMword address);
    319  1.1  christos extern ARMword ARMul_LoadHalfWord (ARMul_State * state, ARMword address);
    320  1.1  christos extern ARMword ARMul_LoadByte (ARMul_State * state, ARMword address);
    321  1.1  christos 
    322  1.1  christos extern void ARMul_StoreWordS (ARMul_State * state, ARMword address,
    323  1.1  christos 			      ARMword data);
    324  1.1  christos extern void ARMul_StoreWordN (ARMul_State * state, ARMword address,
    325  1.1  christos 			      ARMword data);
    326  1.1  christos extern void ARMul_StoreHalfWord (ARMul_State * state, ARMword address,
    327  1.1  christos 				 ARMword data);
    328  1.1  christos extern void ARMul_StoreByte (ARMul_State * state, ARMword address,
    329  1.1  christos 			     ARMword data);
    330  1.1  christos 
    331  1.1  christos extern ARMword ARMul_SwapWord (ARMul_State * state, ARMword address,
    332  1.1  christos 			       ARMword data);
    333  1.1  christos extern ARMword ARMul_SwapByte (ARMul_State * state, ARMword address,
    334  1.1  christos 			       ARMword data);
    335  1.1  christos 
    336  1.1  christos extern void ARMul_Icycles (ARMul_State * state, unsigned number,
    337  1.1  christos 			   ARMword address);
    338  1.1  christos extern void ARMul_Ccycles (ARMul_State * state, unsigned number,
    339  1.1  christos 			   ARMword address);
    340  1.1  christos 
    341  1.1  christos extern ARMword ARMul_ReadWord (ARMul_State * state, ARMword address);
    342  1.1  christos extern ARMword ARMul_ReadByte (ARMul_State * state, ARMword address);
    343  1.1  christos extern ARMword ARMul_SafeReadByte (ARMul_State * state, ARMword address);
    344  1.1  christos extern void ARMul_WriteWord (ARMul_State * state, ARMword address,
    345  1.1  christos 			     ARMword data);
    346  1.1  christos extern void ARMul_WriteByte (ARMul_State * state, ARMword address,
    347  1.1  christos 			     ARMword data);
    348  1.1  christos extern void ARMul_SafeWriteByte (ARMul_State * state, ARMword address,
    349  1.1  christos 			     ARMword data);
    350  1.1  christos 
    351  1.1  christos extern ARMword ARMul_MemAccess (ARMul_State * state, ARMword, ARMword,
    352  1.1  christos 				ARMword, ARMword, ARMword, ARMword, ARMword,
    353  1.1  christos 				ARMword, ARMword, ARMword);
    354  1.1  christos 
    355  1.1  christos /***************************************************************************\
    356  1.1  christos *            Definitons of things in the co-processor interface             *
    357  1.1  christos \***************************************************************************/
    358  1.1  christos 
    359  1.1  christos #define ARMul_FIRST 0
    360  1.1  christos #define ARMul_TRANSFER 1
    361  1.1  christos #define ARMul_BUSY 2
    362  1.1  christos #define ARMul_DATA 3
    363  1.1  christos #define ARMul_INTERRUPT 4
    364  1.1  christos #define ARMul_DONE 0
    365  1.1  christos #define ARMul_CANT 1
    366  1.1  christos #define ARMul_INC 3
    367  1.1  christos 
    368  1.1  christos #define ARMul_CP13_R0_FIQ	0x1
    369  1.1  christos #define ARMul_CP13_R0_IRQ	0x2
    370  1.1  christos #define ARMul_CP13_R8_PMUS	0x1
    371  1.1  christos 
    372  1.1  christos #define ARMul_CP14_R0_ENABLE	0x0001
    373  1.1  christos #define ARMul_CP14_R0_CLKRST	0x0004
    374  1.1  christos #define ARMul_CP14_R0_CCD	0x0008
    375  1.1  christos #define ARMul_CP14_R0_INTEN0	0x0010
    376  1.1  christos #define ARMul_CP14_R0_INTEN1	0x0020
    377  1.1  christos #define ARMul_CP14_R0_INTEN2	0x0040
    378  1.1  christos #define ARMul_CP14_R0_FLAG0	0x0100
    379  1.1  christos #define ARMul_CP14_R0_FLAG1	0x0200
    380  1.1  christos #define ARMul_CP14_R0_FLAG2	0x0400
    381  1.1  christos #define ARMul_CP14_R10_MOE_IB	0x0004
    382  1.1  christos #define ARMul_CP14_R10_MOE_DB	0x0008
    383  1.1  christos #define ARMul_CP14_R10_MOE_BT	0x000c
    384  1.1  christos #define ARMul_CP15_R1_ENDIAN	0x0080
    385  1.1  christos #define ARMul_CP15_R1_ALIGN	0x0002
    386  1.1  christos #define ARMul_CP15_R5_X		0x0400
    387  1.1  christos #define ARMul_CP15_R5_ST_ALIGN	0x0001
    388  1.1  christos #define ARMul_CP15_R5_IMPRE	0x0406
    389  1.1  christos #define ARMul_CP15_R5_MMU_EXCPT	0x0400
    390  1.1  christos #define ARMul_CP15_DBCON_M	0x0100
    391  1.1  christos #define ARMul_CP15_DBCON_E1	0x000c
    392  1.1  christos #define ARMul_CP15_DBCON_E0	0x0003
    393  1.1  christos 
    394  1.1  christos extern unsigned ARMul_CoProInit (ARMul_State * state);
    395  1.1  christos extern void ARMul_CoProExit (ARMul_State * state);
    396  1.1  christos extern void ARMul_CoProAttach (ARMul_State * state, unsigned number,
    397  1.1  christos 			       ARMul_CPInits * init, ARMul_CPExits * exit,
    398  1.1  christos 			       ARMul_LDCs * ldc, ARMul_STCs * stc,
    399  1.1  christos 			       ARMul_MRCs * mrc, ARMul_MCRs * mcr,
    400  1.1  christos 			       ARMul_CDPs * cdp,
    401  1.1  christos 			       ARMul_CPReads * read, ARMul_CPWrites * write);
    402  1.1  christos extern void ARMul_CoProDetach (ARMul_State * state, unsigned number);
    403  1.1  christos extern void XScale_check_memacc (ARMul_State * state, ARMword * address,
    404  1.1  christos 				 int store);
    405  1.1  christos extern void XScale_set_fsr_far (ARMul_State * state, ARMword fsr, ARMword far);
    406  1.1  christos extern int XScale_debug_moe (ARMul_State * state, int moe);
    407  1.1  christos 
    408  1.1  christos /***************************************************************************\
    409  1.1  christos *               Definitons of things in the host environment                *
    410  1.1  christos \***************************************************************************/
    411  1.1  christos 
    412  1.1  christos extern unsigned ARMul_OSInit (ARMul_State * state);
    413  1.1  christos extern unsigned ARMul_OSHandleSWI (ARMul_State * state, ARMword number);
    414  1.1  christos 
    415  1.1  christos /***************************************************************************\
    416  1.1  christos *                            Host-dependent stuff                           *
    417  1.1  christos \***************************************************************************/
    418  1.1  christos 
    419  1.1  christos extern void ARMul_UndefInstr      (ARMul_State *, ARMword);
    420  1.1  christos extern void ARMul_FixCPSR         (ARMul_State *, ARMword, ARMword);
    421  1.1  christos extern void ARMul_FixSPSR         (ARMul_State *, ARMword, ARMword);
    422  1.7  christos extern void ARMul_ConsolePrint    (ARMul_State *, const char *, ...)
    423  1.7  christos     ATTRIBUTE_PRINTF (2, 3);
    424  1.1  christos extern void ARMul_SelectProcessor (ARMul_State *, unsigned);
    425  1.8  christos 
    426  1.8  christos #endif
    427