]>
Commit | Line | Data |
---|---|---|
5076de82 FF |
1 | /* Parameters for HP 9000 model 320 hosting, for GDB, the GNU debugger. |
2 | Copyright (C) 1986, 1987, 1989, 1992 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 | |
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
19 | ||
5076de82 FF |
20 | #define HOST_BYTE_ORDER BIG_ENDIAN |
21 | ||
0626f40d JK |
22 | /* HPUX 8.0, in its infinite wisdom, has chosen to prototype ptrace |
23 | with five arguments, so programs written for normal ptrace lose. | |
24 | ||
25 | Idiots. | |
26 | ||
27 | (They should have just made it varadic). */ | |
28 | #define FIVE_ARG_PTRACE | |
29 | ||
5076de82 FF |
30 | /* Define this to indicate problems with traps after continuing. */ |
31 | #define HP_OS_BUG | |
32 | ||
33 | /* Set flag to indicate whether HP's assembler is in use. */ | |
34 | #ifdef __GNUC__ | |
35 | #ifdef __HPUX_ASM__ | |
36 | #define HPUX_ASM | |
37 | #endif | |
38 | #else /* not GNU C. */ | |
39 | #define HPUX_ASM | |
40 | #endif /* not GNU C. */ | |
41 | ||
42 | /* Define this for versions of hp-ux older than 6.0 */ | |
43 | /* #define HPUX_VERSION_5 */ | |
44 | ||
45 | /* define USG if you are using sys5 /usr/include's */ | |
46 | #undef USG /* In case it was defined in the Makefile for cplus-dem.c */ | |
47 | #define USG | |
48 | ||
49 | /* The mem functions are in <string.h>. */ | |
50 | #undef MEM_FNS_DECLARED | |
51 | #define MEM_FNS_DECLARED 1 | |
52 | ||
073c6b2b | 53 | #define HAVE_TERMIOS |
5076de82 | 54 | |
5076de82 FF |
55 | #define REGISTER_ADDR(u_ar0, regno) \ |
56 | (unsigned int) \ | |
57 | (((regno) < PS_REGNUM) \ | |
58 | ? (&((struct exception_stack *) (u_ar0))->e_regs[(regno + R0)]) \ | |
59 | : (((regno) == PS_REGNUM) \ | |
60 | ? ((int *) (&((struct exception_stack *) (u_ar0))->e_PS)) \ | |
61 | : (&((struct exception_stack *) (u_ar0))->e_PC))) | |
62 | ||
63 | #define FP_REGISTER_ADDR(u, regno) \ | |
64 | (((char *) \ | |
65 | (((regno) < FPC_REGNUM) \ | |
66 | ? (&u.u_pcb.pcb_mc68881[FMC68881_R0 + (((regno) - FP0_REGNUM) * 3)]) \ | |
67 | : (&u.u_pcb.pcb_mc68881[FMC68881_C + ((regno) - FPC_REGNUM)]))) \ | |
68 | - ((char *) (& u))) | |
69 | \f | |
70 | /* Interface definitions for kernel debugger KDB. */ | |
71 | ||
72 | /* Map machine fault codes into signal numbers. | |
73 | First subtract 0, divide by 4, then index in a table. | |
74 | Faults for which the entry in this table is 0 | |
75 | are not handled by KDB; the program's own trap handler | |
76 | gets to handle then. */ | |
77 | ||
78 | #define FAULT_CODE_ORIGIN 0 | |
79 | #define FAULT_CODE_UNITS 4 | |
80 | #define FAULT_TABLE \ | |
81 | { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ | |
82 | 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ | |
83 | 0, 0, 0, 0, 0, 0, 0, 0, \ | |
84 | SIGILL } | |
85 | ||
86 | #ifndef HPUX_ASM | |
87 | ||
88 | /* Start running with a stack stretching from BEG to END. | |
89 | BEG and END should be symbols meaningful to the assembler. | |
90 | This is used only for kdb. */ | |
91 | ||
92 | #define INIT_STACK(beg, end) \ | |
93 | { asm (".globl end"); \ | |
94 | asm ("movel $ end, sp"); \ | |
95 | asm ("clrl fp"); } | |
96 | ||
97 | /* Push the frame pointer register on the stack. */ | |
98 | #define PUSH_FRAME_PTR \ | |
99 | asm ("movel fp, -(sp)"); | |
100 | ||
101 | /* Copy the top-of-stack to the frame pointer register. */ | |
102 | #define POP_FRAME_PTR \ | |
103 | asm ("movl (sp), fp"); | |
104 | ||
105 | /* After KDB is entered by a fault, push all registers | |
106 | that GDB thinks about (all NUM_REGS of them), | |
107 | so that they appear in order of ascending GDB register number. | |
108 | The fault code will be on the stack beyond the last register. */ | |
109 | ||
110 | #define PUSH_REGISTERS \ | |
111 | { asm ("clrw -(sp)"); \ | |
112 | asm ("pea 10(sp)"); \ | |
113 | asm ("movem $ 0xfffe,-(sp)"); } | |
114 | ||
115 | /* Assuming the registers (including processor status) have been | |
116 | pushed on the stack in order of ascending GDB register number, | |
117 | restore them and return to the address in the saved PC register. */ | |
118 | ||
119 | #define POP_REGISTERS \ | |
120 | { asm ("subil $8,28(sp)"); \ | |
121 | asm ("movem (sp),$ 0xffff"); \ | |
122 | asm ("rte"); } | |
123 | ||
124 | #else /* HPUX_ASM */ | |
125 | ||
126 | /* Start running with a stack stretching from BEG to END. | |
127 | BEG and END should be symbols meaningful to the assembler. | |
128 | This is used only for kdb. */ | |
129 | ||
130 | #define INIT_STACK(beg, end) \ | |
131 | { asm ("global end"); \ | |
132 | asm ("mov.l &end,%sp"); \ | |
133 | asm ("clr.l %a6"); } | |
134 | ||
135 | /* Push the frame pointer register on the stack. */ | |
136 | #define PUSH_FRAME_PTR \ | |
137 | asm ("mov.l %fp,-(%sp)"); | |
138 | ||
139 | /* Copy the top-of-stack to the frame pointer register. */ | |
140 | #define POP_FRAME_PTR \ | |
141 | asm ("mov.l (%sp),%fp"); | |
142 | ||
143 | /* After KDB is entered by a fault, push all registers | |
144 | that GDB thinks about (all NUM_REGS of them), | |
145 | so that they appear in order of ascending GDB register number. | |
146 | The fault code will be on the stack beyond the last register. */ | |
147 | ||
148 | #define PUSH_REGISTERS \ | |
149 | { asm ("clr.w -(%sp)"); \ | |
150 | asm ("pea 10(%sp)"); \ | |
151 | asm ("movm.l &0xfffe,-(%sp)"); } | |
152 | ||
153 | /* Assuming the registers (including processor status) have been | |
154 | pushed on the stack in order of ascending GDB register number, | |
155 | restore them and return to the address in the saved PC register. */ | |
156 | ||
157 | #define POP_REGISTERS \ | |
158 | { asm ("subi.l &8,28(%sp)"); \ | |
159 | asm ("mov.m (%sp),&0xffff"); \ | |
160 | asm ("rte"); } | |
161 | ||
162 | #endif /* HPUX_ASM */ |