Pull in some of the changes from tm-arm.h so that arm-tdep.h will build.

This commit is contained in:
mark 1999-03-25 11:55:36 +00:00
parent fa19ef01d6
commit bd05af74ef

View File

@ -17,6 +17,11 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef __STDC__ /* Forward decls for prototypes */
struct type;
struct value;
#endif
#define TARGET_BYTE_ORDER_SELECTABLE
#define TARGET_BYTE_ORDER_DEFAULT LITTLE_ENDIAN
@ -24,7 +29,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define IEEE_FLOAT
#define ADDR_BITS_REMOVE(val) ((val) & ~3)
/* FIXME: may need a floatformat_ieee_double_bigbyte_littleword format for
BIG_ENDIAN use. -fnf */
#define TARGET_DOUBLE_FORMAT (target_byte_order == BIG_ENDIAN \
? &floatformat_ieee_double_big \
: &floatformat_ieee_double_littlebyte_bigword)
/* When reading symbols, we need to zap the low bit of the address, which
may be set to 1 for Thumb functions. */
#define SMASH_TEXT_ADDRESS(addr) ((addr) &= ~0x1)
/* Remove useless bits from addresses in a running program. */
CORE_ADDR arm_addr_bits_remove PARAMS ((CORE_ADDR));
#define ADDR_BITS_REMOVE(val) (arm_addr_bits_remove (val))
/* Offset from address of function to start of its code.
Zero on most machines. */
@ -34,14 +55,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(pc) pc = skip_prologue(pc)
extern CORE_ADDR arm_skip_prologue PARAMS ((CORE_ADDR pc));
#define SKIP_PROLOGUE(pc) { pc = arm_skip_prologue (pc); }
/* Immediately after a function call, return the saved pc.
Can't always go through the frames for this because on some machines
the new frame is not set up until the new function executes
some instructions. */
#define SAVED_PC_AFTER_CALL(frame) (ADDR_BITS_REMOVE (read_register (LR_REGNUM)))
#define SAVED_PC_AFTER_CALL(frame) arm_saved_pc_after_call (frame)
struct frame_info;
extern CORE_ADDR arm_saved_pc_after_call PARAMS ((struct frame_info *));
/* I don't know the real values for these. */
#define TARGET_UPAGES UPAGES
@ -62,7 +89,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
this is the same size as a handle - otherwise remote-rdp will
have to change. */
#define BREAKPOINT {0x11,0x00,0x00,0xe6} /* riscbsd kgdb: breakpoint is undefined instruction */
#define ARM_BREAKPOINT {0x11,0x00,0x00,0xe6} /* netbsd kgdb: breakpoint is undefined instruction */
#define THUMB_BREAKPOINT {0x18,0xdf} /* swi 24 */
/* The following macro has been superseded by BREAKPOINT_FOR_PC, but
is defined merely to keep mem-break.c happy. */
#define BREAKPOINT ARM_BREAKPOINT
/* BREAKPOINT_FROM_PC uses the program counter value to determine whether a
16- or 32-bit breakpoint should be used. It returns a pointer
to a string of bytes that encode a breakpoint instruction, stores
the length of the string to *lenptr, and adjusts the pc (if necessary) to
point to the actual memory location where the breakpoint should be
inserted. */
unsigned char * arm_breakpoint_from_pc PARAMS ((CORE_ADDR * pcptr, int * lenptr));
#define BREAKPOINT_FROM_PC(pcptr, lenptr) arm_breakpoint_from_pc (pcptr, lenptr)
/* Amount PC must be decremented by after a breakpoint.
This is often the number of bytes in BREAKPOINT
@ -138,16 +180,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
to be actual register numbers as far as the user is concerned
but do serve to get the desired values when passed to read_register. */
#define A1_REGNUM 0 /* first integer-like argument */
#define A4_REGNUM 3 /* last integer-like argument */
#define AP_REGNUM 11
#define FP_REGNUM 11 /* Contains address of executing stack frame */
#define SP_REGNUM 13 /* Contains address of top of stack */
#define LR_REGNUM 14 /* address to return to from a function call */
#define PC_REGNUM 15 /* Contains program counter */
#define F0_REGNUM 16 /* first floating point register */
#define F3_REGNUM 19 /* last floating point argument register */
#define F7_REGNUM 23 /* last floating point register */
#define FPS_REGNUM 24 /* floating point status register */
#define PS_REGNUM 25 /* Contains processor status */
#define THUMB_FP_REGNUM 7 /* R7 is frame register on Thumb */
#define ARM_NUM_ARG_REGS 4
#define ARM_LAST_ARG_REGNUM A4_REGNUM
#define ARM_NUM_FP_ARG_REGS 4
#define ARM_LAST_FP_ARG_REGNUM F3_REGNUM
/* Instruction condition field values. */
#define INST_EQ 0x00000000
#define INST_NE 0x10000000
#define INST_CS 0x20000000
@ -272,6 +325,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) (!(gcc_p))
/* Define other aspects of the stack frame.
We keep the offsets of all saved registers, 'cause we need 'em a lot!
We also keep the current size of the stack frame, and the offset of
the frame pointer from the stack pointer (for frameless functions, and
when we're still in the prologue of a function with a frame) */
#define EXTRA_FRAME_INFO \
struct frame_saved_regs fsr; \
int framesize; \
int frameoffset; \
int framereg;
extern void arm_init_extra_frame_info PARAMS ((struct frame_info *fi));
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) arm_init_extra_frame_info (fi)
/* Return the frame address. On ARM, it is R11; on Thumb it is R7. */
CORE_ADDR arm_target_read_fp PARAMS ((void));
#define TARGET_READ_FP() arm_target_read_fp ()
/* Describe the pointer in each stack frame to the previous stack frame
(its caller). */
@ -281,15 +353,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
However, if FRAME_CHAIN_VALID returns zero,
it means the given frame is the outermost one and has no caller. */
/* In the case of the ARM, the frame's nominal address is the FP value,
and 12 bytes before comes the saved previous FP value as a 4-byte word. */
#define FRAME_CHAIN(thisframe) (CORE_ADDR) arm_frame_chain (thisframe)
extern CORE_ADDR arm_frame_chain PARAMS ((struct frame_info *));
#define LOWEST_PC 0x20 /* the first 0x20 bytes are the trap vectors. */
#define FRAME_CHAIN(thisframe) \
/*#define FRAME_CHAIN(thisframe) \
((thisframe)->pc >= LOWEST_PC ? \
read_memory_integer ((thisframe)->frame - 12, 4) :\
0)
0)*/
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 && (FRAME_SAVED_PC (thisframe) >= LOWEST_PC))
@ -311,8 +383,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Saved Pc. */
#define FRAME_SAVED_PC(FRAME) \
ADDR_BITS_REMOVE (read_memory_integer ((FRAME)->frame - 4, 4))
#define FRAME_SAVED_PC(FRAME) arm_frame_saved_pc (FRAME)
extern CORE_ADDR arm_frame_saved_pc PARAMS ((struct frame_info *));
#define FRAME_ARGS_ADDRESS(fi) (fi->frame)
@ -333,6 +405,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
ways in the stack frame. sp is even more special:
the address we return for it IS the sp for the next frame. */
struct frame_saved_regs;
struct frame_info;
void frame_find_saved_regs PARAMS((struct frame_info *fi,
struct frame_saved_regs *fsr));
#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
arm_frame_find_saved_regs (frame_info, &(frame_saved_regs));
@ -340,8 +416,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Things needed for making the inferior call functions. */
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
sp = arm_push_arguments ((nargs), (args), (sp), (struct_return), (struct_addr))
extern CORE_ADDR
arm_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
/* Push an empty stack frame, to record the current PC, etc. */
void arm_push_dummy_frame PARAMS ((void));
#define PUSH_DUMMY_FRAME arm_push_dummy_frame ()
/* Discard from the stack the innermost frame, restoring all registers. */
void arm_pop_frame PARAMS ((void));
#define POP_FRAME arm_pop_frame ()
#if 0
#define PUSH_DUMMY_FRAME \
{ \
register CORE_ADDR sp = read_register (SP_REGNUM); \
@ -380,6 +472,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
} \
flush_cached_frames (); \
}
#endif
/* This sequence of words is the instructions. We use this rather than bl
becuase the code segment may not be reachable from the stack.
@ -423,10 +516,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
CORE_ADDR arm_get_next_pc PARAMS ((CORE_ADDR));
/* Function to determine whether MEMADDR is in a Thumb function. */
extern int arm_pc_is_thumb PARAMS ((bfd_vma memaddr));
/* Function to determine whether MEMADDR is in a call dummy called from
a Thumb function. */
extern int arm_pc_is_thumb_dummy PARAMS ((bfd_vma memaddr));
/*
* ARM processors don't have any single step facility
* and the NetBSD/arm32 kernel does not simulate one.
*/
#define NO_SINGLE_STEP 1
extern void single_step PARAMS ((int));