]>
Commit | Line | Data |
---|---|---|
dd3b648e RP |
1 | /* Parameters for execution on a Gould PN, for GDB, the GNU debugger. |
2 | Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of GDB. | |
5 | ||
99a7de40 | 6 | This program is free software; you can redistribute it and/or modify |
dd3b648e | 7 | it under the terms of the GNU General Public License as published by |
99a7de40 JG |
8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | |
dd3b648e | 10 | |
99a7de40 | 11 | This program is distributed in the hope that it will be useful, |
dd3b648e RP |
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 | |
99a7de40 JG |
17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
dd3b648e RP |
19 | |
20 | #define HOST_BYTE_ORDER BIG_ENDIAN | |
21 | ||
22 | /* Get rid of any system-imposed stack limit if possible. */ | |
23 | #define SET_STACK_LIMIT_HUGE | |
24 | ||
dd3b648e RP |
25 | /* Address of U in kernel space */ |
26 | #define KERNEL_U_ADDR 0x3fc000 | |
df6335e1 JG |
27 | |
28 | /* This is a piece of magic that is given a register number REGNO | |
29 | and as BLOCKEND the address in the system of the end of the user structure | |
30 | and stores in ADDR the address in the kernel or core dump | |
31 | of that register. */ | |
32 | #define REGISTER_U_ADDR(addr, blockend, regno) { \ | |
33 | addr = blockend + regno * 4; \ | |
34 | if (regno == PC_REGNUM) addr = blockend - 8 * 4; \ | |
35 | if (regno == PS_REGNUM) addr = blockend - 7 * 4; \ | |
36 | if (regno == SP_REGNUM) addr = blockend - 6 * 4; \ | |
37 | } | |
dd3b648e | 38 | \f |
df6335e1 | 39 | /* No KDB support, Yet! */ |
dd3b648e RP |
40 | /* Interface definitions for kernel debugger KDB. */ |
41 | ||
42 | /* Map machine fault codes into signal numbers. | |
43 | First subtract 0, divide by 4, then index in a table. | |
44 | Faults for which the entry in this table is 0 | |
45 | are not handled by KDB; the program's own trap handler | |
46 | gets to handle then. */ | |
47 | ||
48 | #define FAULT_CODE_ORIGIN 0 | |
49 | #define FAULT_CODE_UNITS 4 | |
50 | #define FAULT_TABLE \ | |
51 | { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ | |
52 | 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ | |
53 | 0, 0, 0, 0, 0, 0, 0, 0, \ | |
54 | SIGILL } | |
55 | ||
56 | /* Start running with a stack stretching from BEG to END. | |
57 | BEG and END should be symbols meaningful to the assembler. | |
58 | This is used only for kdb. */ | |
59 | ||
60 | #define INIT_STACK(beg, end) \ | |
61 | { asm (".globl end"); \ | |
62 | asm ("movel $ end, sp"); \ | |
63 | asm ("clrl fp"); } | |
64 | ||
65 | /* Push the frame pointer register on the stack. */ | |
66 | #define PUSH_FRAME_PTR \ | |
67 | asm ("movel fp, -(sp)"); | |
68 | ||
69 | /* Copy the top-of-stack to the frame pointer register. */ | |
70 | #define POP_FRAME_PTR \ | |
71 | asm ("movl (sp), fp"); | |
72 | ||
73 | /* After KDB is entered by a fault, push all registers | |
74 | that GDB thinks about (all NUM_REGS of them), | |
75 | so that they appear in order of ascending GDB register number. | |
76 | The fault code will be on the stack beyond the last register. */ | |
77 | ||
78 | #define PUSH_REGISTERS \ | |
79 | { asm ("clrw -(sp)"); \ | |
80 | asm ("pea 10(sp)"); \ | |
81 | asm ("movem $ 0xfffe,-(sp)"); } | |
82 | ||
83 | /* Assuming the registers (including processor status) have been | |
84 | pushed on the stack in order of ascending GDB register number, | |
85 | restore them and return to the address in the saved PC register. */ | |
86 | ||
87 | #define POP_REGISTERS \ | |
88 | { asm ("subil $8,28(sp)"); \ | |
89 | asm ("movem (sp),$ 0xffff"); \ | |
90 | asm ("rte"); } |