1 /* Parameters for execution on a Mitsubishi m32r processor.
3 Free Software Foundation, Inc.
5 This file is part of GDB.
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.
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.
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, Boston, MA 02111-1307, USA. */
21 /* mvs_check TARGET_BYTE_ORDER BIG_ENDIAN */
22 #define TARGET_BYTE_ORDER BIG_ENDIAN
24 /* mvs_check REGISTER_NAMES */
25 #define REGISTER_NAMES \
26 { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
27 "r8", "r9", "r10", "r11", "r12", "fp", "lr", "sp", \
28 "psw", "cbr", "spi", "spu", "bpc", "pc", "accl", "acch", \
29 /* "cond", "sm", "bsm", "ie", "bie", "bcarry", */ \
31 /* mvs_check NUM_REGS */
34 /* mvs_check REGISTER_SIZE */
35 #define REGISTER_SIZE 4
36 /* mvs_check MAX_REGISTER_RAW_SIZE */
37 #define MAX_REGISTER_RAW_SIZE 4
39 /* mvs_check *_REGNUM */
42 #define ARGLAST_REGNUM 3
54 #define ACCL_REGNUM 22
55 #define ACCH_REGNUM 23
57 /* mvs_check REGISTER_BYTES */
58 #define REGISTER_BYTES (NUM_REGS * 4)
60 /* mvs_check REGISTER_VIRTUAL_TYPE */
61 #define REGISTER_VIRTUAL_TYPE(REG) builtin_type_int
63 /* mvs_check REGISTER_BYTE */
64 #define REGISTER_BYTE(REG) ((REG) * 4)
65 /* mvs_check REGISTER_VIRTUAL_SIZE */
66 #define REGISTER_VIRTUAL_SIZE(REG) 4
67 /* mvs_check REGISTER_RAW_SIZE */
68 #define REGISTER_RAW_SIZE(REG) 4
70 /* mvs_check MAX_REGISTER_VIRTUAL_SIZE */
71 #define MAX_REGISTER_VIRTUAL_SIZE 4
73 /* mvs_check BREAKPOINT */
74 #define BREAKPOINT {0x10, 0xf1}
76 /* mvs_no_check FUNCTION_START_OFFSET */
77 #define FUNCTION_START_OFFSET 0
79 /* mvs_check DECR_PC_AFTER_BREAK */
80 #define DECR_PC_AFTER_BREAK 0
82 /* mvs_check INNER_THAN */
85 /* mvs_check SAVED_PC_AFTER_CALL */
86 #define SAVED_PC_AFTER_CALL(fi) read_register (RP_REGNUM)
90 struct frame_saved_regs
;
95 /* Define other aspects of the stack frame.
96 We keep the offsets of all saved registers, 'cause we need 'em a lot!
97 We also keep the current size of the stack frame, and whether
98 the frame pointer is valid (for frameless functions, and when we're
99 still in the prologue of a function with a frame) */
101 /* mvs_check EXTRA_FRAME_INFO */
102 #define EXTRA_FRAME_INFO \
103 struct frame_saved_regs fsr; \
105 int using_frame_pointer;
108 extern void m32r_init_extra_frame_info
PARAMS ((struct frame_info
*fi
));
109 /* mvs_check INIT_EXTRA_FRAME_INFO */
110 #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) m32r_init_extra_frame_info (fi)
111 /* mvs_no_check INIT_FRAME_PC */
112 #define INIT_FRAME_PC /* Not necessary */
115 m32r_frame_find_saved_regs
PARAMS ((struct frame_info
*fi
,
116 struct frame_saved_regs
*regaddr
));
118 /* Put here the code to store, into a struct frame_saved_regs,
119 the addresses of the saved registers of frame described by FRAME_INFO.
120 This includes special registers such as pc and fp saved in special
121 ways in the stack frame. sp is even more special:
122 the address we return for it IS the sp for the next frame. */
124 /* mvs_check FRAME_FIND_SAVED_REGS */
125 #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
126 m32r_frame_find_saved_regs(frame_info, &(frame_saved_regs))
128 extern CORE_ADDR m32r_frame_chain
PARAMS ((struct frame_info
*fi
));
129 /* mvs_check FRAME_CHAIN */
130 #define FRAME_CHAIN(fi) m32r_frame_chain (fi)
132 extern CORE_ADDR m32r_find_callers_reg
PARAMS ((struct frame_info
*fi
,
134 /* mvs_check FRAME_SAVED_PC */
135 #define FRAME_SAVED_PC(fi) (m32r_find_callers_reg (fi, RP_REGNUM))
137 /* mvs_check EXTRACT_RETURN_VALUE */
138 #define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
140 (char *)(REGBUF) + REGISTER_BYTE (V0_REGNUM) + \
141 ((TYPE_LENGTH (TYPE) > 4 ? 8 : 4) - TYPE_LENGTH (TYPE)), \
144 /* mvs_check STORE_RETURN_VALUE */
145 #define STORE_RETURN_VALUE(TYPE, VALBUF) \
146 write_register_bytes(REGISTER_BYTE (V0_REGNUM) + \
147 ((TYPE_LENGTH (TYPE) > 4 ? 8:4) - TYPE_LENGTH (TYPE)),\
148 (VALBUF), TYPE_LENGTH (TYPE));
150 /* mvs_check EXTRACT_STRUCT_VALUE_ADDRESS */
151 #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
152 (extract_address (REGBUF + REGISTER_BYTE (V0_REGNUM), \
153 REGISTER_RAW_SIZE (V0_REGNUM)))
155 extern CORE_ADDR m32r_skip_prologue
PARAMS ((CORE_ADDR pc
));
156 /* mvs_check SKIP_PROLOGUE */
157 #define SKIP_PROLOGUE(pc) pc = m32r_skip_prologue (pc)
159 /* mvs_no_check FRAME_ARGS_SKIP */
160 #define FRAME_ARGS_SKIP 0
162 /* mvs_no_check FRAME_ARGS_ADDRESS */
163 #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
164 /* mvs_no_check FRAME_LOCALS_ADDRESS */
165 #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
166 /* mvs_no_check FRAME_NUM_ARGS */
167 #define FRAME_NUM_ARGS(val, fi) ((val) = -1)
169 extern struct frame_info
*m32r_pop_frame
PARAMS ((struct frame_info
*frame
));
170 /* mvs_check POP_FRAME */
171 #define POP_FRAME m32r_pop_frame (get_current_frame ())
173 /* mvs_no_check CALL_DUMMY */
174 /* #define CALL_DUMMY { 0 } */
176 /* mvs_no_check CALL_DUMMY_START_OFFSET */
177 #define CALL_DUMMY_START_OFFSET (0)
179 /* mvs_no_check CALL_DUMMY_BREAKPOINT_OFFSET */
180 #define CALL_DUMMY_BREAKPOINT_OFFSET (0)
182 extern void m32r_push_dummy_frame
PARAMS ((void));
183 /* mvs_no_check PUSH_DUMMY_FRAME */
184 #define PUSH_DUMMY_FRAME m32r_push_dummy_frame ()
186 /* mvs_no_check FIX_CALL_DUMMY */
187 #define FIX_CALL_DUMMY(DUMMY1, START_SP, FUNADDR, NARGS, \
188 ARGS, VALUE_TYPE, USING_GCC)
190 /* mvs_no_check CALL_DUMMY_LOCATION_AT_ENTRY_POINT */
191 #define CALL_DUMMY_LOCATION AT_ENTRY_POINT
193 /* mvs_no_check STACK_ALIGN */
194 #define STACK_ALIGN(x) ((x + 3) & ~3)
197 m32r_push_arguments
PARAMS ((int nargs
, struct value
**args
, CORE_ADDR sp
,
198 unsigned char struct_return
,
199 CORE_ADDR struct_addr
));
200 /* mvs_no_check PUSH_ARGUMENTS */
201 #define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
202 (SP) = m32r_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)
204 /* mvs_no_check STORE_STRUCT_RETURN */
205 #define STORE_STRUCT_RETURN(STRUCT_ADDR, SP)
207 /* mvs_no_check CALL_DUMMY_ADDRESS */
208 #define CALL_DUMMY_ADDRESS() (entry_point_address ())
210 extern int m32r_pc_in_call_dummy
PARAMS ((CORE_ADDR pc
));
211 /* mvs_no_check PC_IN_CALL_DUMMY */
212 #define PC_IN_CALL_DUMMY(PC, SP, FP) m32r_pc_in_call_dummy (PC)
214 /* mvs_check USE_STRUCT_CONVENTION */
215 #define USE_STRUCT_CONVENTION(GCC_P, TYPE) \
216 (TYPE_LENGTH (TYPE) > 8)