tm-arc.h
来自「模拟嵌入式硬件平台的软件源代码」· C头文件 代码 · 共 337 行 · 第 1/2 页
H
337 行
// OBSOLETE // OBSOLETE /* Number of bytes of storage in the program's representation for register N. */// OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) 4// OBSOLETE // OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. */// OBSOLETE #define MAX_REGISTER_RAW_SIZE 4// OBSOLETE // OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. */// OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE 4// OBSOLETE // OBSOLETE /* Return the GDB type object for the "standard" data type// OBSOLETE of data in register N. */// OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) (builtin_type_int)// OBSOLETE // OBSOLETE // OBSOLETE /* Macros for understanding function return values... */// OBSOLETE // OBSOLETE /* Does the specified function use the "struct returning" convention// OBSOLETE or the "value returning" convention? The "value returning" convention// OBSOLETE almost invariably returns the entire value in registers. The// OBSOLETE "struct returning" convention often returns the entire value in// OBSOLETE memory, and passes a pointer (out of or into the function) saying// OBSOLETE where the value (is or should go).// OBSOLETE // OBSOLETE Since this sometimes depends on whether it was compiled with GCC,// OBSOLETE this is also an argument. This is used in call_function to build a// OBSOLETE stack, and in value_being_returned to print return values.// OBSOLETE // OBSOLETE On arc, a structure is always retunred with pointer in r0. */// OBSOLETE // OBSOLETE #define USE_STRUCT_CONVENTION(gcc_p, type) 1// OBSOLETE // OBSOLETE /* Extract from an array REGBUF containing the (raw) register state// OBSOLETE a function return value of type TYPE, and copy that, in virtual format,// OBSOLETE into VALBUF. This is only called if USE_STRUCT_CONVENTION for this// OBSOLETE type is 0.// OBSOLETE */// OBSOLETE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \// OBSOLETE memcpy(VALBUF, REGBUF+REGISTER_BYTE(R0_REGNUM), TYPE_LENGTH (TYPE))// OBSOLETE // OBSOLETE /* If USE_STRUCT_CONVENTION produces a 1, // OBSOLETE extract from an array REGBUF containing the (raw) register state// OBSOLETE the address in which a function should return its structure value,// OBSOLETE as a CORE_ADDR (or an expression that can be used as one). */// OBSOLETE #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \// OBSOLETE (error("Don't know where large structure is returned on arc"), 0)// OBSOLETE // OBSOLETE /* Write into appropriate registers a function return value// OBSOLETE of type TYPE, given in virtual format, for "value returning" functions.// OBSOLETE For 'return' command: not (yet) implemented for arc. */// OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \// OBSOLETE error ("Returning values from functions is not implemented in arc gdb")// OBSOLETE // OBSOLETE /* Store the address of the place in which to copy the structure the// OBSOLETE subroutine will return. This is called from call_function. */// OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \// OBSOLETE error ("Returning values from functions is not implemented in arc gdb")// OBSOLETE // OBSOLETE // OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame// OBSOLETE (its caller). */// OBSOLETE // OBSOLETE /* We cache information about saved registers in the frame structure,// OBSOLETE to save us from having to re-scan function prologues every time// OBSOLETE a register in a non-current frame is accessed. */// OBSOLETE // OBSOLETE #define EXTRA_FRAME_INFO \// OBSOLETE struct frame_saved_regs *fsr; \// OBSOLETE CORE_ADDR arg_pointer;// OBSOLETE // OBSOLETE /* Zero the frame_saved_regs pointer when the frame is initialized,// OBSOLETE so that FRAME_FIND_SAVED_REGS () will know to allocate and// OBSOLETE initialize a frame_saved_regs struct the first time it is called.// OBSOLETE Set the arg_pointer to -1, which is not valid; 0 and other values// OBSOLETE indicate real, cached values. */// OBSOLETE // OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \// OBSOLETE ((fi)->fsr = 0, (fi)->arg_pointer = -1)// OBSOLETE // OBSOLETE /* FRAME_CHAIN takes a frame's nominal address// OBSOLETE and produces the frame's chain-pointer.// OBSOLETE However, if FRAME_CHAIN_VALID returns zero,// OBSOLETE it means the given frame is the outermost one and has no caller. */// OBSOLETE /* On the arc, we get the chain pointer by reading the PFP saved// OBSOLETE on the stack. */// OBSOLETE /* The PFP and RPC is in fp and fp+4. */// OBSOLETE // OBSOLETE #define FRAME_CHAIN(thisframe) \// OBSOLETE (read_memory_integer (FRAME_FP (thisframe), 4))// OBSOLETE // OBSOLETE /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one// OBSOLETE and has no caller. */// OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe)// OBSOLETE // OBSOLETE /* An expression that tells us whether the function invocation represented// OBSOLETE by FI does not have a frame on the stack associated with it. */// OBSOLETE // OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) \// OBSOLETE (((FI)->signal_handler_caller) ? 0 : frameless_look_for_prologue (FI))// OBSOLETE // OBSOLETE /* Where is the PC for a specific frame.// OBSOLETE A leaf function may never save blink, so we have to check for that here. */// OBSOLETE // OBSOLETE #define FRAME_SAVED_PC(frame) (arc_frame_saved_pc (frame))// OBSOLETE struct frame_info; /* in case frame.h not included yet */// OBSOLETE CORE_ADDR arc_frame_saved_pc (struct frame_info *);// OBSOLETE // OBSOLETE /* If the argument is on the stack, it will be here.// OBSOLETE We cache this value in the frame info if we've already looked it up. */// OBSOLETE /* ??? Is the arg_pointer check necessary? */// OBSOLETE // OBSOLETE #define FRAME_ARGS_ADDRESS(fi) \// OBSOLETE (((fi)->arg_pointer != -1) ? (fi)->arg_pointer : (fi)->frame)// OBSOLETE // OBSOLETE /* This is the same except it should return 0 when// OBSOLETE it does not really know where the args are, rather than guessing.// OBSOLETE This value is not cached since it is only used infrequently. */// OBSOLETE // OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)// OBSOLETE // OBSOLETE /* Set NUMARGS to the number of args passed to a frame.// OBSOLETE Can return -1, meaning no way to tell. */// OBSOLETE // OBSOLETE #define FRAME_NUM_ARGS(fi) (-1)// OBSOLETE // OBSOLETE /* Return number of bytes at start of arglist that are not really args. */// OBSOLETE // OBSOLETE #define FRAME_ARGS_SKIP 0// OBSOLETE // OBSOLETE /* Produce the positions of the saved registers in a stack frame. */// OBSOLETE // OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info_addr, sr) \// OBSOLETE frame_find_saved_regs (frame_info_addr, &sr)// OBSOLETE extern void frame_find_saved_regs (); /* See arc-tdep.c */// OBSOLETE // OBSOLETE // OBSOLETE /* Things needed for making calls to functions in the inferior process */// OBSOLETE void arc_push_dummy_frame (void);// OBSOLETE #define PUSH_DUMMY_FRAME \// OBSOLETE arc_push_dummy_frame ()// OBSOLETE // OBSOLETE /* Discard from the stack the innermost frame, restoring all registers. */// OBSOLETE void arc_pop_frame (void);// OBSOLETE #define POP_FRAME \// OBSOLETE arc_pop_frame ()// OBSOLETE // OBSOLETE /* This sequence of words is the instructions bl xxxx, flag 1 */// OBSOLETE #define CALL_DUMMY { 0x28000000, 0x1fbe8001 }// OBSOLETE #define CALL_DUMMY_LENGTH 8// OBSOLETE // OBSOLETE /* Start execution at beginning of dummy */// OBSOLETE #define CALL_DUMMY_START_OFFSET 0// OBSOLETE // OBSOLETE /* Insert the specified number of args and function address// OBSOLETE into a call sequence of the above form stored at 'dummyname'. */// OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \// OBSOLETE { \// OBSOLETE int from, to, delta, loc; \// OBSOLETE loc = (int)(read_register (SP_REGNUM) - CALL_DUMMY_LENGTH); \// OBSOLETE from = loc + 4; \// OBSOLETE to = (int)(fun); \// OBSOLETE delta = (to - from) >> 2; \// OBSOLETE *((char *)(dummyname) + 1) = (delta & 0x1); \// OBSOLETE *((char *)(dummyname) + 2) = ((delta >> 1) & 0xff); \// OBSOLETE *((char *)(dummyname) + 3) = ((delta >> 9) & 0xff); \// OBSOLETE *((char *)(dummyname) + 4) = ((delta >> 17) & 0x7); \// OBSOLETE }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?