1 |
106 |
markom |
/* Parameters for execution on an NEC V850 processor.
|
2 |
|
|
Copyright 1996
|
3 |
|
|
Free Software Foundation, Inc.
|
4 |
|
|
|
5 |
|
|
This file is part of GDB.
|
6 |
|
|
|
7 |
|
|
This program is free software; you can redistribute it and/or modify
|
8 |
|
|
it under the terms of the GNU General Public License as published by
|
9 |
|
|
the Free Software Foundation; either version 2 of the License, or
|
10 |
|
|
(at your option) any later version.
|
11 |
|
|
|
12 |
|
|
This program is distributed in the hope that it will be useful,
|
13 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
|
|
GNU General Public License for more details.
|
16 |
|
|
|
17 |
|
|
You should have received a copy of the GNU General Public License
|
18 |
|
|
along with this program; if not, write to the Free Software
|
19 |
|
|
Foundation, Inc., 59 Temple Place - Suite 330,
|
20 |
|
|
Boston, MA 02111-1307, USA. */
|
21 |
|
|
|
22 |
|
|
#define TARGET_BYTE_ORDER LITTLE_ENDIAN
|
23 |
|
|
|
24 |
|
|
#define NUM_REGS 66
|
25 |
|
|
|
26 |
|
|
#define REGISTER_NAMES \
|
27 |
|
|
{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
|
28 |
|
|
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
|
29 |
|
|
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \
|
30 |
|
|
"r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", \
|
31 |
|
|
\
|
32 |
|
|
"eipc", "eipsw", "fepc", "fepsw", "ecr", "psw", "sr6", "sr7", \
|
33 |
|
|
"sr8", "sr9", "sr10", "sr11", "sr12", "sr13", "sr14", "sr15", \
|
34 |
|
|
"sr16", "sr17", "sr18", "sr19", "sr20", "sr21", "sr22", "sr23", \
|
35 |
|
|
"sr24", "sr25", "sr26", "sr27", "sr28", "sr29", "sr30", "sr31", \
|
36 |
|
|
\
|
37 |
|
|
"pc", "fp" }
|
38 |
|
|
|
39 |
|
|
/* Initializer for an array of names of registers.
|
40 |
|
|
Entries beyond the first NUM_REGS are ignored. */
|
41 |
|
|
|
42 |
|
|
extern char **v850_register_names;
|
43 |
|
|
#define REGISTER_NAME(i) v850_register_names[i]
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
#define REGISTER_BYTES (NUM_REGS * 4)
|
47 |
|
|
|
48 |
|
|
#define REGISTER_SIZE 4
|
49 |
|
|
#define MAX_REGISTER_RAW_SIZE 4
|
50 |
|
|
|
51 |
|
|
#define R0_REGNUM 0
|
52 |
|
|
#define R1_REGNUM 1
|
53 |
|
|
#define SAVE1_START_REGNUM 2
|
54 |
|
|
#define SAVE1_END_REGNUM 2
|
55 |
|
|
#define SP_REGNUM 3
|
56 |
|
|
#define ARG0_REGNUM 6
|
57 |
|
|
#define ARGLAST_REGNUM 9
|
58 |
|
|
#define V0_REGNUM 10
|
59 |
|
|
#define V1_REGNUM 11
|
60 |
|
|
#define R12_REGNUM 12
|
61 |
|
|
#define SAVE2_START_REGNUM 20
|
62 |
|
|
#define SAVE2_END_REGNUM 29
|
63 |
|
|
#define EP_REGNUM 30
|
64 |
|
|
#define SAVE3_START_REGNUM 31
|
65 |
|
|
#define SAVE3_END_REGNUM 31
|
66 |
|
|
#define RP_REGNUM 31
|
67 |
|
|
#define SR0_REGNUM 32
|
68 |
|
|
#define PS_REGNUM (SR0_REGNUM+5)
|
69 |
|
|
#define CTBP_REGNUM (SR0_REGNUM+20)
|
70 |
|
|
#define PC_REGNUM 64
|
71 |
|
|
#define FP_REGNUM 65
|
72 |
|
|
#define FP_RAW_REGNUM 29
|
73 |
|
|
|
74 |
|
|
#define TARGET_READ_FP() read_register (FP_RAW_REGNUM)
|
75 |
|
|
#define TARGET_WRITE_FP(VAL) write_register (FP_REGNUM, (VAL))
|
76 |
|
|
|
77 |
|
|
#define REGISTER_VIRTUAL_TYPE(REG) builtin_type_int
|
78 |
|
|
|
79 |
|
|
#define REGISTER_BYTE(REG) ((REG) * 4)
|
80 |
|
|
#define REGISTER_VIRTUAL_SIZE(REG) 4
|
81 |
|
|
#define REGISTER_RAW_SIZE(REG) 4
|
82 |
|
|
|
83 |
|
|
#define MAX_REGISTER_VIRTUAL_SIZE 4
|
84 |
|
|
|
85 |
|
|
#define BREAKPOINT {0x40, 0xF8} /* little-ended */
|
86 |
|
|
|
87 |
|
|
#define FUNCTION_START_OFFSET 0
|
88 |
|
|
|
89 |
|
|
#define DECR_PC_AFTER_BREAK 0
|
90 |
|
|
|
91 |
|
|
#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
|
92 |
|
|
|
93 |
|
|
#define SAVED_PC_AFTER_CALL(fi) read_register (RP_REGNUM)
|
94 |
|
|
|
95 |
|
|
struct frame_info;
|
96 |
|
|
struct frame_saved_regs;
|
97 |
|
|
struct type;
|
98 |
|
|
struct value;
|
99 |
|
|
|
100 |
|
|
#define EXTRA_FRAME_INFO struct frame_saved_regs fsr;
|
101 |
|
|
|
102 |
|
|
extern void v850_init_extra_frame_info PARAMS ((struct frame_info * fi));
|
103 |
|
|
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) v850_init_extra_frame_info (fi)
|
104 |
|
|
#define INIT_FRAME_PC /* Not necessary */
|
105 |
|
|
|
106 |
|
|
extern void v850_frame_find_saved_regs PARAMS ((struct frame_info * fi, struct frame_saved_regs * regaddr));
|
107 |
|
|
#define FRAME_FIND_SAVED_REGS(fi, regaddr) regaddr = fi->fsr
|
108 |
|
|
|
109 |
|
|
extern CORE_ADDR v850_frame_chain PARAMS ((struct frame_info * fi));
|
110 |
|
|
#define FRAME_CHAIN(fi) v850_frame_chain (fi)
|
111 |
|
|
#define FRAME_CHAIN_VALID(FP, FI) generic_file_frame_chain_valid (FP, FI)
|
112 |
|
|
|
113 |
|
|
extern CORE_ADDR v850_find_callers_reg PARAMS ((struct frame_info * fi, int regnum));
|
114 |
|
|
extern CORE_ADDR v850_frame_saved_pc PARAMS ((struct frame_info *));
|
115 |
|
|
#define FRAME_SAVED_PC(FI) (v850_frame_saved_pc (FI))
|
116 |
|
|
|
117 |
|
|
#define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
|
118 |
|
|
memcpy (VALBUF, REGBUF + REGISTER_BYTE (V0_REGNUM), TYPE_LENGTH (TYPE))
|
119 |
|
|
|
120 |
|
|
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
|
121 |
|
|
extract_address (REGBUF + REGISTER_BYTE (V0_REGNUM), \
|
122 |
|
|
REGISTER_RAW_SIZE (V0_REGNUM))
|
123 |
|
|
|
124 |
|
|
#define STORE_RETURN_VALUE(TYPE, VALBUF) \
|
125 |
|
|
write_register_bytes(REGISTER_BYTE (V0_REGNUM), VALBUF, TYPE_LENGTH (TYPE));
|
126 |
|
|
|
127 |
|
|
extern CORE_ADDR v850_skip_prologue PARAMS ((CORE_ADDR pc));
|
128 |
|
|
#define SKIP_PROLOGUE(pc) (v850_skip_prologue (pc))
|
129 |
|
|
|
130 |
|
|
#define FRAME_ARGS_SKIP 0
|
131 |
|
|
|
132 |
|
|
#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
|
133 |
|
|
#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
|
134 |
|
|
#define FRAME_NUM_ARGS(fi) (-1)
|
135 |
|
|
|
136 |
|
|
extern void v850_pop_frame PARAMS ((struct frame_info * frame));
|
137 |
|
|
#define POP_FRAME v850_pop_frame (get_current_frame ())
|
138 |
|
|
|
139 |
|
|
#define USE_GENERIC_DUMMY_FRAMES 1
|
140 |
|
|
#define CALL_DUMMY {0}
|
141 |
|
|
#define CALL_DUMMY_START_OFFSET (0)
|
142 |
|
|
#define CALL_DUMMY_BREAKPOINT_OFFSET (0)
|
143 |
|
|
#define CALL_DUMMY_LOCATION AT_ENTRY_POINT
|
144 |
|
|
#define FIX_CALL_DUMMY(DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP)
|
145 |
|
|
#define CALL_DUMMY_ADDRESS() entry_point_address ()
|
146 |
|
|
extern CORE_ADDR v850_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));
|
147 |
|
|
#define PUSH_RETURN_ADDRESS(PC, SP) v850_push_return_address (PC, SP)
|
148 |
|
|
|
149 |
|
|
|
150 |
|
|
#define PUSH_DUMMY_FRAME generic_push_dummy_frame ()
|
151 |
|
|
|
152 |
|
|
extern CORE_ADDR
|
153 |
|
|
v850_push_arguments PARAMS ((int nargs, struct value ** args, CORE_ADDR sp,
|
154 |
|
|
unsigned char struct_return,
|
155 |
|
|
CORE_ADDR struct_addr));
|
156 |
|
|
#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
|
157 |
|
|
(v850_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR))
|
158 |
|
|
|
159 |
|
|
#define STORE_STRUCT_RETURN(STRUCT_ADDR, SP)
|
160 |
|
|
|
161 |
|
|
|
162 |
|
|
#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP)
|
163 |
|
|
|
164 |
|
|
extern use_struct_convention_fn v850_use_struct_convention;
|
165 |
|
|
#define USE_STRUCT_CONVENTION(GCC_P, TYPE) v850_use_struct_convention (GCC_P, TYPE);
|
166 |
|
|
|
167 |
|
|
/* override the default get_saved_register function with
|
168 |
|
|
one that takes account of generic CALL_DUMMY frames */
|
169 |
|
|
#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
|
170 |
|
|
generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
|
171 |
|
|
|
172 |
|
|
/* Define this for Wingdb */
|
173 |
|
|
|
174 |
|
|
#define TARGET_V850
|