X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=sim%2Farm%2Farmdefs.h;h=50a0619cccc3e93f0ee365f8cd9252dcd28d35a7;hb=00923338dec84505addaf9cdeca2e9c844757824;hp=72dae0a6dd14c8d1d35e8e2c45f37767e7b9bc8b;hpb=1e6b544a9787ed223fb9c9a462facc62c23d517b;p=deliverable%2Fbinutils-gdb.git diff --git a/sim/arm/armdefs.h b/sim/arm/armdefs.h index 72dae0a6dd..50a0619ccc 100644 --- a/sim/arm/armdefs.h +++ b/sim/arm/armdefs.h @@ -3,7 +3,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -12,9 +12,9 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with this program; if not, see . */ +#include "config.h" #include #include @@ -29,7 +29,18 @@ typedef char *VoidStar; #endif -typedef unsigned long ARMword; /* must be 32 bits wide */ +#ifdef HAVE_STDINT_H +#include +typedef uint32_t ARMword; +typedef int32_t ARMsword; +typedef uint64_t ARMdword; +typedef int64_t ARMsdword; +#else +typedef unsigned int ARMword; /* must be 32 bits wide */ +typedef signed int ARMsword; +typedef unsigned long long ARMdword; /* Must be at least 64 bits wide. */ +typedef signed long long ARMsdword; +#endif typedef struct ARMul_State ARMul_State; typedef unsigned ARMul_CPInits (ARMul_State * state); @@ -56,9 +67,13 @@ struct ARMul_State unsigned ErrorCode; /* type of illegal instruction */ ARMword Reg[16]; /* the current register file */ ARMword RegBank[7][16]; /* all the registers */ + /* 40 bit accumulator. We always keep this 64 bits wide, + and move only 40 bits out of it in an MRA insn. */ + ARMdword Accumulator; ARMword Cpsr; /* the current psr */ ARMword Spsr[7]; /* the exception psr's */ ARMword NFlag, ZFlag, CFlag, VFlag, IFFlags; /* dummy flags for speed */ + ARMword SFlag; #ifdef MODET ARMword TFlag; /* Thumb state */ #endif @@ -97,6 +112,9 @@ struct ARMul_State ARMul_CPWrites *CPWrite[16]; /* Write CP register */ unsigned char *CPData[16]; /* Coprocessor data */ unsigned char const *CPRegWords[16]; /* map of coprocessor register sizes */ + unsigned long LastTime; /* Value of last call to ARMul_Time() */ + ARMword CP14R0_CCD; /* used to count 64 clock cycles with CP14 R0 bit + 3 set */ unsigned EventSet; /* the number of events in the queue */ unsigned long Now; /* time to the nearest cycle */ @@ -123,9 +141,14 @@ struct ARMul_State const struct Dbg_HostosInterface *hostif; - unsigned is_StrongARM; /* Are we emulating a StrongARM? */ - - int verbose; /* non-zero means print various messages like the banner */ + unsigned is_v4; /* Are we emulating a v4 architecture (or higher) ? */ + unsigned is_v5; /* Are we emulating a v5 architecture ? */ + unsigned is_v5e; /* Are we emulating a v5e architecture ? */ + unsigned is_v6; /* Are we emulating a v6 architecture ? */ + unsigned is_XScale; /* Are we emulating an XScale architecture ? */ + unsigned is_iWMMXt; /* Are we emulating an iWMMXt co-processor ? */ + unsigned is_ep9312; /* Are we emulating a Cirrus Maverick co-processor ? */ + unsigned verbose; /* Print various messages like the banner */ }; #define ResetPin NresetSig @@ -139,7 +162,7 @@ struct ARMul_State #define LateAbortPin lateabtSig /***************************************************************************\ -* Types of ARM we know about * +* Properties of ARM we know about * \***************************************************************************/ /* The bitflags */ @@ -148,26 +171,13 @@ struct ARMul_State #define ARM_Debug_Prop 0x10 #define ARM_Isync_Prop ARM_Debug_Prop #define ARM_Lock_Prop 0x20 -#define ARM_Strong_Prop 0x40 - -/* ARM2 family */ -#define ARM2 (ARM_Fix26_Prop) -#define ARM2as ARM2 -#define ARM61 ARM2 -#define ARM3 ARM2 - -#ifdef ARM60 /* previous definition in armopts.h */ -#undef ARM60 -#endif - -/* ARM6 family */ -#define ARM6 (ARM_Lock_Prop) -#define ARM60 ARM6 -#define ARM600 ARM6 -#define ARM610 ARM6 -#define ARM620 ARM6 - -#define STRONGARM (ARM_Strong_Prop) +#define ARM_v4_Prop 0x40 +#define ARM_v5_Prop 0x80 +#define ARM_v5e_Prop 0x100 +#define ARM_XScale_Prop 0x200 +#define ARM_ep9312_Prop 0x400 +#define ARM_iWMMXt_Prop 0x800 +#define ARM_v6_Prop 0x1000 /***************************************************************************\ * Macros to extract instruction fields * @@ -326,10 +336,13 @@ extern void ARMul_Ccycles (ARMul_State * state, unsigned number, extern ARMword ARMul_ReadWord (ARMul_State * state, ARMword address); extern ARMword ARMul_ReadByte (ARMul_State * state, ARMword address); +extern ARMword ARMul_SafeReadByte (ARMul_State * state, ARMword address); extern void ARMul_WriteWord (ARMul_State * state, ARMword address, ARMword data); extern void ARMul_WriteByte (ARMul_State * state, ARMword address, ARMword data); +extern void ARMul_SafeWriteByte (ARMul_State * state, ARMword address, + ARMword data); extern ARMword ARMul_MemAccess (ARMul_State * state, ARMword, ARMword, ARMword, ARMword, ARMword, ARMword, ARMword, @@ -348,6 +361,32 @@ extern ARMword ARMul_MemAccess (ARMul_State * state, ARMword, ARMword, #define ARMul_CANT 1 #define ARMul_INC 3 +#define ARMul_CP13_R0_FIQ 0x1 +#define ARMul_CP13_R0_IRQ 0x2 +#define ARMul_CP13_R8_PMUS 0x1 + +#define ARMul_CP14_R0_ENABLE 0x0001 +#define ARMul_CP14_R0_CLKRST 0x0004 +#define ARMul_CP14_R0_CCD 0x0008 +#define ARMul_CP14_R0_INTEN0 0x0010 +#define ARMul_CP14_R0_INTEN1 0x0020 +#define ARMul_CP14_R0_INTEN2 0x0040 +#define ARMul_CP14_R0_FLAG0 0x0100 +#define ARMul_CP14_R0_FLAG1 0x0200 +#define ARMul_CP14_R0_FLAG2 0x0400 +#define ARMul_CP14_R10_MOE_IB 0x0004 +#define ARMul_CP14_R10_MOE_DB 0x0008 +#define ARMul_CP14_R10_MOE_BT 0x000c +#define ARMul_CP15_R1_ENDIAN 0x0080 +#define ARMul_CP15_R1_ALIGN 0x0002 +#define ARMul_CP15_R5_X 0x0400 +#define ARMul_CP15_R5_ST_ALIGN 0x0001 +#define ARMul_CP15_R5_IMPRE 0x0406 +#define ARMul_CP15_R5_MMU_EXCPT 0x0400 +#define ARMul_CP15_DBCON_M 0x0100 +#define ARMul_CP15_DBCON_E1 0x000c +#define ARMul_CP15_DBCON_E0 0x0003 + extern unsigned ARMul_CoProInit (ARMul_State * state); extern void ARMul_CoProExit (ARMul_State * state); extern void ARMul_CoProAttach (ARMul_State * state, unsigned number, @@ -357,6 +396,10 @@ extern void ARMul_CoProAttach (ARMul_State * state, unsigned number, ARMul_CDPs * cdp, ARMul_CPReads * read, ARMul_CPWrites * write); extern void ARMul_CoProDetach (ARMul_State * state, unsigned number); +extern void XScale_check_memacc (ARMul_State * state, ARMword * address, + int store); +extern void XScale_set_fsr_far (ARMul_State * state, ARMword fsr, ARMword far); +extern int XScale_debug_moe (ARMul_State * state, int moe); /***************************************************************************\ * Definitons of things in the host environment *