Commit | Line | Data |
---|---|---|
5076de82 FF |
1 | /* Definitions to make GDB run on an ARM under RISCiX (4.3bsd). |
2 | Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of GDB. | |
5 | ||
6 | This program 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 2 of the License, or | |
9 | (at your option) any later version. | |
10 | ||
11 | This program 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 this program; if not, write to the Free Software | |
6c9638b4 | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
5076de82 FF |
19 | |
20 | #define HOST_BYTE_ORDER LITTLE_ENDIAN | |
21 | ||
5076de82 FF |
22 | /* This is the amount to subtract from u.u_ar0 |
23 | to get the offset in the core file of the register values. */ | |
24 | ||
25 | #define KERNEL_U_ADDR (0x01000000 - (UPAGES * NBPG)) | |
26 | ||
27 | /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ | |
28 | #define FETCH_INFERIOR_REGISTERS | |
29 | ||
30 | \f | |
31 | #if 0 | |
32 | /* Interface definitions for kernel debugger KDB. */ | |
33 | ||
34 | /* Map machine fault codes into signal numbers. | |
35 | First subtract 0, divide by 4, then index in a table. | |
36 | Faults for which the entry in this table is 0 | |
37 | are not handled by KDB; the program's own trap handler | |
38 | gets to handle then. */ | |
39 | ||
40 | #define FAULT_CODE_ORIGIN 0 | |
41 | #define FAULT_CODE_UNITS 4 | |
42 | #define FAULT_TABLE \ | |
43 | { 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \ | |
44 | 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \ | |
45 | 0, 0, 0, 0, 0, 0, 0, 0} | |
46 | ||
47 | /* Start running with a stack stretching from BEG to END. | |
48 | BEG and END should be symbols meaningful to the assembler. | |
49 | This is used only for kdb. */ | |
50 | ||
51 | #define INIT_STACK(beg, end) \ | |
52 | { asm (".globl end"); \ | |
53 | asm ("movl $ end, sp"); \ | |
54 | asm ("clrl fp"); } | |
55 | ||
56 | /* Push the frame pointer register on the stack. */ | |
57 | #define PUSH_FRAME_PTR \ | |
58 | asm ("pushl fp"); | |
59 | ||
60 | /* Copy the top-of-stack to the frame pointer register. */ | |
61 | #define POP_FRAME_PTR \ | |
62 | asm ("movl (sp), fp"); | |
63 | ||
64 | /* After KDB is entered by a fault, push all registers | |
65 | that GDB thinks about (all NUM_REGS of them), | |
66 | so that they appear in order of ascending GDB register number. | |
67 | The fault code will be on the stack beyond the last register. */ | |
68 | ||
69 | #define PUSH_REGISTERS \ | |
70 | { asm ("pushl 8(sp)"); \ | |
71 | asm ("pushl 8(sp)"); \ | |
72 | asm ("pushal 0x14(sp)"); \ | |
73 | asm ("pushr $037777"); } | |
74 | ||
75 | /* Assuming the registers (including processor status) have been | |
76 | pushed on the stack in order of ascending GDB register number, | |
77 | restore them and return to the address in the saved PC register. */ | |
78 | ||
79 | #define POP_REGISTERS \ | |
80 | { asm ("popr $037777"); \ | |
81 | asm ("subl2 $8,(sp)"); \ | |
82 | asm ("movl (sp),sp"); \ | |
83 | asm ("rei"); } | |
84 | #endif /* 0 */ |