1 /* Parameters for execution on a Matsushita mn10300 processor.
3 Free Software Foundation, Inc.
7 This file is part of GDB.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
23 #define TARGET_BYTE_ORDER LITTLE_ENDIAN
25 #define REGISTER_BYTES (NUM_REGS * 4)
27 #define REGISTER_SIZE 4
28 #define MAX_REGISTER_RAW_SIZE 4
32 #define REGISTER_NAMES \
33 { "d0", "d1", "d2", "d3", "a0", "a1", "a2", "a3", \
34 "sp", "pc", "mdr", "psw", "lir", "lar" }
43 #define FP_REGNUM 7 /* needs to be virtual register ??? */
44 #define V0_REGNUM 15 /* needs to be virtual register ??? */
45 #define RP_REGNUM 16 /* needs to be virtual register ??? */
46 #define ARG0_REGNUM 17 /* needs to be virtual register ??? */
47 #define ARGLAST_REGNUM 18 /* needs to be virtual register ??? */
49 #define REGISTER_VIRTUAL_TYPE(REG) builtin_type_int
51 #define REGISTER_BYTE(REG) ((REG) * 4)
52 #define REGISTER_VIRTUAL_SIZE(REG) 4
53 #define REGISTER_RAW_SIZE(REG) 4
55 #define MAX_REGISTER_VIRTUAL_SIZE 4
57 #define BREAKPOINT {0xff, 0xff}
59 #define FUNCTION_START_OFFSET 0
61 #define DECR_PC_AFTER_BREAK 0
65 #define SAVED_PC_AFTER_CALL(fi) read_register (RP_REGNUM)
69 struct frame_saved_regs;
74 #define EXTRA_FRAME_INFO struct frame_saved_regs fsr;
76 extern void mn10300_init_extra_frame_info PARAMS ((struct frame_info *fi));
77 #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) mn10300_init_extra_frame_info (fi)
78 #define INIT_FRAME_PC /* Not necessary */
80 extern void mn10300_frame_find_saved_regs PARAMS ((struct frame_info *fi, struct frame_saved_regs *regaddr));
81 #define FRAME_FIND_SAVED_REGS(fi, regaddr) regaddr = fi->fsr
83 extern CORE_ADDR mn10300_frame_chain PARAMS ((struct frame_info *fi));
84 #define FRAME_CHAIN(fi) mn10300_frame_chain (fi)
85 #define FRAME_CHAIN_VALID(FP, FI) generic_frame_chain_valid (FP, FI)
87 extern CORE_ADDR mn10300_find_callers_reg PARAMS ((struct frame_info *fi, int regnum));
88 extern CORE_ADDR mn10300_frame_saved_pc PARAMS ((struct frame_info *));
89 #define FRAME_SAVED_PC(FI) (mn10300_frame_saved_pc (FI))
91 #define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
92 memcpy (VALBUF, REGBUF + REGISTER_BYTE (V0_REGNUM), TYPE_LENGTH (TYPE))
94 #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
95 extract_address (REGBUF + REGISTER_BYTE (V0_REGNUM), \
96 REGISTER_RAW_SIZE (V0_REGNUM))
98 #define STORE_RETURN_VALUE(TYPE, VALBUF) \
99 write_register_bytes(REGISTER_BYTE (V0_REGNUM), VALBUF, TYPE_LENGTH (TYPE));
101 extern CORE_ADDR mn10300_skip_prologue PARAMS ((CORE_ADDR pc));
102 #define SKIP_PROLOGUE(pc) pc = mn10300_skip_prologue (pc)
104 #define FRAME_ARGS_SKIP 0
106 #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
107 #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
108 #define FRAME_NUM_ARGS(val, fi) ((val) = -1)
110 extern void mn10300_pop_frame PARAMS ((struct frame_info *frame));
111 #define POP_FRAME mn10300_pop_frame (get_current_frame ())
113 #define USE_GENERIC_DUMMY_FRAMES
114 #define CALL_DUMMY {0}
115 #undef CALL_DUMMY /* for now, no function calls */
116 #define CALL_DUMMY_START_OFFSET (0)
117 #define CALL_DUMMY_BREAKPOINT_OFFSET (0)
118 #define CALL_DUMMY_LOCATION AT_ENTRY_POINT
119 #define FIX_CALL_DUMMY(DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP)
120 #define CALL_DUMMY_ADDRESS() entry_point_address ()
121 extern CORE_ADDR mn10300_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));
122 #define PUSH_RETURN_ADDRESS(PC, SP) mn10300_push_return_address (PC, SP)
124 #define PUSH_DUMMY_FRAME generic_push_dummy_frame ()
127 mn10300_push_arguments PARAMS ((int nargs, struct value **args, CORE_ADDR sp,
128 unsigned char struct_return,
129 CORE_ADDR struct_addr));
130 #define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
131 (SP) = mn10300_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)
133 #define STORE_STRUCT_RETURN(STRUCT_ADDR, SP)
135 #define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP)
137 #define USE_STRUCT_CONVENTION(GCC_P, TYPE) \
138 (TYPE_NFIELDS (TYPE) > 1 || TYPE_LENGTH (TYPE) > 4)
140 /* override the default get_saved_register function with
141 one that takes account of generic CALL_DUMMY frames */
142 #define GET_SAVED_REGISTER
144 /* Define this for Wingdb */
146 #define TARGET_MN10300