⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 armemu.h

📁 skyeye的开源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
	{						\	  /* A standard PC inc and an N cycle.  */	\	  state->Reg[15] += isize;			\	  state->NextInstr |= 3;			\	}						\    }							\  while (0)#define INCPC 			\  do				\    {				\      /* A standard PC inc.  */	\      state->Reg[15] += isize;	\      state->NextInstr |= 2;	\    }				\  while (0)#define FLUSHPIPE state->NextInstr |= PRIMEPIPE/* Cycle based emulation.  */#define OUTPUTCP(i,a,b)#define NCYCLE#define SCYCLE#define ICYCLE#define CCYCLE#define NEXTCYCLE(c)/* Macros to extract parts of instructions.  */#define DESTReg (BITS (12, 15))#define LHSReg  (BITS (16, 19))#define RHSReg  (BITS ( 0,  3))#define DEST (state->Reg[DESTReg])#ifdef MODE32#ifdef MODET#define LHS ((LHSReg == 15) ? (state->Reg[15] & 0xFFFFFFFC): (state->Reg[LHSReg]))#else#define LHS (state->Reg[LHSReg])#endif#else#define LHS ((LHSReg == 15) ? R15PC : (state->Reg[LHSReg]))#endif#define MULDESTReg (BITS (16, 19))#define MULLHSReg  (BITS ( 0,  3))#define MULRHSReg  (BITS ( 8, 11))#define MULACCReg  (BITS (12, 15))#define DPImmRHS (ARMul_ImmedTable[BITS(0, 11)])#define DPSImmRHS temp = BITS(0,11) ; \                  rhs = ARMul_ImmedTable[temp] ; \                  if (temp > 255) /* There was a shift.  */ \                     ASSIGNC (rhs >> 31) ;#ifdef MODE32#define DPRegRHS  ((BITS (4,11) == 0) ? state->Reg[RHSReg] \                                      : GetDPRegRHS (state, instr))#define DPSRegRHS ((BITS (4,11) == 0) ? state->Reg[RHSReg] \                                      : GetDPSRegRHS (state, instr))#else#define DPRegRHS  ((BITS (0, 11) < 15) ? state->Reg[RHSReg] \                                       : GetDPRegRHS (state, instr))#define DPSRegRHS ((BITS (0, 11) < 15) ? state->Reg[RHSReg] \                                       : GetDPSRegRHS (state, instr))#endif#define LSBase state->Reg[LHSReg]#define LSImmRHS (BITS(0,11))#ifdef MODE32#define LSRegRHS ((BITS (4, 11) == 0) ? state->Reg[RHSReg] \                                      : GetLSRegRHS (state, instr))#else#define LSRegRHS ((BITS (0, 11) < 15) ? state->Reg[RHSReg] \                                      : GetLSRegRHS (state, instr))#endif#define LSMNumRegs ((ARMword) ARMul_BitList[BITS (0, 7)] + \                    (ARMword) ARMul_BitList[BITS (8, 15)] )#define LSMBaseFirst ((LHSReg == 0 && BIT (0)) || \                      (BIT (LHSReg) && BITS (0, LHSReg - 1) == 0))#define SWAPSRC (state->Reg[RHSReg])#define LSCOff (BITS (0, 7) << 2)#define CPNum   BITS (8, 11)/* Determine if access to coprocessor CP is permitted.   The XScale has a register in CP15 which controls access to CP0 - CP13.  *///chy 2003-09-03, new CP_ACCESS_ALLOWED/*#define CP_ACCESS_ALLOWED(STATE, CP)			\    (   ((CP) >= 14)					\     || (! (STATE)->is_XScale)				\     || (read_cp15_reg (15, 0, 1) & (1 << (CP))))*/#define CP_ACCESS_ALLOWED(STATE, CP)			\    (   ((CP) >= 14)					\     || (! (STATE)->is_XScale)				\     || (xscale_cp15_cp_access_allowed(STATE,15,CP)))/* Macro to rotate n right by b bits.  */#define ROTATER(n, b) (((n) >> (b)) | ((n) << (32 - (b))))/* Macros to store results of instructions.  */#define WRITEDEST(d)				\  do						\    {						\      if (DESTReg == 15) 			\	WriteR15 (state, d); 			\      else 					\	DEST = d;				\    }						\  while (0)#define WRITESDEST(d)				\  do						\    {						\      if (DESTReg == 15)			\	WriteSR15 (state, d);			\      else					\	{					\	  DEST = d;				\	  ARMul_NegZero (state, d);		\	}					\    }						\  while (0)#define WRITEDESTB(d)				\  do						\    {						\      if (DESTReg == 15)			\	WriteR15Branch (state, d);		\      else					\	DEST = d;				\    }						\  while (0)#define BYTETOBUS(data) ((data & 0xff) | \                        ((data & 0xff) << 8) | \                        ((data & 0xff) << 16) | \                        ((data & 0xff) << 24))#define BUSTOBYTE(address, data)				\  do								\    {								\      if (state->bigendSig) 					\	temp = (data >> (((address ^ 3) & 3) << 3)) & 0xff;	\      else							\	temp = (data >> ((address & 3) << 3)) & 0xff;		\    }								\  while (0)#define LOADMULT(instr,   address, wb)  LoadMult   (state, instr, address, wb)#define LOADSMULT(instr,  address, wb)  LoadSMult  (state, instr, address, wb)#define STOREMULT(instr,  address, wb)  StoreMult  (state, instr, address, wb)#define STORESMULT(instr, address, wb)  StoreSMult (state, instr, address, wb)#define POSBRANCH ((instr & 0x7fffff) << 2)#define NEGBRANCH ((0xff000000 |(instr & 0xffffff)) << 2)/* Values for Emulate.  */#define STOP            0	/* stop */#define CHANGEMODE      1	/* change mode */#define ONCE            2	/* execute just one interation */#define RUN             3	/* continuous execution *//* Stuff that is shared across modes.  */extern unsigned ARMul_MultTable[];	/* Number of I cycles for a mult.  */extern ARMword ARMul_ImmedTable[];	/* Immediate DP LHS values.  */extern char ARMul_BitList[];	/* Number of bits in a byte table.  */#define EVENTLISTSIZE 1024L/* Thumb support.  */typedef enum{	t_undefined,		/* Undefined Thumb instruction.  */	t_decoded,		/* Instruction decoded to ARM equivalent.  */	t_branch		/* Thumb branch (already processed).  */}tdstate;/* Macros to scrutinize instructions.  */#define UNDEF_Test#define UNDEF_Shift#define UNDEF_MSRPC#define UNDEF_MRSPC#define UNDEF_MULPCDest#define UNDEF_MULDestEQOp1#define UNDEF_LSRBPC#define UNDEF_LSRBaseEQOffWb#define UNDEF_LSRBaseEQDestWb#define UNDEF_LSRPCBaseWb#define UNDEF_LSRPCOffWb#define UNDEF_LSMNoRegs#define UNDEF_LSMPCBase#define UNDEF_LSMUserBankWb#define UNDEF_LSMBaseInListWb#define UNDEF_SWPPC#define UNDEF_CoProHS#define UNDEF_MCRPC#define UNDEF_LSCPCBaseWb#define UNDEF_UndefNotBounced#define UNDEF_ShortInt#define UNDEF_IllegalMode#define UNDEF_Prog32SigChange#define UNDEF_Data32SigChange/* Prototypes for exported functions.  */extern unsigned ARMul_NthReg (ARMword, unsigned);extern int AddOverflow (ARMword, ARMword, ARMword);extern int SubOverflow (ARMword, ARMword, ARMword);extern ARMword ARMul_Emulate26 (ARMul_State *);extern ARMword ARMul_Emulate32 (ARMul_State *);extern unsigned IntPending (ARMul_State *);extern void ARMul_CPSRAltered (ARMul_State *);extern void ARMul_R15Altered (ARMul_State *);extern ARMword ARMul_GetPC (ARMul_State *);extern ARMword ARMul_GetNextPC (ARMul_State *);extern ARMword ARMul_GetR15 (ARMul_State *);extern ARMword ARMul_GetCPSR (ARMul_State *);extern void ARMul_EnvokeEvent (ARMul_State *);extern unsigned int ARMul_Time (ARMul_State *);extern void ARMul_NegZero (ARMul_State *, ARMword);extern void ARMul_SetPC (ARMul_State *, ARMword);extern void ARMul_SetR15 (ARMul_State *, ARMword);extern void ARMul_SetCPSR (ARMul_State *, ARMword);extern ARMword ARMul_GetSPSR (ARMul_State *, ARMword);extern void ARMul_Abort26 (ARMul_State *, ARMword);extern void ARMul_Abort32 (ARMul_State *, ARMword);extern ARMword ARMul_MRC (ARMul_State *, ARMword);extern void ARMul_CDP (ARMul_State *, ARMword);extern void ARMul_LDC (ARMul_State *, ARMword, ARMword);extern void ARMul_STC (ARMul_State *, ARMword, ARMword);extern void ARMul_MCR (ARMul_State *, ARMword, ARMword);extern void ARMul_SetSPSR (ARMul_State *, ARMword, ARMword);extern ARMword ARMul_SwitchMode (ARMul_State *, ARMword, ARMword);extern ARMword ARMul_Align (ARMul_State *, ARMword, ARMword);extern ARMword ARMul_SwitchMode (ARMul_State *, ARMword, ARMword);extern void ARMul_MSRCpsr (ARMul_State *, ARMword, ARMword);extern void ARMul_SubOverflow (ARMul_State *, ARMword, ARMword, ARMword);extern void ARMul_AddOverflow (ARMul_State *, ARMword, ARMword, ARMword);extern void ARMul_SubCarry (ARMul_State *, ARMword, ARMword, ARMword);extern void ARMul_AddCarry (ARMul_State *, ARMword, ARMword, ARMword);extern tdstate ARMul_ThumbDecode (ARMul_State *, ARMword, ARMword, ARMword *);extern ARMword ARMul_GetReg (ARMul_State *, unsigned, unsigned);extern void ARMul_SetReg (ARMul_State *, unsigned, unsigned, ARMword);extern void ARMul_ScheduleEvent (ARMul_State *, unsigned int,				 unsigned (*)(ARMul_State *));/* Coprocessor support functions.  */extern unsigned ARMul_CoProInit (ARMul_State *);extern void ARMul_CoProExit (ARMul_State *);extern void ARMul_CoProAttach (ARMul_State *, unsigned, ARMul_CPInits *,			       ARMul_CPExits *, ARMul_LDCs *, ARMul_STCs *,			       ARMul_MRCs *, ARMul_MCRs *, ARMul_CDPs *,			       ARMul_CPReads *, ARMul_CPWrites *);extern void ARMul_CoProDetach (ARMul_State *, unsigned);extern ARMword read_cp15_reg (unsigned, unsigned, unsigned);extern unsigned DSPLDC4 (ARMul_State *, unsigned, ARMword, ARMword);extern unsigned DSPMCR4 (ARMul_State *, unsigned, ARMword, ARMword);extern unsigned DSPMRC4 (ARMul_State *, unsigned, ARMword, ARMword *);extern unsigned DSPSTC4 (ARMul_State *, unsigned, ARMword, ARMword *);extern unsigned DSPCDP4 (ARMul_State *, unsigned, ARMword);extern unsigned DSPMCR5 (ARMul_State *, unsigned, ARMword, ARMword);extern unsigned DSPMRC5 (ARMul_State *, unsigned, ARMword, ARMword *);extern unsigned DSPLDC5 (ARMul_State *, unsigned, ARMword, ARMword);extern unsigned DSPSTC5 (ARMul_State *, unsigned, ARMword, ARMword *);extern unsigned DSPCDP5 (ARMul_State *, unsigned, ARMword);extern unsigned DSPMCR6 (ARMul_State *, unsigned, ARMword, ARMword);extern unsigned DSPMRC6 (ARMul_State *, unsigned, ARMword, ARMword *);extern unsigned DSPCDP6 (ARMul_State *, unsigned, ARMword);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -