* infptrace.c: Split out define of PT_KILL; Sequent defines PT_KILL
[binutils-gdb.git] / gdb / config / i386 / xm-symmetry.h
1 /* Definitions to make GDB run on a Sequent Symmetry under
2 dynix 3.1 and ptx 1.3, with Weitek 1167 and i387 support.
3 Copyright 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
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.
11
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.
16
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
20
21 /* Symmetry version by Jay Vosburgh (fubar@sequent.com) */
22
23 /* This machine doesn't have the siginterrupt call. */
24 #define NO_SIGINTERRUPT
25
26 #define HAVE_WAIT_STRUCT
27
28 #ifdef _SEQUENT_
29 /* ptx */
30 #define HAVE_TERMIO
31 #define USG
32 #else
33 /* dynix */
34
35 /* Get rid of any system-imposed stack limit if possible. */
36
37 #define SET_STACK_LIMIT_HUGE
38
39 #endif
40
41 /* XPT_DEBUG doesn't work yet under Dynix 3.0.12, but UNDEBUG does... */
42 /* #define PTRACE_ATTACH XPT_DEBUG
43 #define PTRACE_DETACH XPT_UNDEBUG
44 #define ATTACH_DETACH */
45
46 #define HOST_BYTE_ORDER LITTLE_ENDIAN
47
48 /* We must fetch all the regs before storing, since we store all at once. */
49
50 #define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
51 \f
52 /* Interface definitions for kernel debugger KDB. */
53 /* This doesn't work... */
54 /* Map machine fault codes into signal numbers.
55 First subtract 0, divide by 4, then index in a table.
56 Faults for which the entry in this table is 0
57 are not handled by KDB; the program's own trap handler
58 gets to handle then. */
59
60 #define FAULT_CODE_ORIGIN 0
61 #define FAULT_CODE_UNITS 4
62 #define FAULT_TABLE \
63 { 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
64 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
65 0, 0, 0, 0, 0, 0, 0, 0}
66
67 /* Start running with a stack stretching from BEG to END.
68 BEG and END should be symbols meaningful to the assembler.
69 This is used only for kdb. */
70
71 #define INIT_STACK(beg, end) \
72 { asm (".globl end"); \
73 asm ("movl $ end, %esp"); \
74 asm ("movl %ebp, $0"); }
75
76 /* Push the frame pointer register on the stack. */
77 #define PUSH_FRAME_PTR \
78 asm ("pushl %ebp");
79
80 /* Copy the top-of-stack to the frame pointer register. */
81 #define POP_FRAME_PTR \
82 asm ("movl (%esp), %ebp");
83
84 /* After KDB is entered by a fault, push all registers
85 that GDB thinks about (all NUM_REGS of them),
86 so that they appear in order of ascending GDB register number.
87 The fault code will be on the stack beyond the last register. */
88
89 #define PUSH_REGISTERS \
90 { asm("pushad"); }
91 /*
92 { asm("pushl %eax"); \
93 asm("pushl %edx"); \
94 asm("pushl %ecx"); \
95 asm("pushl %st(0)"); \
96 asm("pushl %st(1)"); \
97 asm("pushl %ebx"); \
98 asm("pushl %esi"); \
99 asm("pushl %edi"); \
100 asm("pushl %st(2)"); \
101 asm("pushl %st(3)"); \
102 asm("pushl %st(4)"); \
103 asm("pushl %st(5)"); \
104 asm("pushl %st(6)"); \
105 asm("pushl %st(7)"); \
106 asm("pushl %esp"); \
107 asm("pushl %ebp"); \
108 asm("pushl %eip"); \
109 asm("pushl %eflags"); \
110 asm("pushl %fp1"); \
111 asm("pushl %fp2"); \
112 asm("pushl %fp3"); \
113 asm("pushl %fp4"); \
114 asm("pushl %fp5"); \
115 asm("pushl %fp6"); \
116 asm("pushl %fp7"); \
117 asm("pushl %fp8"); \
118 asm("pushl %fp9"); \
119 asm("pushl %fp10"); \
120 asm("pushl %fp11"); \
121 asm("pushl %fp12"); \
122 asm("pushl %fp13"); \
123 asm("pushl %fp14"); \
124 asm("pushl %fp15"); \
125 asm("pushl %fp16"); \
126 asm("pushl %fp17"); \
127 asm("pushl %fp18"); \
128 asm("pushl %fp19"); \
129 asm("pushl %fp20"); \
130 asm("pushl %fp21"); \
131 asm("pushl %fp22"); \
132 asm("pushl %fp23"); \
133 asm("pushl %fp24"); \
134 asm("pushl %fp25"); \
135 asm("pushl %fp26"); \
136 asm("pushl %fp27"); \
137 asm("pushl %fp28"); \
138 asm("pushl %fp29"); \
139 asm("pushl %fp30"); \
140 asm("pushl %fp31"); \
141 }
142 */
143 /* Assuming the registers (including processor status) have been
144 pushed on the stack in order of ascending GDB register number,
145 restore them and return to the address in the saved PC register. */
146
147 #define POP_REGISTERS \
148 { asm ("popad"); }