Commit | Line | Data |
---|---|---|
dd3b648e RP |
1 | /* Parameters for execution on a Hewlett-Packard 9000/300, running bsd. |
2 | Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of GDB. | |
5 | ||
6 | GDB is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 1, or (at your option) | |
9 | any later version. | |
10 | ||
11 | GDB is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with GDB; see the file COPYING. If not, write to | |
18 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
19 | ||
20 | /* | |
21 | * Configuration file for HP9000/300 series machine running | |
22 | * University of Utah's 4.3bsd port. This is NOT for HP-UX. | |
23 | * Problems to hpbsd-bugs@cs.utah.edu | |
24 | */ | |
25 | ||
26 | /* Define this if the C compiler puts an underscore at the front | |
27 | of external names before giving them to the linker. */ | |
28 | ||
29 | #define NAMES_HAVE_UNDERSCORE | |
30 | ||
31 | /* Debugger information will be in DBX format. */ | |
32 | ||
33 | #define READ_DBX_FORMAT | |
34 | ||
35 | #define TARGET_NBPG 4096 | |
36 | #define TARGET_UPAGES 3 | |
37 | ||
38 | /* On the HP300, sigtramp is in the u area. Gak! User struct is not | |
39 | mapped to the same virtual address in user/kernel address space | |
40 | (hence STACK_END_ADDR as opposed to KERNEL_U_ADDR). This tests | |
41 | for the whole u area, since we don't necessarily have hp300bsd | |
42 | include files around. */ | |
43 | #define IN_SIGTRAMP(pc, name) \ | |
44 | ((pc) >= STACK_END_ADDR \ | |
45 | && (pc) < STACK_END_ADDR + TARGET_UPAGES * TARGET_NBPG \ | |
46 | ) | |
47 | ||
48 | /* Address of end of stack space. */ | |
49 | ||
50 | #define STACK_END_ADDR 0xfff00000 | |
51 | ||
52 | /* Sequence of bytes for breakpoint instruction. */ | |
53 | ||
54 | #define BREAKPOINT {0x4e, 0x42} | |
55 | ||
56 | \f | |
57 | /* Things needed for making the inferior call functions. */ | |
58 | ||
59 | /* Push an empty stack frame, to record the current PC, etc. */ | |
60 | ||
61 | #define PUSH_DUMMY_FRAME \ | |
62 | { register CORE_ADDR sp = read_register (SP_REGNUM); \ | |
63 | register int regnum; \ | |
64 | char raw_buffer[12]; \ | |
65 | sp = push_word (sp, read_register (PC_REGNUM)); \ | |
66 | sp = push_word (sp, read_register (FP_REGNUM)); \ | |
67 | write_register (FP_REGNUM, sp); \ | |
68 | for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--) \ | |
69 | { read_register_gen (regnum, raw_buffer); \ | |
70 | sp = push_bytes (sp, raw_buffer, 12); } \ | |
71 | for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--) \ | |
72 | sp = push_word (sp, read_register (regnum)); \ | |
73 | sp = push_word (sp, read_register (PS_REGNUM)); \ | |
74 | write_register (SP_REGNUM, sp); } | |
75 | ||
76 | /* Discard from the stack the innermost frame, | |
77 | restoring all saved registers. */ | |
78 | ||
79 | #define POP_FRAME \ | |
80 | { register FRAME frame = get_current_frame (); \ | |
81 | register CORE_ADDR fp; \ | |
82 | register int regnum; \ | |
83 | struct frame_saved_regs fsr; \ | |
84 | struct frame_info *fi; \ | |
85 | char raw_buffer[12]; \ | |
86 | fi = get_frame_info (frame); \ | |
87 | fp = fi->frame; \ | |
88 | get_frame_saved_regs (fi, &fsr); \ | |
89 | for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--) \ | |
90 | if (fsr.regs[regnum]) \ | |
91 | { read_memory (fsr.regs[regnum], raw_buffer, 12); \ | |
92 | write_register_bytes (REGISTER_BYTE (regnum), raw_buffer, 12); }\ | |
93 | for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--) \ | |
94 | if (fsr.regs[regnum]) \ | |
95 | write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \ | |
96 | if (fsr.regs[PS_REGNUM]) \ | |
97 | write_register (PS_REGNUM, read_memory_integer (fsr.regs[PS_REGNUM], 4)); \ | |
98 | write_register (FP_REGNUM, read_memory_integer (fp, 4)); \ | |
99 | write_register (PC_REGNUM, read_memory_integer (fp + 4, 4)); \ | |
100 | write_register (SP_REGNUM, fp + 8); \ | |
101 | flush_cached_frames (); \ | |
102 | set_current_frame (create_new_frame (read_register (FP_REGNUM),\ | |
103 | read_pc ())); } | |
104 | ||
105 | /* This sequence of words is the instructions | |
106 | fmovem 0xff,-(sp) | |
107 | moveml 0xfffc,-(sp) | |
108 | clrw -(sp) | |
109 | movew ccr,-(sp) | |
110 | /..* The arguments are pushed at this point by GDB; | |
111 | no code is needed in the dummy for this. | |
112 | The CALL_DUMMY_START_OFFSET gives the position of | |
113 | the following jsr instruction. *../ | |
114 | jsr @#32323232 | |
115 | addl #69696969,sp | |
116 | trap #2 | |
117 | nop | |
118 | Note this is 28 bytes. | |
119 | We actually start executing at the jsr, since the pushing of the | |
120 | registers is done by PUSH_DUMMY_FRAME. If this were real code, | |
121 | the arguments for the function called by the jsr would be pushed | |
122 | between the moveml and the jsr, and we could allow it to execute through. | |
123 | But the arguments have to be pushed by GDB after the PUSH_DUMMY_FRAME is done, | |
124 | and we cannot allow the moveml to push the registers again lest they be | |
125 | taken for the arguments. */ | |
126 | ||
127 | #define CALL_DUMMY {0xf227e0ff, 0x48e7fffc, 0x426742e7, 0x4eb93232, 0x3232dffc, 0x69696969, 0x4e424e71} | |
128 | ||
129 | #define CALL_DUMMY_LENGTH 28 | |
130 | ||
131 | #define CALL_DUMMY_START_OFFSET 12 | |
132 | ||
133 | /* Insert the specified number of args and function address | |
134 | into a call sequence of the above form stored at DUMMYNAME. */ | |
135 | ||
136 | #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ | |
137 | { *(int *)((char *) dummyname + 20) = nargs * 4; \ | |
138 | *(int *)((char *) dummyname + 14) = fun; } | |
139 | \f | |
140 | #define HAVE_68881 | |
141 | ||
142 | #include "tm-68k.h" |