* defs.h: Incorporate param.h. All users changed.
[deliverable/binutils-gdb.git] / gdb / xm-merlin.h
1 /* Definitions to make GDB run on a merlin under utek 2.1
2 Copyright 1986, 1987, 1989, 1991 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
20 #include <machine/reg.h>
21
22 /* This machine doesn't have the siginterrupt call. */
23 #define NO_SIGINTERRUPT
24
25 /* Under Utek, a ptrace'd process can be the only active process for
26 an executable. Therefore instead of /bin/sh use gdb-sh (which should
27 just be a copy of /bin/sh which is world readable and writeable). */
28 #define SHELL_FILE "/usr/gnu/lib/gdb-sh"
29
30 #define HOST_BYTE_ORDER LITTLE_ENDIAN
31
32 /* This is the amount to subtract from u.u_ar0
33 to get the offset in the core file of the register values. */
34
35 #define KERNEL_U_ADDR (0xfef000)
36
37 #define REGISTER_U_ADDR(addr, blockend, regno) \
38 { \
39 switch (regno) { \
40 case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: \
41 addr = blockend + (R0 - regno) * sizeof (int); break; \
42 case PC_REGNUM: \
43 addr = blockend + PC * sizeof (int); break; \
44 case SP_REGNUM: \
45 addr = blockend + SP * sizeof (int); break; \
46 case FP_REGNUM: \
47 addr = blockend + FP * sizeof (int); break; \
48 case PS_REGNUM: \
49 addr = blockend + 12 * sizeof (int); break; \
50 case FPS_REGNUM: \
51 addr = 108; break; \
52 case FP0_REGNUM + 0: case FP0_REGNUM + 1: \
53 case FP0_REGNUM + 2: case FP0_REGNUM + 3: \
54 case FP0_REGNUM + 4: case FP0_REGNUM + 5: \
55 case FP0_REGNUM + 6: case FP0_REGNUM + 7: \
56 addr = 76 + (regno - FP0_REGNUM) * sizeof (float); break; \
57 case LP0_REGNUM + 0: case LP0_REGNUM + 1: \
58 case LP0_REGNUM + 2: case LP0_REGNUM + 3: \
59 addr = 76 + (regno - LP0_REGNUM) * sizeof (double); break; \
60 default: \
61 printf ("bad argument to REGISTER_U_ADDR %d\n", regno); \
62 abort (); \
63 } \
64 }
65
66 /* Compensate for lack of `vprintf' function. */
67 #define MISSING_VPRINTF
68 \f
69 #if 0
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, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
82 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
83 0, 0, 0, 0, 0, 0, 0, 0}
84
85 /* Start running with a stack stretching from BEG to END.
86 BEG and END should be symbols meaningful to the assembler.
87 This is used only for kdb. */
88
89 #define INIT_STACK(beg, end) \
90 { asm (".globl end"); \
91 asm ("movl $ end, sp"); \
92 asm ("clrl fp"); }
93
94 /* Push the frame pointer register on the stack. */
95 #define PUSH_FRAME_PTR \
96 asm ("pushl fp");
97
98 /* Copy the top-of-stack to the frame pointer register. */
99 #define POP_FRAME_PTR \
100 asm ("movl (sp), fp");
101
102 /* After KDB is entered by a fault, push all registers
103 that GDB thinks about (all NUM_REGS of them),
104 so that they appear in order of ascending GDB register number.
105 The fault code will be on the stack beyond the last register. */
106
107 #define PUSH_REGISTERS \
108 { asm ("pushl 8(sp)"); \
109 asm ("pushl 8(sp)"); \
110 asm ("pushal 0x14(sp)"); \
111 asm ("pushr $037777"); }
112
113 /* Assuming the registers (including processor status) have been
114 pushed on the stack in order of ascending GDB register number,
115 restore them and return to the address in the saved PC register. */
116
117 #define POP_REGISTERS \
118 { asm ("popr $037777"); \
119 asm ("subl2 $8,(sp)"); \
120 asm ("movl (sp),sp"); \
121 asm ("rei"); }
122 #endif /* 0 */
This page took 0.032522 seconds and 5 git commands to generate.