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

📄 tm-hppa.h

📁 arm-linux-gcc编译器
💻 H
📖 第 1 页 / 共 3 页
字号:
#define INSTRUCTION_NULLIFIED \    (((int)read_register (IPSW_REGNUM) & 0x00200000) && \     !((int)read_register (FLAGS_REGNUM) & 0x2))#endif/* Number of bytes of storage in the actual machine representation   for register N.  On the PA-RISC, all regs are 4 bytes, including   the FP registers (they're accessed as two 4 byte halves).  */#define REGISTER_RAW_SIZE(N) 4/* Total amount of space needed to store our copies of the machine's   register state, the array `registers'.  */#define REGISTER_BYTES (NUM_REGS * 4)/* Index within `registers' of the first byte of the space for   register N.  */#define REGISTER_BYTE(N) (N) * 4/* Number of bytes of storage in the program's representation   for register N. */#define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)/* Largest value REGISTER_RAW_SIZE can have.  */#define MAX_REGISTER_RAW_SIZE 4/* Largest value REGISTER_VIRTUAL_SIZE can have.  */#define MAX_REGISTER_VIRTUAL_SIZE 8/* Return the GDB type object for the "standard" data type   of data in register N.  */#define REGISTER_VIRTUAL_TYPE(N) \ ((N) < FP4_REGNUM ? builtin_type_int : builtin_type_float)/* Store the address of the place in which to copy the structure the   subroutine will return.  This is called from call_function. */#define STORE_STRUCT_RETURN(ADDR, SP) {write_register (28, (ADDR)); }/* 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.    elz: changed what to return when length is > 4: the stored result is    in register 28 and in register 29, with the lower order word being in reg 29,    so we must start reading it from somehere in the middle of reg28   FIXME: Not sure what to do for soft float here.  */#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \  { \    if (TYPE_CODE (TYPE) == TYPE_CODE_FLT && !SOFT_FLOAT) \      memcpy ((VALBUF), \	      ((char *)(REGBUF)) + REGISTER_BYTE (FP4_REGNUM), \	      TYPE_LENGTH (TYPE)); \    else \      memcpy ((VALBUF), \	      (char *)(REGBUF) + REGISTER_BYTE (28) + \	      (TYPE_LENGTH (TYPE) > 4 ? (8 - TYPE_LENGTH (TYPE)) : (4 - TYPE_LENGTH (TYPE))), \	      TYPE_LENGTH (TYPE)); \  } /* elz: decide whether the function returning a value of type type    will put it on the stack or in the registers.    The pa calling convention says that:    register 28 (called ret0 by gdb) contains any ASCII char,    and any non_floating point value up to 32-bits.    reg 28 and 29 contain non-floating point up tp 64 bits and larger    than 32 bits. (higer order word in reg 28).    fr4: floating point up to 64 bits    sr1: space identifier (32-bit)    stack: any lager than 64-bit, with the address in r28  */extern use_struct_convention_fn hppa_use_struct_convention;#define USE_STRUCT_CONVENTION(gcc_p,type) hppa_use_struct_convention (gcc_p,type)/* Write into appropriate registers a function return value   of type TYPE, given in virtual format.   For software floating point the return value goes into the integer   registers.  But we don't have any flag to key this on, so we always   store the value into the integer registers, and if it's a float value,   then we put it in the float registers too.  */#define STORE_RETURN_VALUE(TYPE,VALBUF) \  write_register_bytes (REGISTER_BYTE (28),(VALBUF), TYPE_LENGTH (TYPE)) ; \  if (!SOFT_FLOAT) \    write_register_bytes ((TYPE_CODE(TYPE) == TYPE_CODE_FLT \			   ? REGISTER_BYTE (FP4_REGNUM) \			   : REGISTER_BYTE (28)),		\			  (VALBUF), TYPE_LENGTH (TYPE))/* 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).  */#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \  (*(int *)((REGBUF) + REGISTER_BYTE (28)))/* elz: Return a large value, which is stored on the stack at addr.   This is defined only for the hppa, at this moment.    The above macro EXTRACT_STRUCT_VALUE_ADDRESS is not called anymore,   because it assumes that on exit from a called function which returns   a large structure on the stack, the address of the ret structure is    still in register 28. Unfortunately this register is usually overwritten   by the called function itself, on hppa. This is specified in the calling   convention doc. As far as I know, the only way to get the return value   is to have the caller tell us where it told the callee to put it, rather   than have the callee tell us. */#define VALUE_RETURNED_FROM_STACK(valtype,addr) \  hppa_value_returned_from_stack (valtype, addr)/* * This macro defines the register numbers (from REGISTER_NAMES) that * are effectively unavailable to the user through ptrace().  It allows * us to include the whole register set in REGISTER_NAMES (inorder to * better support remote debugging).  If it is used in * fetch/store_inferior_registers() gdb will not complain about I/O errors * on fetching these registers.  If all registers in REGISTER_NAMES * are available, then return false (0). */#define CANNOT_STORE_REGISTER(regno)            \                   ((regno) == 0) ||     \                   ((regno) == PCSQ_HEAD_REGNUM) || \                   ((regno) >= PCSQ_TAIL_REGNUM && (regno) < IPSW_REGNUM) ||  \                   ((regno) > IPSW_REGNUM && (regno) < FP4_REGNUM)#define INIT_EXTRA_FRAME_INFO(fromleaf, frame) init_extra_frame_info (fromleaf, frame)extern void init_extra_frame_info PARAMS ((int, struct frame_info *));/* 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.   FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address   and produces the nominal address of the caller frame.   However, if FRAME_CHAIN_VALID returns zero,   it means the given frame is the outermost one and has no caller.   In that case, FRAME_CHAIN_COMBINE is not used.  *//* In the case of the PA-RISC, the frame's nominal address   is the address of a 4-byte word containing the calling frame's   address (previous FP).  */#define FRAME_CHAIN(thisframe) frame_chain (thisframe)extern CORE_ADDR frame_chain PARAMS ((struct frame_info *));extern int hppa_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));#define FRAME_CHAIN_VALID(chain, thisframe) hppa_frame_chain_valid (chain, thisframe)#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain)/* 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.  */#define FRAMELESS_FUNCTION_INVOCATION(FI) \  (frameless_function_invocation (FI))extern int frameless_function_invocation PARAMS ((struct frame_info *));extern CORE_ADDR hppa_frame_saved_pc PARAMS ((struct frame_info * frame));#define FRAME_SAVED_PC(FRAME) hppa_frame_saved_pc (FRAME)#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)/* Set VAL to the number of args passed to frame described by FI.   Can set VAL to -1, meaning no way to tell.  *//* We can't tell how many args there are   now that the C compiler delays popping them.  */#define FRAME_NUM_ARGS(fi) (-1)/* Return number of bytes at start of arglist that are not really args.  */#define FRAME_ARGS_SKIP 0#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \  hppa_frame_find_saved_regs (frame_info, &frame_saved_regs)extern voidhppa_frame_find_saved_regs PARAMS ((struct frame_info *,				    struct frame_saved_regs *));/* Things needed for making the inferior call functions.  *//* Push an empty stack frame, to record the current PC, etc. */#define PUSH_DUMMY_FRAME push_dummy_frame (inf_status)extern void push_dummy_frame PARAMS ((struct inferior_status *));/* Discard from the stack the innermost frame,    restoring all saved registers.  */#define POP_FRAME  hppa_pop_frame ()extern void hppa_pop_frame PARAMS ((void));#define INSTRUCTION_SIZE 4#ifndef PA_LEVEL_0/* Non-level zero PA's have space registers (but they don't always have   floating-point, do they????  *//* This sequence of words is the instructions   ; Call stack frame has already been built by gdb. Since we could be calling    ; a varargs function, and we do not have the benefit of a stub to put things in   ; the right place, we load the first 4 word of arguments into both the general   ; and fp registers.   call_dummy   ldw -36(sp), arg0   ldw -40(sp), arg1   ldw -44(sp), arg2   ldw -48(sp), arg3   ldo -36(sp), r1   fldws 0(0, r1), fr4   fldds -4(0, r1), fr5   fldws -8(0, r1), fr6   fldds -12(0, r1), fr7   ldil 0, r22                  ; FUNC_LDIL_OFFSET must point here   ldo 0(r22), r22                      ; FUNC_LDO_OFFSET must point here   ldsid (0,r22), r4   ldil 0, r1                   ; SR4EXPORT_LDIL_OFFSET must point here   ldo 0(r1), r1                        ; SR4EXPORT_LDO_OFFSET must point here   ldsid (0,r1), r20   combt,=,n r4, r20, text_space        ; If target is in data space, do a   ble 0(sr5, r22)                      ; "normal" procedure call   copy r31, r2   break 4, 8    mtsp r21, sr0   ble,n 0(sr0, r22)   text_space                           ; Otherwise, go through _sr4export,   ble (sr4, r1)                        ; which will return back here.   stw r31,-24(r30)   break 4, 8   mtsp r21, sr0   ble,n 0(sr0, r22)   nop                          ; To avoid kernel bugs    nop                          ; and keep the dummy 8 byte aligned   The dummy decides if the target is in text space or data space. If   it's in data space, there's no problem because the target can   return back to the dummy. However, if the target is in text space,   the dummy calls the secret, undocumented routine _sr4export, which   calls a function in text space and can return to any space. Instead   of including fake instructions to represent saved registers, we   know that the frame is associated with the call dummy and treat it   specially.   The trailing NOPs are needed to avoid a bug in HPUX, BSD and OSF1    kernels.   If the memory at the location pointed to by the PC is   0xffffffff then a ptrace step call will fail (even if the instruction   is nullified).   The code to pop a dummy frame single steps three instructions   starting with the last mtsp.  This includes the nullified "instruction"   following the ble (which is uninitialized junk).  If the 

⌨️ 快捷键说明

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