Commit | Line | Data |
---|---|---|
dd3b648e RP |
1 | /* Parameters for execution on a 3b1. |
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 | #define HOST_BYTE_ORDER BIG_ENDIAN | |
21 | ||
22 | #define HAVE_TERMIO | |
23 | #define USG | |
24 | ||
25 | #define MAXPATHLEN 200 | |
26 | ||
27 | /* This is the amount to subtract from u.u_ar0 | |
28 | to get the offset in the core file of the register values. */ | |
29 | ||
30 | #define KERNEL_U_ADDR 0x70000 | |
31 | ||
32 | #define REGISTER_U_ADDR(addr, blockend, regno) \ | |
33 | { addr = blockend + regno * 4; } | |
34 | \f | |
35 | /* Interface definitions for kernel debugger KDB. */ | |
36 | ||
37 | /* Map machine fault codes into signal numbers. | |
38 | First subtract 0, divide by 4, then index in a table. | |
39 | Faults for which the entry in this table is 0 | |
40 | are not handled by KDB; the program's own trap handler | |
41 | gets to handle then. */ | |
42 | ||
43 | #define FAULT_CODE_ORIGIN 0 | |
44 | #define FAULT_CODE_UNITS 4 | |
45 | #define FAULT_TABLE \ | |
46 | { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ | |
47 | 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ | |
48 | 0, 0, 0, 0, 0, 0, 0, 0, \ | |
49 | SIGILL } | |
50 | ||
51 | /* Start running with a stack stretching from BEG to END. | |
52 | BEG and END should be symbols meaningful to the assembler. | |
53 | This is used only for kdb. */ | |
54 | ||
55 | #define INIT_STACK(beg, end) \ | |
56 | { asm (".globl end"); \ | |
57 | asm ("movel $ end, sp"); \ | |
58 | asm ("clrl fp"); } | |
59 | ||
60 | /* Push the frame pointer register on the stack. */ | |
61 | #define PUSH_FRAME_PTR \ | |
62 | asm ("movel fp, -(sp)"); | |
63 | ||
64 | /* Copy the top-of-stack to the frame pointer register. */ | |
65 | #define POP_FRAME_PTR \ | |
66 | asm ("movl (sp), fp"); | |
67 | ||
68 | /* After KDB is entered by a fault, push all registers | |
69 | that GDB thinks about (all NUM_REGS of them), | |
70 | so that they appear in order of ascending GDB register number. | |
71 | The fault code will be on the stack beyond the last register. */ | |
72 | ||
73 | #define PUSH_REGISTERS \ | |
74 | { asm ("clrw -(sp)"); \ | |
75 | asm ("pea 10(sp)"); \ | |
76 | asm ("movem $ 0xfffe,-(sp)"); } | |
77 | ||
78 | /* Assuming the registers (including processor status) have been | |
79 | pushed on the stack in order of ascending GDB register number, | |
80 | restore them and return to the address in the saved PC register. */ | |
81 | ||
82 | #define POP_REGISTERS \ | |
83 | { asm ("subil $8,28(sp)"); \ | |
84 | asm ("movem (sp),$ 0xffff"); \ | |
85 | asm ("rte"); } | |
86 | ||
87 | #endif |