tm-i960.h

来自「模拟嵌入式硬件平台的软件源代码」· C头文件 代码 · 共 346 行 · 第 1/2 页

H
346
字号
// OBSOLETE // OBSOLETE extern use_struct_convention_fn i960_use_struct_convention;// OBSOLETE #define USE_STRUCT_CONVENTION(gcc_p, type) i960_use_struct_convention (gcc_p, type)// 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    On the i960 we just take as many bytes as we need from G0 through G3.  */// OBSOLETE // OBSOLETE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \// OBSOLETE 	memcpy(VALBUF, REGBUF+REGISTER_BYTE(G0_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 // OBSOLETE    Address of where to put structure was passed in in global// OBSOLETE    register g13 on entry.  God knows what's in g13 now.  The// OBSOLETE    (..., 0) below is to make it appear to return a value, though// OBSOLETE    actually all it does is call error().  */// OBSOLETE // OBSOLETE #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \// OBSOLETE    (error("Don't know where large structure is returned on i960"), 0)// OBSOLETE // OBSOLETE /* Write into appropriate registers a function return value// OBSOLETE    of type TYPE, given in virtual format, for "value returning" functions.// OBSOLETE // OBSOLETE    For 'return' command:  not (yet) implemented for i960.  */// OBSOLETE // OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \// OBSOLETE     error ("Returning values from functions is not implemented in i960 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 // OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \// OBSOLETE     error ("Returning values from functions is not implemented in i960 gdb")// OBSOLETE // OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame// OBSOLETE    (its caller).  */// OBSOLETE // OBSOLETE /* FRAME_CHAIN takes a frame's nominal address// OBSOLETE    and produces the frame's chain-pointer.// OBSOLETE // OBSOLETE    However, if FRAME_CHAIN_VALID returns zero,// OBSOLETE    it means the given frame is the outermost one and has no 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 /* On the i960, we get the chain pointer by reading the PFP saved// OBSOLETE    on the stack and clearing the status bits.  */// OBSOLETE // OBSOLETE #define FRAME_CHAIN(thisframe) \// OBSOLETE   (read_memory_integer (FRAME_FP(thisframe), 4) & ~0xf)// OBSOLETE // OBSOLETE /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one// OBSOLETE    and has no caller.// OBSOLETE // OBSOLETE    On the i960, each various target system type must define FRAME_CHAIN_VALID,// OBSOLETE    since it differs between NINDY and VxWorks, the two currently supported// OBSOLETE    targets types.  We leave it undefined here.  */// OBSOLETE // OBSOLETE // OBSOLETE /* A macro that tells us whether the function invocation represented// OBSOLETE    by FI does not have a frame on the stack associated with it.  If it// OBSOLETE    does not, FRAMELESS is set to 1, else 0.  */// OBSOLETE // OBSOLETE CORE_ADDR leafproc_return (CORE_ADDR ip);// OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) \// OBSOLETE   (leafproc_return ((FI)->pc) != 0)// OBSOLETE // OBSOLETE /* Note that in the i960 architecture the return pointer is saved in the// OBSOLETE    *caller's* stack frame.// OBSOLETE // OBSOLETE    Make sure to zero low-order bits because of bug in 960CA A-step part// OBSOLETE    (instruction addresses should always be word-aligned anyway).  */// OBSOLETE // OBSOLETE #define FRAME_SAVED_PC(frame) \// OBSOLETE 			((read_memory_integer(FRAME_CHAIN(frame)+8,4)) & ~3)// OBSOLETE // OBSOLETE /* On the i960, FRAME_ARGS_ADDRESS should return the value of// OBSOLETE    g14 as passed into the frame, if known.  We need a function for this.// OBSOLETE    We cache this value in the frame info if we've already looked it up.  */// OBSOLETE // OBSOLETE #define FRAME_ARGS_ADDRESS(fi) 	\// OBSOLETE   (((fi)->arg_pointer != -1)? (fi)->arg_pointer: frame_args_address (fi, 0))// OBSOLETE extern CORE_ADDR frame_args_address ();		/* i960-tdep.c */// 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_ARGS_ADDRESS_CORRECT(fi)	(frame_args_address (fi, 1))// 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 i960-tdep.c */// OBSOLETE // OBSOLETE /* Things needed for making calls to functions in the inferior process */// OBSOLETE // OBSOLETE /* Push an empty stack frame, to record the current ip, etc.// OBSOLETE // OBSOLETE    Not (yet?) implemented for i960.  */// OBSOLETE // OBSOLETE #define PUSH_DUMMY_FRAME	\// OBSOLETE error("Function calls into the inferior process are not supported on the i960")// OBSOLETE // OBSOLETE /* Discard from the stack the innermost frame, restoring all registers.  */// OBSOLETE // OBSOLETE // OBSOLETE void i960_pop_frame (void);// OBSOLETE #define POP_FRAME \// OBSOLETE 	i960_pop_frame ()// OBSOLETE // OBSOLETE // OBSOLETE /* This sequence of words is the instructions// OBSOLETE // OBSOLETE    callx 0x00000000// OBSOLETE    fmark// OBSOLETE  */// OBSOLETE // OBSOLETE /* #define CALL_DUMMY { 0x86003000, 0x00000000, 0x66003e00 } */// OBSOLETE // OBSOLETE 																			    /* #define CALL_DUMMY_START_OFFSET 0 *//* Start execution at beginning of dummy */// OBSOLETE // OBSOLETE /* Indicate that we don't support calling inferior child functions.  */// OBSOLETE // OBSOLETE #undef CALL_DUMMY// OBSOLETE // OBSOLETE /* Insert the specified number of args and function address// OBSOLETE    into a call sequence of the above form stored at 'dummyname'.// OBSOLETE // OBSOLETE    Ignore arg count on i960.  */// OBSOLETE // OBSOLETE /* #define FIX_CALL_DUMMY(dummyname, fun, nargs) *(((int *)dummyname)+1) = fun */// OBSOLETE // OBSOLETE #undef FIX_CALL_DUMMY// OBSOLETE // OBSOLETE // OBSOLETE /* Interface definitions for kernel debugger KDB */// OBSOLETE /* (Not relevant to i960.) */

⌨️ 快捷键说明

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