]>
Commit | Line | Data |
---|---|---|
9fa28378 | 1 | /* Parameters for hosting on a Hewlett-Packard 9000/300, running bsd. |
3818ed33 | 2 | Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc. |
dd3b648e RP |
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 | /* | |
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 [email protected] | |
24 | */ | |
25 | ||
9fa28378 JG |
26 | #define HOST_BYTE_ORDER BIG_ENDIAN |
27 | ||
28 | /* Avoid "INT_MIN redefined" warnings -- by defining it here, exactly | |
29 | the same as in the system <machine/machtypes.h> file. */ | |
30 | #undef INT_MIN | |
31 | #define INT_MIN 0x80000000 | |
dd3b648e RP |
32 | |
33 | /* Get rid of any system-imposed stack limit if possible. */ | |
34 | ||
35 | #define SET_STACK_LIMIT_HUGE | |
36 | ||
37 | /* Get kernel u area address at run-time using BSD style nlist (). */ | |
38 | #define KERNEL_U_ADDR_BSD | |
39 | ||
40 | /* This is a piece of magic that is given a register number REGNO | |
41 | and as BLOCKEND the address in the system of the end of the user structure | |
42 | and stores in ADDR the address in the kernel or core dump | |
43 | of that register. */ | |
44 | ||
45 | #define REGISTER_U_ADDR(addr, blockend, regno) \ | |
46 | { \ | |
47 | if (regno < PS_REGNUM) \ | |
48 | addr = (int) &((struct frame *)(blockend))->f_regs[regno]; \ | |
49 | else if (regno == PS_REGNUM) \ | |
50 | addr = (int) &((struct frame *)(blockend))->f_stackadj; \ | |
51 | else if (regno == PC_REGNUM) \ | |
52 | addr = (int) &((struct frame *)(blockend))->f_pc; \ | |
53 | else if (regno < FPC_REGNUM) \ | |
54 | addr = (int) \ | |
55 | &((struct user *)0)->u_pcb.pcb_fpregs.fpf_regs[((regno)-FP0_REGNUM)*3];\ | |
56 | else if (regno == FPC_REGNUM) \ | |
57 | addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpcr; \ | |
58 | else if (regno == FPS_REGNUM) \ | |
59 | addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpsr; \ | |
60 | else \ | |
61 | addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpiar; \ | |
62 | } | |
63 | ||
62853f80 JG |
64 | /* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */ |
65 | #define ONE_PROCESS_WRITETEXT | |
dd3b648e RP |
66 | \f |
67 | /* Interface definitions for kernel debugger KDB. */ | |
68 | ||
69 | /* Map machine fault codes into signal numbers. | |
70 | First subtract 0, divide by 4, then index in a table. | |
71 | Faults for which the entry in this table is 0 | |
72 | are not handled by KDB; the program's own trap handler | |
73 | gets to handle then. */ | |
74 | ||
75 | #define FAULT_CODE_ORIGIN 0 | |
76 | #define FAULT_CODE_UNITS 4 | |
77 | #define FAULT_TABLE \ | |
78 | { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ | |
79 | 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ | |
80 | 0, 0, 0, 0, 0, 0, 0, 0, \ | |
81 | SIGILL } | |
82 | ||
83 | /* Start running with a stack stretching from BEG to END. | |
84 | BEG and END should be symbols meaningful to the assembler. | |
85 | This is used only for kdb. */ | |
86 | ||
87 | #define INIT_STACK(beg, end) \ | |
88 | { asm (".globl end"); \ | |
89 | asm ("movel #end, sp"); \ | |
90 | asm ("movel #0,a6"); } | |
91 | ||
92 | /* Push the frame pointer register on the stack. */ | |
93 | #define PUSH_FRAME_PTR \ | |
94 | asm ("movel a6,sp@-"); | |
95 | ||
96 | /* Copy the top-of-stack to the frame pointer register. */ | |
97 | #define POP_FRAME_PTR \ | |
98 | asm ("movl sp@,a6"); | |
99 | ||
100 | /* After KDB is entered by a fault, push all registers | |
101 | that GDB thinks about (all NUM_REGS of them), | |
102 | so that they appear in order of ascending GDB register number. | |
103 | The fault code will be on the stack beyond the last register. */ | |
104 | ||
105 | #define PUSH_REGISTERS \ | |
106 | { asm ("clrw -(sp)"); \ | |
107 | asm ("pea sp@(10)"); \ | |
108 | asm ("movem #0xfffe,sp@-"); } | |
109 | ||
110 | /* Assuming the registers (including processor status) have been | |
111 | pushed on the stack in order of ascending GDB register number, | |
112 | restore them and return to the address in the saved PC register. */ | |
113 | ||
114 | #define POP_REGISTERS \ | |
115 | { asm ("subil #8,sp@(28)"); \ | |
116 | asm ("movem sp@,#0xffff"); \ | |
117 | asm ("rte"); } |