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 EXTRA_FRAME_INFO struct frame_saved_regs fsr; */
96 /* Define other aspects of the stack frame.
97 we keep a copy of the worked out return pc lying around, since it
98 is a useful bit of info */
100 /* mvs_check EXTRA_FRAME_INFO */
101 #define EXTRA_FRAME_INFO struct frame_saved_regs fsr;
103 extern void m32r_init_extra_frame_info
PARAMS ((struct frame_info
*fi
));
104 /* mvs_check INIT_EXTRA_FRAME_INFO */
105 #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) m32r_init_extra_frame_info (fi)
106 /* mvs_no_check INIT_FRAME_PC */
107 #define INIT_FRAME_PC /* Not necessary */
110 m32r_frame_find_saved_regs
PARAMS ((struct frame_info
*fi
,
111 struct frame_saved_regs
*regaddr
));
113 /* Put here the code to store, into a struct frame_saved_regs,
114 the addresses of the saved registers of frame described by FRAME_INFO.
115 This includes special registers such as pc and fp saved in special
116 ways in the stack frame. sp is even more special:
117 the address we return for it IS the sp for the next frame. */
119 /* mvs_check FRAME_FIND_SAVED_REGS */
120 #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
121 m32r_frame_find_saved_regs(frame_info, &(frame_saved_regs))
123 extern CORE_ADDR m32r_frame_chain
PARAMS ((struct frame_info
*fi
));
124 /* mvs_check FRAME_CHAIN */
125 #define FRAME_CHAIN(fi) m32r_frame_chain (fi)
127 extern CORE_ADDR m32r_find_callers_reg
PARAMS ((struct frame_info
*fi
,
129 /* mvs_check FRAME_SAVED_PC */
130 #define FRAME_SAVED_PC(fi) (m32r_find_callers_reg (fi, RP_REGNUM))
132 /* mvs_check EXTRACT_RETURN_VALUE */
133 #define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
135 (char *)(REGBUF) + REGISTER_BYTE (V0_REGNUM) + \
136 ((TYPE_LENGTH (TYPE) > 4 ? 8 : 4) - TYPE_LENGTH (TYPE)), \
139 /* mvs_check STORE_RETURN_VALUE */
140 #define STORE_RETURN_VALUE(TYPE, VALBUF) \
141 write_register_bytes(REGISTER_BYTE (V0_REGNUM) + \
142 ((TYPE_LENGTH (TYPE) > 4 ? 8:4) - TYPE_LENGTH (TYPE)),\
143 (VALBUF), TYPE_LENGTH (TYPE));
145 /* mvs_check EXTRACT_STRUCT_VALUE_ADDRESS */
146 #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
147 (extract_address (REGBUF + REGISTER_BYTE (V0_REGNUM), \
148 REGISTER_RAW_SIZE (V0_REGNUM)))
150 extern CORE_ADDR m32r_skip_prologue
PARAMS ((CORE_ADDR pc
));
151 /* mvs_check SKIP_PROLOGUE */
152 #define SKIP_PROLOGUE(pc) pc = m32r_skip_prologue (pc)
154 /* mvs_no_check FRAME_ARGS_SKIP */
155 #define FRAME_ARGS_SKIP 0
157 /* mvs_no_check FRAME_ARGS_ADDRESS */
158 #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
159 /* mvs_no_check FRAME_LOCALS_ADDRESS */
160 #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
161 /* mvs_no_check FRAME_NUM_ARGS */
162 #define FRAME_NUM_ARGS(val, fi) ((val) = -1)
164 extern struct frame_info
*m32r_pop_frame
PARAMS ((struct frame_info
*frame
));
165 /* mvs_check POP_FRAME */
166 #define POP_FRAME m32r_pop_frame (get_current_frame ())
168 /* mvs_no_check CALL_DUMMY */
169 /* #define CALL_DUMMY { 0 } */
171 /* mvs_no_check CALL_DUMMY_START_OFFSET */
172 #define CALL_DUMMY_START_OFFSET (0)
174 /* mvs_no_check CALL_DUMMY_BREAKPOINT_OFFSET */
175 #define CALL_DUMMY_BREAKPOINT_OFFSET (0)
177 extern void m32r_push_dummy_frame
PARAMS ((void));
178 /* mvs_no_check PUSH_DUMMY_FRAME */
179 #define PUSH_DUMMY_FRAME m32r_push_dummy_frame ()
181 /* mvs_no_check FIX_CALL_DUMMY */
182 #define FIX_CALL_DUMMY(DUMMY1, START_SP, FUNADDR, NARGS, \
183 ARGS, VALUE_TYPE, USING_GCC)
185 /* mvs_no_check CALL_DUMMY_LOCATION_AT_ENTRY_POINT */
186 #define CALL_DUMMY_LOCATION AT_ENTRY_POINT
188 /* mvs_no_check STACK_ALIGN */
189 #define STACK_ALIGN(x) ((x + 3) & ~3)
192 m32r_push_arguments
PARAMS ((int nargs
, struct value
**args
, CORE_ADDR sp
,
193 unsigned char struct_return
,
194 CORE_ADDR struct_addr
));
195 /* mvs_no_check PUSH_ARGUMENTS */
196 #define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
197 (SP) = m32r_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)
199 /* mvs_no_check STORE_STRUCT_RETURN */
200 #define STORE_STRUCT_RETURN(STRUCT_ADDR, SP)
202 /* mvs_no_check CALL_DUMMY_ADDRESS */
203 #define CALL_DUMMY_ADDRESS() (entry_point_address ())
205 extern int m32r_pc_in_call_dummy
PARAMS ((CORE_ADDR pc
));
206 /* mvs_no_check PC_IN_CALL_DUMMY */
207 #define PC_IN_CALL_DUMMY(PC, SP, FP) m32r_pc_in_call_dummy (PC)
209 /* mvs_check USE_STRUCT_CONVENTION */
210 #define USE_STRUCT_CONVENTION(GCC_P, TYPE) \
211 (TYPE_LENGTH (TYPE) > 8)