Commit | Line | Data |
---|---|---|
c906108c | 1 | /* Parameters for hosting on a Hewlett-Packard 9000/300, running bsd. |
b6ba6518 KB |
2 | Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1995, 1996, 2000, 2001 |
3 | Free Software Foundation, Inc. | |
c906108c | 4 | |
c5aa993b | 5 | This file is part of GDB. |
c906108c | 6 | |
c5aa993b JM |
7 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 2 of the License, or | |
10 | (at your option) any later version. | |
c906108c | 11 | |
c5aa993b JM |
12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
c906108c | 16 | |
c5aa993b JM |
17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software | |
19 | Foundation, Inc., 59 Temple Place - Suite 330, | |
20 | Boston, MA 02111-1307, USA. */ | |
c906108c SS |
21 | |
22 | /* | |
23 | * Configuration file for HP9000/300 series machine running | |
24 | * University of Utah's 4.3bsd (or 4.4BSD) port. This is NOT for HP-UX. | |
25 | * Problems to hpbsd-bugs@cs.utah.edu | |
26 | */ | |
27 | ||
c5aa993b | 28 | #include <sys/param.h> /* For INT_MIN */ |
c906108c SS |
29 | |
30 | /* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */ | |
31 | #define ONE_PROCESS_WRITETEXT | |
c906108c SS |
32 | \f |
33 | /* Interface definitions for kernel debugger KDB. */ | |
34 | ||
35 | /* Map machine fault codes into signal numbers. | |
36 | First subtract 0, divide by 4, then index in a table. | |
37 | Faults for which the entry in this table is 0 | |
38 | are not handled by KDB; the program's own trap handler | |
39 | gets to handle then. */ | |
40 | ||
41 | #define FAULT_CODE_ORIGIN 0 | |
42 | #define FAULT_CODE_UNITS 4 | |
43 | #define FAULT_TABLE \ | |
44 | { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ | |
45 | 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ | |
46 | 0, 0, 0, 0, 0, 0, 0, 0, \ | |
47 | SIGILL } | |
48 | ||
49 | /* Start running with a stack stretching from BEG to END. | |
50 | BEG and END should be symbols meaningful to the assembler. | |
51 | This is used only for kdb. */ | |
52 | ||
53 | #define INIT_STACK(beg, end) \ | |
54 | { asm (".globl end"); \ | |
55 | asm ("movel #end, sp"); \ | |
56 | asm ("movel #0,a6"); } | |
57 | ||
58 | /* Push the frame pointer register on the stack. */ | |
59 | #define PUSH_FRAME_PTR \ | |
60 | asm ("movel a6,sp@-"); | |
61 | ||
62 | /* Copy the top-of-stack to the frame pointer register. */ | |
63 | #define POP_FRAME_PTR \ | |
64 | asm ("movl sp@,a6"); | |
65 | ||
66 | /* After KDB is entered by a fault, push all registers | |
67 | that GDB thinks about (all NUM_REGS of them), | |
68 | so that they appear in order of ascending GDB register number. | |
69 | The fault code will be on the stack beyond the last register. */ | |
70 | ||
71 | #define PUSH_REGISTERS \ | |
72 | { asm ("clrw -(sp)"); \ | |
73 | asm ("pea sp@(10)"); \ | |
74 | asm ("movem #0xfffe,sp@-"); } | |
75 | ||
76 | /* Assuming the registers (including processor status) have been | |
77 | pushed on the stack in order of ascending GDB register number, | |
78 | restore them and return to the address in the saved PC register. */ | |
79 | ||
80 | #define POP_REGISTERS \ | |
81 | { asm ("subil #8,sp@(28)"); \ | |
82 | asm ("movem sp@,#0xffff"); \ | |
83 | asm ("rte"); } |