* Makefile.in (MMALLOC_CFLAGS): Eliminate intermediate MMALLOC_DISABLE
[deliverable/binutils-gdb.git] / gdb / config / m68k / xm-hp300hpux.h
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
19
20 #define HOST_BYTE_ORDER BIG_ENDIAN
21
22 /* Define this to indicate problems with traps after continuing. */
23 #define HP_OS_BUG
24
25 /* Set flag to indicate whether HP's assembler is in use. */
26 #ifdef __GNUC__
27 #ifdef __HPUX_ASM__
28 #define HPUX_ASM
29 #endif
30 #else /* not GNU C. */
31 #define HPUX_ASM
32 #endif /* not GNU C. */
33
34 /* Define this for versions of hp-ux older than 6.0 */
35 /* #define HPUX_VERSION_5 */
36
37 /* define USG if you are using sys5 /usr/include's */
38 #undef USG /* In case it was defined in the Makefile for cplus-dem.c */
39 #define USG
40
41 #define HAVE_TERMIOS
42
43 #define REGISTER_ADDR(u_ar0, regno) \
44 (unsigned int) \
45 (((regno) < PS_REGNUM) \
46 ? (&((struct exception_stack *) (u_ar0))->e_regs[(regno + R0)]) \
47 : (((regno) == PS_REGNUM) \
48 ? ((int *) (&((struct exception_stack *) (u_ar0))->e_PS)) \
49 : (&((struct exception_stack *) (u_ar0))->e_PC)))
50
51 #define FP_REGISTER_ADDR(u, regno) \
52 (((char *) \
53 (((regno) < FPC_REGNUM) \
54 ? (&u.u_pcb.pcb_mc68881[FMC68881_R0 + (((regno) - FP0_REGNUM) * 3)]) \
55 : (&u.u_pcb.pcb_mc68881[FMC68881_C + ((regno) - FPC_REGNUM)]))) \
56 - ((char *) (& u)))
57 \f
58 /* Interface definitions for kernel debugger KDB. */
59
60 /* Map machine fault codes into signal numbers.
61 First subtract 0, divide by 4, then index in a table.
62 Faults for which the entry in this table is 0
63 are not handled by KDB; the program's own trap handler
64 gets to handle then. */
65
66 #define FAULT_CODE_ORIGIN 0
67 #define FAULT_CODE_UNITS 4
68 #define FAULT_TABLE \
69 { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
70 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
71 0, 0, 0, 0, 0, 0, 0, 0, \
72 SIGILL }
73
74 /* On hpux, autoconf 2.4 (and possibly others) does not properly detect that
75 mmap is available. Until this is fixed, we have to explicitly force
76 HAVE_MMAP. -fnf */
77
78 #define HAVE_MMAP 1
79
80 #ifndef HPUX_ASM
81
82 /* Start running with a stack stretching from BEG to END.
83 BEG and END should be symbols meaningful to the assembler.
84 This is used only for kdb. */
85
86 #define INIT_STACK(beg, end) \
87 { asm (".globl end"); \
88 asm ("movel $ end, sp"); \
89 asm ("clrl fp"); }
90
91 /* Push the frame pointer register on the stack. */
92 #define PUSH_FRAME_PTR \
93 asm ("movel fp, -(sp)");
94
95 /* Copy the top-of-stack to the frame pointer register. */
96 #define POP_FRAME_PTR \
97 asm ("movl (sp), fp");
98
99 /* After KDB is entered by a fault, push all registers
100 that GDB thinks about (all NUM_REGS of them),
101 so that they appear in order of ascending GDB register number.
102 The fault code will be on the stack beyond the last register. */
103
104 #define PUSH_REGISTERS \
105 { asm ("clrw -(sp)"); \
106 asm ("pea 10(sp)"); \
107 asm ("movem $ 0xfffe,-(sp)"); }
108
109 /* Assuming the registers (including processor status) have been
110 pushed on the stack in order of ascending GDB register number,
111 restore them and return to the address in the saved PC register. */
112
113 #define POP_REGISTERS \
114 { asm ("subil $8,28(sp)"); \
115 asm ("movem (sp),$ 0xffff"); \
116 asm ("rte"); }
117
118 #else /* HPUX_ASM */
119
120 /* Start running with a stack stretching from BEG to END.
121 BEG and END should be symbols meaningful to the assembler.
122 This is used only for kdb. */
123
124 #define INIT_STACK(beg, end) \
125 { asm ("global end"); \
126 asm ("mov.l &end,%sp"); \
127 asm ("clr.l %a6"); }
128
129 /* Push the frame pointer register on the stack. */
130 #define PUSH_FRAME_PTR \
131 asm ("mov.l %fp,-(%sp)");
132
133 /* Copy the top-of-stack to the frame pointer register. */
134 #define POP_FRAME_PTR \
135 asm ("mov.l (%sp),%fp");
136
137 /* After KDB is entered by a fault, push all registers
138 that GDB thinks about (all NUM_REGS of them),
139 so that they appear in order of ascending GDB register number.
140 The fault code will be on the stack beyond the last register. */
141
142 #define PUSH_REGISTERS \
143 { asm ("clr.w -(%sp)"); \
144 asm ("pea 10(%sp)"); \
145 asm ("movm.l &0xfffe,-(%sp)"); }
146
147 /* Assuming the registers (including processor status) have been
148 pushed on the stack in order of ascending GDB register number,
149 restore them and return to the address in the saved PC register. */
150
151 #define POP_REGISTERS \
152 { asm ("subi.l &8,28(%sp)"); \
153 asm ("mov.m (%sp),&0xffff"); \
154 asm ("rte"); }
155
156 #endif /* HPUX_ASM */
This page took 0.033583 seconds and 5 git commands to generate.