]>
Commit | Line | Data |
---|---|---|
c906108c SS |
1 | /* OBSOLETE /* Parameters for targe of a Gould Powernode, for GDB, the GNU debugger. */ |
2 | /* OBSOLETE Copyright 1986, 1987, 1989, 1991, 1993 Free Software Foundation, Inc. */ | |
3 | /* OBSOLETE */ | |
4 | /* OBSOLETE This file is part of GDB. */ | |
5 | /* OBSOLETE */ | |
6 | /* OBSOLETE This program is free software; you can redistribute it and/or modify */ | |
7 | /* OBSOLETE it under the terms of the GNU General Public License as published by */ | |
8 | /* OBSOLETE the Free Software Foundation; either version 2 of the License, or */ | |
9 | /* OBSOLETE (at your option) any later version. */ | |
10 | /* OBSOLETE */ | |
11 | /* OBSOLETE This program is distributed in the hope that it will be useful, */ | |
12 | /* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */ | |
13 | /* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ | |
14 | /* OBSOLETE GNU General Public License for more details. */ | |
15 | /* OBSOLETE */ | |
16 | /* OBSOLETE You should have received a copy of the GNU General Public License */ | |
17 | /* OBSOLETE along with this program; if not, write to the Free Software */ | |
18 | /* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */ | |
19 | /* OBSOLETE */ | |
20 | /* OBSOLETE #define GOULD_PN */ | |
21 | /* OBSOLETE */ | |
22 | /* OBSOLETE #define TARGET_BYTE_ORDER BIG_ENDIAN */ | |
23 | /* OBSOLETE */ | |
24 | /* OBSOLETE /* This code appears in libraries on Gould machines. Ignore it. *x/ */ | |
25 | /* OBSOLETE #define IGNORE_SYMBOL(type) (type == N_ENTRY) */ | |
26 | /* OBSOLETE */ | |
27 | /* OBSOLETE /* We don't want the extra gnu symbols on the machine; */ | |
28 | /* OBSOLETE they will interfere with the shared segment symbols. *x/ */ | |
29 | /* OBSOLETE #define NO_GNU_STABS */ | |
30 | /* OBSOLETE */ | |
31 | /* OBSOLETE /* Macro for text-offset and data info (in PN a.out format). *x/ */ | |
c5aa993b JM |
32 | /* OBSOLETE #define TEXTINFO \ */ |
33 | /* OBSOLETE text_offset = N_TXTOFF (exec_coffhdr); \ */ | |
34 | /* OBSOLETE exec_data_offset = N_TXTOFF (exec_coffhdr) \ */ | |
35 | /* OBSOLETE + exec_aouthdr.a_text */ | |
c906108c SS |
36 | /* OBSOLETE */ |
37 | /* OBSOLETE /* Macro for number of symbol table entries (this used to be checked */ | |
38 | /* OBSOLETE in dbxread.c and caused the last psymtab to use this as the end of */ | |
39 | /* OBSOLETE text. I'm not sure whether it would still be necessary). *x/ */ | |
c5aa993b JM |
40 | /* OBSOLETE #define END_OF_TEXT_DEFAULT \ */ |
41 | /* OBSOLETE (0xffffff) */ | |
c906108c SS |
42 | /* OBSOLETE */ |
43 | /* OBSOLETE /* Macro for number of symbol table entries *x/ */ | |
c5aa993b JM |
44 | /* OBSOLETE #define NUMBER_OF_SYMBOLS \ */ |
45 | /* OBSOLETE (coffhdr.f_nsyms) */ | |
c906108c SS |
46 | /* OBSOLETE */ |
47 | /* OBSOLETE /* Macro for file-offset of symbol table (in usual a.out format). *x/ */ | |
c5aa993b JM |
48 | /* OBSOLETE #define SYMBOL_TABLE_OFFSET \ */ |
49 | /* OBSOLETE N_SYMOFF (coffhdr) */ | |
c906108c SS |
50 | /* OBSOLETE */ |
51 | /* OBSOLETE /* Macro for file-offset of string table (in usual a.out format). *x/ */ | |
c5aa993b JM |
52 | /* OBSOLETE #define STRING_TABLE_OFFSET \ */ |
53 | /* OBSOLETE (N_STROFF (coffhdr) + sizeof(int)) */ | |
c906108c SS |
54 | /* OBSOLETE */ |
55 | /* OBSOLETE /* Macro to store the length of the string table data in INTO. *x/ */ | |
c5aa993b JM |
56 | /* OBSOLETE #define READ_STRING_TABLE_SIZE(INTO) \ */ |
57 | /* OBSOLETE { INTO = hdr.a_stsize; } */ | |
c906108c SS |
58 | /* OBSOLETE */ |
59 | /* OBSOLETE /* Macro to declare variables to hold the file's header data. *x/ */ | |
c5aa993b JM |
60 | /* OBSOLETE #define DECLARE_FILE_HEADERS struct old_exec hdr; \ */ |
61 | /* OBSOLETE FILHDR coffhdr */ | |
c906108c SS |
62 | /* OBSOLETE */ |
63 | /* OBSOLETE /* Macro to read the header data from descriptor DESC and validate it. */ | |
64 | /* OBSOLETE NAME is the file name, for error messages. *x/ */ | |
c5aa993b JM |
65 | /* OBSOLETE #define READ_FILE_HEADERS(DESC, NAME) \ */ |
66 | /* OBSOLETE { val = myread (DESC, &coffhdr, sizeof coffhdr); \ */ | |
67 | /* OBSOLETE if (val < 0) \ */ | |
68 | /* OBSOLETE perror_with_name (NAME); \ */ | |
69 | /* OBSOLETE val = myread (DESC, &hdr, sizeof hdr); \ */ | |
70 | /* OBSOLETE if (val < 0) \ */ | |
71 | /* OBSOLETE perror_with_name (NAME); \ */ | |
72 | /* OBSOLETE if (coffhdr.f_magic != GNP1MAGIC) \ */ | |
73 | /* OBSOLETE error ("File \"%s\" not in coff executable format.", NAME); \ */ | |
74 | /* OBSOLETE if (N_BADMAG (hdr)) \ */ | |
c906108c SS |
75 | /* OBSOLETE error ("File \"%s\" not in executable format.", NAME); } */ |
76 | /* OBSOLETE */ | |
77 | /* OBSOLETE /* Define COFF and other symbolic names needed on NP1 *x/ */ | |
c5aa993b JM |
78 | /* OBSOLETE #define NS32GMAGIC GDPMAGIC */ |
79 | /* OBSOLETE #define NS32SMAGIC PN_MAGIC */ | |
c906108c SS |
80 | /* OBSOLETE */ |
81 | /* OBSOLETE /* Offset from address of function to start of its code. */ | |
82 | /* OBSOLETE Zero on most machines. *x/ */ | |
c5aa993b | 83 | /* OBSOLETE #define FUNCTION_START_OFFSET 4 */ |
c906108c SS |
84 | /* OBSOLETE */ |
85 | /* OBSOLETE /* Advance PC across any function entry prologue instructions */ | |
86 | /* OBSOLETE to reach some "real" code. One PN we can have one or two startup */ | |
87 | /* OBSOLETE sequences depending on the size of the local stack: */ | |
88 | /* OBSOLETE */ | |
89 | /* OBSOLETE Either: */ | |
90 | /* OBSOLETE "suabr b2, #" */ | |
91 | /* OBSOLETE of */ | |
92 | /* OBSOLETE "lil r4, #", "suabr b2, #(r4)" */ | |
93 | /* OBSOLETE */ | |
94 | /* OBSOLETE "lwbr b6, #", "stw r1, 8(b2)" */ | |
95 | /* OBSOLETE Optional "stwbr b3, c(b2)" */ | |
96 | /* OBSOLETE Optional "trr r2,r7" (Gould first argument register passing) */ | |
97 | /* OBSOLETE or */ | |
98 | /* OBSOLETE Optional "stw r2,8(b3)" (Gould first argument register passing) */ | |
99 | /* OBSOLETE *x/ */ | |
c5aa993b JM |
100 | /* OBSOLETE #define SKIP_PROLOGUE(pc) { \ */ |
101 | /* OBSOLETE register int op = read_memory_integer ((pc), 4); \ */ | |
102 | /* OBSOLETE if ((op & 0xffff0000) == 0x580B0000) { \ */ | |
103 | /* OBSOLETE pc += 4; \ */ | |
104 | /* OBSOLETE op = read_memory_integer ((pc), 4); \ */ | |
105 | /* OBSOLETE if ((op & 0xffff0000) == 0x59400000) { \ */ | |
106 | /* OBSOLETE pc += 4; \ */ | |
107 | /* OBSOLETE op = read_memory_integer ((pc), 4); \ */ | |
108 | /* OBSOLETE if ((op & 0xffff0000) == 0x5F000000) { \ */ | |
109 | /* OBSOLETE pc += 4; \ */ | |
110 | /* OBSOLETE op = read_memory_integer ((pc), 4); \ */ | |
111 | /* OBSOLETE if (op == 0xD4820008) { \ */ | |
112 | /* OBSOLETE pc += 4; \ */ | |
113 | /* OBSOLETE op = read_memory_integer ((pc), 4); \ */ | |
114 | /* OBSOLETE if (op == 0x5582000C) { \ */ | |
115 | /* OBSOLETE pc += 4; \ */ | |
116 | /* OBSOLETE op = read_memory_integer ((pc), 2); \ */ | |
117 | /* OBSOLETE if (op == 0x2fa0) { \ */ | |
118 | /* OBSOLETE pc += 2; \ */ | |
119 | /* OBSOLETE } else { \ */ | |
120 | /* OBSOLETE op = read_memory_integer ((pc), 4); \ */ | |
121 | /* OBSOLETE if (op == 0xd5030008) { \ */ | |
122 | /* OBSOLETE pc += 4; \ */ | |
123 | /* OBSOLETE } \ */ | |
124 | /* OBSOLETE } \ */ | |
125 | /* OBSOLETE } else { \ */ | |
126 | /* OBSOLETE op = read_memory_integer ((pc), 2); \ */ | |
127 | /* OBSOLETE if (op == 0x2fa0) { \ */ | |
128 | /* OBSOLETE pc += 2; \ */ | |
129 | /* OBSOLETE } \ */ | |
130 | /* OBSOLETE } \ */ | |
131 | /* OBSOLETE } \ */ | |
132 | /* OBSOLETE } \ */ | |
133 | /* OBSOLETE } \ */ | |
134 | /* OBSOLETE } \ */ | |
135 | /* OBSOLETE if ((op & 0xffff0000) == 0x59000000) { \ */ | |
136 | /* OBSOLETE pc += 4; \ */ | |
137 | /* OBSOLETE op = read_memory_integer ((pc), 4); \ */ | |
138 | /* OBSOLETE if ((op & 0xffff0000) == 0x5F000000) { \ */ | |
139 | /* OBSOLETE pc += 4; \ */ | |
140 | /* OBSOLETE op = read_memory_integer ((pc), 4); \ */ | |
141 | /* OBSOLETE if (op == 0xD4820008) { \ */ | |
142 | /* OBSOLETE pc += 4; \ */ | |
143 | /* OBSOLETE op = read_memory_integer ((pc), 4); \ */ | |
144 | /* OBSOLETE if (op == 0x5582000C) { \ */ | |
145 | /* OBSOLETE pc += 4; \ */ | |
146 | /* OBSOLETE op = read_memory_integer ((pc), 2); \ */ | |
147 | /* OBSOLETE if (op == 0x2fa0) { \ */ | |
148 | /* OBSOLETE pc += 2; \ */ | |
149 | /* OBSOLETE } else { \ */ | |
150 | /* OBSOLETE op = read_memory_integer ((pc), 4); \ */ | |
151 | /* OBSOLETE if (op == 0xd5030008) { \ */ | |
152 | /* OBSOLETE pc += 4; \ */ | |
153 | /* OBSOLETE } \ */ | |
154 | /* OBSOLETE } \ */ | |
155 | /* OBSOLETE } else { \ */ | |
156 | /* OBSOLETE op = read_memory_integer ((pc), 2); \ */ | |
157 | /* OBSOLETE if (op == 0x2fa0) { \ */ | |
158 | /* OBSOLETE pc += 2; \ */ | |
159 | /* OBSOLETE } \ */ | |
160 | /* OBSOLETE } \ */ | |
161 | /* OBSOLETE } \ */ | |
162 | /* OBSOLETE } \ */ | |
163 | /* OBSOLETE } \ */ | |
c906108c SS |
164 | /* OBSOLETE } */ |
165 | /* OBSOLETE */ | |
166 | /* OBSOLETE /* Immediately after a function call, return the saved pc. */ | |
167 | /* OBSOLETE Can't go through the frames for this because on some machines */ | |
168 | /* OBSOLETE the new frame is not set up until the new function executes */ | |
169 | /* OBSOLETE some instructions. True on PN! Return address is in R1. */ | |
170 | /* OBSOLETE Note: true return location is 4 bytes past R1! *x/ */ | |
171 | /* OBSOLETE #define SAVED_PC_AFTER_CALL(frame) \ */ | |
c5aa993b | 172 | /* OBSOLETE (read_register(R1_REGNUM) + 4) */ |
c906108c SS |
173 | /* OBSOLETE */ |
174 | /* OBSOLETE /* Address of end of stack space. *x/ */ | |
c5aa993b | 175 | /* OBSOLETE #define STACK_END_ADDR 0x480000 */ |
c906108c SS |
176 | /* OBSOLETE */ |
177 | /* OBSOLETE /* Stack grows downward. *x/ */ | |
178 | /* OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) */ | |
179 | /* OBSOLETE */ | |
180 | /* OBSOLETE /* Sequence of bytes for breakpoint instruction. *x/ */ | |
c5aa993b | 181 | /* OBSOLETE #define BREAKPOINT {0x28, 0x09} */ |
c906108c SS |
182 | /* OBSOLETE */ |
183 | /* OBSOLETE /* Amount PC must be decremented by after a breakpoint. */ | |
184 | /* OBSOLETE This is often the number of bytes in BREAKPOINT */ | |
185 | /* OBSOLETE but not always. *x/ */ | |
c5aa993b | 186 | /* OBSOLETE #define DECR_PC_AFTER_BREAK 2 */ |
c906108c SS |
187 | /* OBSOLETE */ |
188 | /* OBSOLETE /* Return 1 if P points to an invalid floating point value. *x/ */ | |
c5aa993b | 189 | /* OBSOLETE #define INVALID_FLOAT(p, len) ((*(short *)p & 0xff80) == 0x8000) */ |
c906108c SS |
190 | /* OBSOLETE */ |
191 | /* OBSOLETE /* Say how long (ordinary) registers are. This is a piece of bogosity */ | |
192 | /* OBSOLETE used in push_word and a few other places; REGISTER_RAW_SIZE is the */ | |
193 | /* OBSOLETE real way to know how big a register is. *x/ */ | |
194 | /* OBSOLETE */ | |
195 | /* OBSOLETE #define REGISTER_SIZE 4 */ | |
196 | /* OBSOLETE */ | |
197 | /* OBSOLETE /* Number of machine registers *x/ */ | |
c5aa993b JM |
198 | /* OBSOLETE #define NUM_REGS 19 */ |
199 | /* OBSOLETE #define NUM_GEN_REGS 16 */ | |
200 | /* OBSOLETE #define NUM_CPU_REGS 3 */ | |
c906108c SS |
201 | /* OBSOLETE */ |
202 | /* OBSOLETE /* Initializer for an array of names of registers. */ | |
203 | /* OBSOLETE There should be NUM_REGS strings in this initializer. *x/ */ | |
204 | /* OBSOLETE #define REGISTER_NAMES { \ */ | |
205 | /* OBSOLETE "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ */ | |
206 | /* OBSOLETE "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", \ */ | |
207 | /* OBSOLETE "sp", "ps", "pc", \ */ | |
208 | /* OBSOLETE } */ | |
209 | /* OBSOLETE */ | |
210 | /* OBSOLETE /* Register numbers of various important registers. */ | |
211 | /* OBSOLETE Note that some of these values are "real" register numbers, */ | |
212 | /* OBSOLETE and correspond to the general registers of the machine, */ | |
213 | /* OBSOLETE and some are "phony" register numbers which are too large */ | |
214 | /* OBSOLETE to be actual register numbers as far as the user is concerned */ | |
215 | /* OBSOLETE but do serve to get the desired values when passed to read_register. *x/ */ | |
c5aa993b JM |
216 | /* OBSOLETE #define R1_REGNUM 1 /* Gr1 => return address of caller *x/ */ |
217 | /* OBSOLETE #define R4_REGNUM 4 /* Gr4 => register save area *x/ */ | |
218 | /* OBSOLETE #define R5_REGNUM 5 /* Gr5 => register save area *x/ */ | |
219 | /* OBSOLETE #define R6_REGNUM 6 /* Gr6 => register save area *x/ */ | |
220 | /* OBSOLETE #define R7_REGNUM 7 /* Gr7 => register save area *x/ */ | |
221 | /* OBSOLETE #define B1_REGNUM 9 /* Br1 => start of this code routine *x/ */ | |
222 | /* OBSOLETE #define FP_REGNUM 10 /* Br2 == (sp) *x/ */ | |
223 | /* OBSOLETE #define AP_REGNUM 11 /* Br3 == (ap) *x/ */ | |
224 | /* OBSOLETE #define SP_REGNUM 16 /* A copy of Br2 saved in trap *x/ */ | |
225 | /* OBSOLETE #define PS_REGNUM 17 /* Contains processor status *x/ */ | |
226 | /* OBSOLETE #define PC_REGNUM 18 /* Contains program counter *x/ */ | |
c906108c SS |
227 | /* OBSOLETE */ |
228 | /* OBSOLETE /* Total amount of space needed to store our copies of the machine's */ | |
229 | /* OBSOLETE register state, the array `registers'. *x/ */ | |
c5aa993b | 230 | /* OBSOLETE #define REGISTER_BYTES (NUM_GEN_REGS*4 + NUM_CPU_REGS*4) */ |
c906108c SS |
231 | /* OBSOLETE */ |
232 | /* OBSOLETE /* Index within `registers' of the first byte of the space for */ | |
233 | /* OBSOLETE register N. *x/ */ | |
c5aa993b | 234 | /* OBSOLETE #define REGISTER_BYTE(N) ((N) * 4) */ |
c906108c SS |
235 | /* OBSOLETE */ |
236 | /* OBSOLETE /* Number of bytes of storage in the actual machine representation */ | |
237 | /* OBSOLETE for register N. On the PN, all normal regs are 4 bytes. *x/ */ | |
c5aa993b | 238 | /* OBSOLETE #define REGISTER_RAW_SIZE(N) (4) */ |
c906108c SS |
239 | /* OBSOLETE */ |
240 | /* OBSOLETE /* Number of bytes of storage in the program's representation */ | |
241 | /* OBSOLETE for register N. On the PN, all regs are 4 bytes. *x/ */ | |
c5aa993b | 242 | /* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) (4) */ |
c906108c SS |
243 | /* OBSOLETE */ |
244 | /* OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. *x/ */ | |
c5aa993b | 245 | /* OBSOLETE #define MAX_REGISTER_RAW_SIZE (4) */ |
c906108c SS |
246 | /* OBSOLETE */ |
247 | /* OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. *x/ */ | |
c5aa993b | 248 | /* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE (4) */ |
c906108c SS |
249 | /* OBSOLETE */ |
250 | /* OBSOLETE /* Return the GDB type object for the "standard" data type */ | |
251 | /* OBSOLETE of data in register N. *x/ */ | |
c5aa993b | 252 | /* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) (builtin_type_int) */ |
c906108c SS |
253 | /* OBSOLETE */ |
254 | /* OBSOLETE /* Store the address of the place in which to copy the structure the */ | |
255 | /* OBSOLETE subroutine will return. This is called from call_function. */ | |
256 | /* OBSOLETE */ | |
257 | /* OBSOLETE On this machine this is a no-op, because gcc isn't used on it */ | |
258 | /* OBSOLETE yet. So this calling convention is not used. *x/ */ | |
259 | /* OBSOLETE */ | |
260 | /* OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) */ | |
261 | /* OBSOLETE */ | |
262 | /* OBSOLETE /* Extract from an arrary REGBUF containing the (raw) register state */ | |
263 | /* OBSOLETE a function return value of type TYPE, and copy that, in virtual format, */ | |
264 | /* OBSOLETE into VALBUF. *x/ */ | |
265 | /* OBSOLETE */ | |
266 | /* OBSOLETE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ */ | |
c5aa993b | 267 | /* OBSOLETE memcpy (VALBUF, REGBUF, TYPE_LENGTH (TYPE)) */ |
c906108c SS |
268 | /* OBSOLETE */ |
269 | /* OBSOLETE /* Write into appropriate registers a function return value */ | |
270 | /* OBSOLETE of type TYPE, given in virtual format. *x/ */ | |
271 | /* OBSOLETE */ | |
272 | /* OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ */ | |
c5aa993b | 273 | /* OBSOLETE write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)) */ |
c906108c SS |
274 | /* OBSOLETE */ |
275 | /* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state */ | |
276 | /* OBSOLETE the address in which a function should return its structure value, */ | |
277 | /* OBSOLETE as a CORE_ADDR (or an expression that can be used as one). *x/ */ | |
278 | /* OBSOLETE */ | |
279 | /* OBSOLETE #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF)) */ | |
280 | /* OBSOLETE */ | |
281 | /* OBSOLETE \f */ | |
282 | /* OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame */ | |
283 | /* OBSOLETE (its caller). *x/ */ | |
284 | /* OBSOLETE */ | |
285 | /* OBSOLETE /* FRAME_CHAIN takes a frame's nominal address */ | |
286 | /* OBSOLETE and produces the frame's chain-pointer. */ | |
287 | /* OBSOLETE */ | |
288 | /* OBSOLETE However, if FRAME_CHAIN_VALID returns zero, */ | |
289 | /* OBSOLETE it means the given frame is the outermost one and has no caller. *x/ */ | |
290 | /* OBSOLETE */ | |
291 | /* OBSOLETE /* In the case of the NPL, the frame's norminal address is Br2 and the */ | |
292 | /* OBSOLETE previous routines frame is up the stack X bytes, where X is the */ | |
293 | /* OBSOLETE value stored in the code function header xA(Br1). *x/ */ | |
c5aa993b | 294 | /* OBSOLETE #define FRAME_CHAIN(thisframe) (findframe(thisframe)) */ |
c906108c SS |
295 | /* OBSOLETE */ |
296 | /* OBSOLETE extern int gould_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); */ | |
297 | /* OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) gould_frame_chain_valid (chain, thisframe) */ | |
298 | /* OBSOLETE */ | |
299 | /* OBSOLETE /* Define other aspects of the stack frame on NPL. *x/ */ | |
300 | /* OBSOLETE #define FRAME_SAVED_PC(frame) \ */ | |
c5aa993b | 301 | /* OBSOLETE (read_memory_integer ((frame)->frame + 8, 4)) */ |
c906108c SS |
302 | /* OBSOLETE */ |
303 | /* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) \ */ | |
c5aa993b JM |
304 | /* OBSOLETE ((fi)->next ? \ */ |
305 | /* OBSOLETE read_memory_integer ((fi)->frame + 12, 4) : \ */ | |
306 | /* OBSOLETE read_register (AP_REGNUM)) */ | |
c906108c | 307 | /* OBSOLETE */ |
c5aa993b | 308 | /* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame + 80) */ |
c906108c SS |
309 | /* OBSOLETE */ |
310 | /* OBSOLETE /* Set VAL to the number of args passed to frame described by FI. */ | |
311 | /* OBSOLETE Can set VAL to -1, meaning no way to tell. *x/ */ | |
312 | /* OBSOLETE */ | |
313 | /* OBSOLETE /* We can check the stab info to see how */ | |
314 | /* OBSOLETE many arg we have. No info in stack will tell us *x/ */ | |
c5aa993b | 315 | /* OBSOLETE #define FRAME_NUM_ARGS(fi) (findarg(fi)) */ |
c906108c SS |
316 | /* OBSOLETE */ |
317 | /* OBSOLETE /* Return number of bytes at start of arglist that are not really args. *x/ */ | |
c5aa993b | 318 | /* OBSOLETE #define FRAME_ARGS_SKIP 8 */ |
c906108c SS |
319 | /* OBSOLETE */ |
320 | /* OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, */ | |
321 | /* OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO. */ | |
322 | /* OBSOLETE This includes special registers such as pc and fp saved in special */ | |
323 | /* OBSOLETE ways in the stack frame. sp is even more special: */ | |
324 | /* OBSOLETE the address we return for it IS the sp for the next frame. *x/ */ | |
325 | /* OBSOLETE */ | |
c5aa993b | 326 | /* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ */ |
c906108c | 327 | /* OBSOLETE { \ */ |
c5aa993b JM |
328 | /* OBSOLETE memset (&frame_saved_regs, '\0', sizeof frame_saved_regs); \ */ |
329 | /* OBSOLETE (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 8; \ */ | |
330 | /* OBSOLETE (frame_saved_regs).regs[R4_REGNUM] = (frame_info)->frame + 0x30; \ */ | |
331 | /* OBSOLETE (frame_saved_regs).regs[R5_REGNUM] = (frame_info)->frame + 0x34; \ */ | |
332 | /* OBSOLETE (frame_saved_regs).regs[R6_REGNUM] = (frame_info)->frame + 0x38; \ */ | |
333 | /* OBSOLETE (frame_saved_regs).regs[R7_REGNUM] = (frame_info)->frame + 0x3C; \ */ | |
c906108c SS |
334 | /* OBSOLETE } */ |
335 | /* OBSOLETE \f */ | |
336 | /* OBSOLETE /* Things needed for making the inferior call functions. *x/ */ | |
337 | /* OBSOLETE */ | |
338 | /* OBSOLETE /* Push an empty stack frame, to record the current PC, etc. *x/ */ | |
339 | /* OBSOLETE */ | |
340 | /* OBSOLETE #define PUSH_DUMMY_FRAME \ */ | |
c5aa993b JM |
341 | /* OBSOLETE { register CORE_ADDR sp = read_register (SP_REGNUM); \ */ |
342 | /* OBSOLETE register int regnum; \ */ | |
343 | /* OBSOLETE sp = push_word (sp, read_register (PC_REGNUM)); \ */ | |
344 | /* OBSOLETE sp = push_word (sp, read_register (FP_REGNUM)); \ */ | |
345 | /* OBSOLETE write_register (FP_REGNUM, sp); \ */ | |
346 | /* OBSOLETE for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--) \ */ | |
347 | /* OBSOLETE sp = push_word (sp, read_register (regnum)); \ */ | |
348 | /* OBSOLETE sp = push_word (sp, read_register (PS_REGNUM)); \ */ | |
c906108c SS |
349 | /* OBSOLETE write_register (SP_REGNUM, sp); } */ |
350 | /* OBSOLETE */ | |
351 | /* OBSOLETE /* Discard from the stack the innermost frame, */ | |
352 | /* OBSOLETE restoring all saved registers. *x/ */ | |
353 | /* OBSOLETE */ | |
354 | /* OBSOLETE #define POP_FRAME \ */ | |
c5aa993b JM |
355 | /* OBSOLETE { register struct frame_info *frame = get_current_frame (); \ */ |
356 | /* OBSOLETE register CORE_ADDR fp; \ */ | |
357 | /* OBSOLETE register int regnum; \ */ | |
358 | /* OBSOLETE struct frame_saved_regs fsr; \ */ | |
359 | /* OBSOLETE struct frame_info *fi; \ */ | |
360 | /* OBSOLETE fp = frame->frame; \ */ | |
361 | /* OBSOLETE get_frame_saved_regs (frame, &fsr); \ */ | |
362 | /* OBSOLETE for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--) \ */ | |
363 | /* OBSOLETE if (fsr.regs[regnum]) \ */ | |
c906108c | 364 | /* OBSOLETE write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \ */ |
c5aa993b | 365 | /* OBSOLETE if (fsr.regs[PS_REGNUM]) \ */ |
c906108c | 366 | /* OBSOLETE write_register (PS_REGNUM, read_memory_integer (fsr.regs[PS_REGNUM], 4)); \ */ |
c5aa993b | 367 | /* OBSOLETE write_register (FP_REGNUM, read_memory_integer (fp, 4)); \ */ |
c906108c | 368 | /* OBSOLETE write_register (PC_REGNUM, read_memory_integer (fp + 4, 4)); \ */ |
c5aa993b JM |
369 | /* OBSOLETE write_register (SP_REGNUM, fp + 8); \ */ |
370 | /* OBSOLETE flush_cached_frames (); \ */ | |
c906108c SS |
371 | /* OBSOLETE } */ |
372 | /* OBSOLETE */ | |
373 | /* OBSOLETE /* This sequence of words is the instructions: */ | |
374 | /* OBSOLETE halt */ | |
375 | /* OBSOLETE halt */ | |
376 | /* OBSOLETE halt */ | |
377 | /* OBSOLETE halt */ | |
c5aa993b JM |
378 | /* OBSOLETE suabr b2, #<stacksize> */ |
379 | /* OBSOLETE lwbr b6, #con */ | |
380 | /* OBSOLETE stw r1, 8(b2) - save caller address, do we care? */ | |
381 | /* OBSOLETE lw r2, 60(b2) - arg1 */ | |
382 | /* OBSOLETE labr b3, 50(b2) */ | |
383 | /* OBSOLETE std r4, 30(b2) - save r4-r7 */ | |
384 | /* OBSOLETE std r6, 38(b2) */ | |
385 | /* OBSOLETE lwbr b1, #<func> - load function call address */ | |
386 | /* OBSOLETE brlnk r1, 8(b1) - call function */ | |
c906108c SS |
387 | /* OBSOLETE halt */ |
388 | /* OBSOLETE halt */ | |
c5aa993b JM |
389 | /* OBSOLETE ld r4, 30(b2) - restore r4-r7 */ |
390 | /* OBSOLETE ld r6, 38(b2) */ | |
c906108c SS |
391 | /* OBSOLETE */ |
392 | /* OBSOLETE Setup our stack frame, load argumemts, call and then restore registers. */ | |
393 | /* OBSOLETE *x/ */ | |
394 | /* OBSOLETE */ | |
395 | /* OBSOLETE /* FIXME: The below defines an m68k CALL_DUMMY, which looks nothing like what */ | |
396 | /* OBSOLETE is documented above. *x/ */ | |
397 | /* OBSOLETE */ | |
398 | /* OBSOLETE #define CALL_DUMMY {0xf227e0ff, 0x48e7fffc, 0x426742e7, 0x4eb93232, 0x3232dffc, 0x69696969, 0x4e4f4e71} */ | |
399 | /* OBSOLETE */ | |
400 | /* OBSOLETE #define CALL_DUMMY_LENGTH 28 */ | |
401 | /* OBSOLETE */ | |
402 | /* OBSOLETE #define CALL_DUMMY_START_OFFSET 12 */ | |
403 | /* OBSOLETE */ | |
404 | /* OBSOLETE /* Insert the specified number of args and function address */ | |
405 | /* OBSOLETE into a call sequence of the above form stored at DUMMYNAME. *x/ */ | |
406 | /* OBSOLETE */ | |
407 | /* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ */ | |
408 | /* OBSOLETE { *(int *)((char *) dummyname + 20) = nargs * 4; \ */ | |
409 | /* OBSOLETE *(int *)((char *) dummyname + 14) = fun; } */ |