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

📄 tm-mips.h

📁 arm-linux-gcc编译器
💻 H
📖 第 1 页 / 共 2 页
字号:
        char __temp[4];							\	memcpy (__temp, ((char *)(buffer))+4, 4);			\	memcpy (((char *)(buffer))+4, (buffer), 4); 			\	memcpy (((char *)(buffer)), __temp, 4); }} while (0)#define REGISTER_CONVERT_FROM_TYPE(n, type, buffer)			\  do {if (TARGET_BYTE_ORDER == BIG_ENDIAN				\	  && REGISTER_RAW_SIZE (n) == 4					\	  && (n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32			\	  && TYPE_CODE(type) == TYPE_CODE_FLT				\	  && TYPE_LENGTH(type) == 8) {					\        char __temp[4];							\	memcpy (__temp, ((char *)(buffer))+4, 4);			\	memcpy (((char *)(buffer))+4, (buffer), 4); 			\	memcpy (((char *)(buffer)), __temp, 4); }} while (0)/* Store the address of the place in which to copy the structure the   subroutine will return.  Handled by mips_push_arguments.  */#define STORE_STRUCT_RETURN(addr, sp)/**//* Extract from an array REGBUF containing the (raw) register state   a function return value of type TYPE, and copy that, in virtual format,   into VALBUF.  XXX floats */#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \  mips_extract_return_value(TYPE, REGBUF, VALBUF)extern voidmips_extract_return_value PARAMS ((struct type *, char[], char *));/* Write into appropriate registers a function return value   of type TYPE, given in virtual format.  */#define STORE_RETURN_VALUE(TYPE,VALBUF) \  mips_store_return_value(TYPE, VALBUF)extern void mips_store_return_value PARAMS ((struct type *, char *));/* Extract from an array REGBUF containing the (raw) register state   the address in which a function should return its structure value,   as a CORE_ADDR (or an expression that can be used as one).  *//* The address is passed in a0 upon entry to the function, but when   the function exits, the compiler has copied the value to v0.  This   convention is specified by the System V ABI, so I think we can rely   on it.  */#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \  (extract_address (REGBUF + REGISTER_BYTE (V0_REGNUM), \		    REGISTER_RAW_SIZE (V0_REGNUM)))extern use_struct_convention_fn mips_use_struct_convention;#define USE_STRUCT_CONVENTION(gcc_p, type) mips_use_struct_convention (gcc_p, type)/* Describe the pointer in each stack frame to the previous stack frame   (its caller).  *//* FRAME_CHAIN takes a frame's nominal address   and produces the frame's chain-pointer. */#define FRAME_CHAIN(thisframe) (CORE_ADDR) mips_frame_chain (thisframe)extern CORE_ADDR mips_frame_chain PARAMS ((struct frame_info *));/* Define other aspects of the stack frame.  *//* A macro that tells us whether the function invocation represented   by FI does not have a frame on the stack associated with it.  If it   does not, FRAMELESS is set to 1, else 0.  *//* We handle this differently for mips, and maybe we should not */#define FRAMELESS_FUNCTION_INVOCATION(FI)  (0)/* Saved Pc.  */#define FRAME_SAVED_PC(FRAME)	(mips_frame_saved_pc(FRAME))extern CORE_ADDR mips_frame_saved_pc PARAMS ((struct frame_info *));#define FRAME_ARGS_ADDRESS(fi)	(fi)->frame#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame/* Return number of args passed to a frame.   Can return -1, meaning no way to tell.  */#define FRAME_NUM_ARGS(fi)	(mips_frame_num_args(fi))extern int mips_frame_num_args PARAMS ((struct frame_info *));/* Return number of bytes at start of arglist that are not really args.  */#define FRAME_ARGS_SKIP 0/* Put here the code to store, into a struct frame_saved_regs,   the addresses of the saved registers of frame described by FRAME_INFO.   This includes special registers such as pc and fp saved in special   ways in the stack frame.  sp is even more special:   the address we return for it IS the sp for the next frame.  */#define FRAME_INIT_SAVED_REGS(frame_info) \  do { \    if ((frame_info)->saved_regs == NULL) \      mips_find_saved_regs (frame_info); \    (frame_info)->saved_regs[SP_REGNUM] = (frame_info)->frame; \  } while (0)extern void mips_find_saved_regs PARAMS ((struct frame_info *));/* Things needed for making the inferior call functions.  *//* Stack must be aligned on 32-bit boundaries when synthesizing   function calls.  We don't need STACK_ALIGN, PUSH_ARGUMENTS will   handle it. */extern CORE_ADDR mips_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \  (mips_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))extern CORE_ADDR mips_push_return_address PARAMS ((CORE_ADDR pc, CORE_ADDR sp));#define PUSH_RETURN_ADDRESS(PC, SP) (mips_push_return_address ((PC), (SP)))/* Push an empty stack frame, to record the current PC, etc.  */#define PUSH_DUMMY_FRAME 	mips_push_dummy_frame()extern void mips_push_dummy_frame PARAMS ((void));/* Discard from the stack the innermost frame, restoring all registers.  */#define POP_FRAME		mips_pop_frame()extern void mips_pop_frame PARAMS ((void));#if !GDB_MULTI_ARCH#define CALL_DUMMY { 0 }#endif#define CALL_DUMMY_START_OFFSET (0)#define CALL_DUMMY_BREAKPOINT_OFFSET (0)/* On Irix, $t9 ($25) contains the address of the callee (used for PIC).   It doesn't hurt to do this on other systems; $t9 will be ignored.  */#define FIX_CALL_DUMMY(dummyname, start_sp, fun, nargs, args, rettype, gcc_p) \    write_register(T9_REGNUM, fun)#define CALL_DUMMY_LOCATION AT_ENTRY_POINT#define CALL_DUMMY_ADDRESS() (mips_call_dummy_address ())extern CORE_ADDR mips_call_dummy_address PARAMS ((void));/* There's a mess in stack frame creation.  See comments in blockframe.c   near reference to INIT_FRAME_PC_FIRST.  */#define	INIT_FRAME_PC(fromleaf, prev)	/* nada */#define INIT_FRAME_PC_FIRST(fromleaf, prev) \   mips_init_frame_pc_first(fromleaf, prev)extern void mips_init_frame_pc_first PARAMS ((int, struct frame_info *));/* Special symbol found in blocks associated with routines.  We can hang   mips_extra_func_info_t's off of this.  */#define MIPS_EFI_SYMBOL_NAME "__GDB_EFI_INFO__"extern void ecoff_relocate_efi PARAMS ((struct symbol *, CORE_ADDR));/* Specific information about a procedure.   This overlays the MIPS's PDR records,    mipsread.c (ab)uses this to save memory */typedef struct mips_extra_func_info  {    long numargs;		/* number of args to procedure (was iopt) */    bfd_vma high_addr;		/* upper address bound */    long frame_adjust;		/* offset of FP from SP (used on MIPS16) */    PDR pdr;			/* Procedure descriptor record */  } *mips_extra_func_info_t;extern void mips_init_extra_frame_info PARAMS ((int fromleaf, struct frame_info *));#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \  mips_init_extra_frame_info(fromleaf, fci)extern void mips_print_extra_frame_info PARAMS ((struct frame_info * frame));#define	PRINT_EXTRA_FRAME_INFO(fi) \  mips_print_extra_frame_info (fi)/* It takes two values to specify a frame on the MIPS.   In fact, the *PC* is the primary value that sets up a frame.  The   PC is looked up to see what function it's in; symbol information   from that function tells us which register is the frame pointer   base, and what offset from there is the "virtual frame pointer".   (This is usually an offset from SP.)  On most non-MIPS machines,   the primary value is the SP, and the PC, if needed, disambiguates   multiple functions with the same SP.  But on the MIPS we can't do   that since the PC is not stored in the same part of the frame every   time.  This does not seem to be a very clever way to set up frames,   but there is nothing we can do about that).  */#define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv)extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *));/* Convert a dbx stab register number (from `r' declaration) to a gdb REGNUM */#define STAB_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-38)/* Convert a ecoff register number to a gdb REGNUM */#define ECOFF_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-32)#if !GDB_MULTI_ARCH/* If the current gcc for for this target does not produce correct debugging   information for float parameters, both prototyped and unprototyped, then   define this macro.  This forces gdb to  always assume that floats are   passed as doubles and then converted in the callee.   For the mips chip, it appears that the debug info marks the parameters as   floats regardless of whether the function is prototyped, but the actual   values are passed as doubles for the non-prototyped case and floats for   the prototyped case.  Thus we choose to make the non-prototyped case work   for C and break the prototyped case, since the non-prototyped case is   probably much more common.  (FIXME). */#define COERCE_FLOAT_TO_DOUBLE(formal, actual) (current_language -> la_language == language_c)#endif/* Select the default mips disassembler */#define TM_PRINT_INSN_MACH 0/* These are defined in mdebugread.c and are used in mips-tdep.c  */extern CORE_ADDR sigtramp_address, sigtramp_end;extern void fixup_sigtramp PARAMS ((void));/* Defined in mips-tdep.c and used in remote-mips.c */extern char *mips_read_processor_type PARAMS ((void));/* Functions for dealing with MIPS16 call and return stubs.  */#define IN_SOLIB_CALL_TRAMPOLINE(pc, name)	mips_in_call_stub (pc, name)#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name)	mips_in_return_stub (pc, name)#define SKIP_TRAMPOLINE_CODE(pc)		mips_skip_stub (pc)#define IGNORE_HELPER_CALL(pc)			mips_ignore_helper (pc)extern int mips_in_call_stub PARAMS ((CORE_ADDR pc, char *name));extern int mips_in_return_stub PARAMS ((CORE_ADDR pc, char *name));extern CORE_ADDR mips_skip_stub PARAMS ((CORE_ADDR pc));extern int mips_ignore_helper PARAMS ((CORE_ADDR pc));#ifndef TARGET_MIPS#define TARGET_MIPS#endif/* Definitions and declarations used by mips-tdep.c and remote-mips.c  */#define MIPS_INSTLEN 4		/* Length of an instruction */#define MIPS16_INSTLEN 2	/* Length of an instruction on MIPS16 */#define MIPS_NUMREGS 32		/* Number of integer or float registers */typedef unsigned long t_inst;	/* Integer big enough to hold an instruction *//* MIPS16 function addresses are odd (bit 0 is set).  Here are some   macros to test, set, or clear bit 0 of addresses.  */#define IS_MIPS16_ADDR(addr)	 ((addr) & 1)#define MAKE_MIPS16_ADDR(addr)	 ((addr) | 1)#define UNMAKE_MIPS16_ADDR(addr) ((addr) & ~1)#endif /* TM_MIPS_H *//* Macros for setting and testing a bit in a minimal symbol that   marks it as 16-bit function.  The MSB of the minimal symbol's   "info" field is used for this purpose. This field is already   being used to store the symbol size, so the assumption is   that the symbol size cannot exceed 2^31.   ELF_MAKE_MSYMBOL_SPECIAL   tests whether an ELF symbol is "special", i.e. refers   to a 16-bit function, and sets a "special" bit in a    minimal symbol to mark it as a 16-bit function   MSYMBOL_IS_SPECIAL   tests the "special" bit in a minimal symbol   MSYMBOL_SIZE         returns the size of the minimal symbol, i.e.   the "info" field with the "special" bit masked out */#define ELF_MAKE_MSYMBOL_SPECIAL(sym,msym) \ { \  if (((elf_symbol_type *)(sym))->internal_elf_sym.st_other == STO_MIPS16) { \    MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) | 0x80000000); \    SYMBOL_VALUE_ADDRESS (msym) |= 1; \  } \ }#define MSYMBOL_IS_SPECIAL(msym) \  (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0)#define MSYMBOL_SIZE(msym) \  ((long) MSYMBOL_INFO (msym) & 0x7fffffff)/* Command to set the processor type. */extern void mips_set_processor_type_command (char *, int);

⌨️ 快捷键说明

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