]>
git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/config/m68k/xm-news.h
1 /* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger.
2 Copyright 1987, 1989, 1992 Free Software Foundation, Inc.
4 This file is part of GDB.
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.
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.
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,
19 Boston, MA 02111-1307, USA. */
21 #define HOST_BYTE_ORDER BIG_ENDIAN
23 #include <sys/param.h> /* For INT_MIN */
25 #define HAVE_WAIT_STRUCT
27 /* We can't use "isatty" or "fileno" on this machine. This isn't good,
28 but it will have to do. */
29 #define ISATTY(FP) ((FP) == stdin || (FP) == stdout)
31 /* THis is the amount to subtract from u.u_ar0
32 to get the offset in the core file of the register values. */
34 #define KERNEL_U_ADDR UADDR
36 /* The offsets in this macro are from /usr/include/machine/reg.h */
38 #define REGISTER_U_ADDR(addr, blockend, regno) \
39 { static char offsets[] = { \
40 /*d0-d7:*/1,2,3,4,5,6,7,8, \
41 /*a0-a6:*/9,10,11,12,13,14,15, /*sp:*/-4, /*ps:*/0, /*pc:*/-1, \
42 /*fp0-fp7:*/19,22,25,28,31,34,37,40, /*fpc:*/16,17,18 }; \
43 addr = blockend + 4 * offsets[regno]; \
46 /* NewsOS 3.3 does not define errno in <errno.h>. */
49 /* Interface definitions for kernel debugger KDB. */
51 /* Use GNU assembler instead of standard assembler */
54 /* Motorola assembly format */
59 /* Map machine fault codes into signal numbers.
60 First subtract 0, divide by 4, then index in a table.
61 Faults for which the entry in this table is 0
62 are not handled by KDB; the program's own trap handler
63 gets to handle then. */
65 #define FAULT_CODE_ORIGIN 0
66 #define FAULT_CODE_UNITS 4
68 { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
69 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
70 0, 0, 0, 0, 0, 0, 0, 0, \
73 /* Start running with a stack stretching from BEG to END.
74 BEG and END should be symbols meaningful to the assembler.
75 This is used only for kdb. */
78 #define INIT_STACK(beg, end) \
79 { asm (".globl end"); \
80 asm ("move.l $ end, sp"); \
83 #define INIT_STACK(beg, end) \
84 { asm (".globl end"); \
85 asm ("movel $ end, sp"); \
89 /* Push the frame pointer register on the stack. */
91 #define PUSH_FRAME_PTR \
92 asm ("move.l fp, -(sp)");
94 #define PUSH_FRAME_PTR \
95 asm ("movel fp, -(sp)");
98 /* Copy the top-of-stack to the frame pointer register. */
100 #define POP_FRAME_PTR \
101 asm ("move.l (sp), fp");
103 #define POP_FRAME_PTR \
104 asm ("movl (sp), fp");
107 /* After KDB is entered by a fault, push all registers
108 that GDB thinks about (all NUM_REGS of them),
109 so that they appear in order of ascending GDB register number.
110 The fault code will be on the stack beyond the last register. */
113 #define PUSH_REGISTERS \
114 { asm ("clr.w -(sp)"); \
115 asm ("pea (10,sp)"); \
116 asm ("movem $ 0xfffe,-(sp)"); }
118 #define PUSH_REGISTERS \
119 { asm ("clrw -(sp)"); \
120 asm ("pea 10(sp)"); \
121 asm ("movem $ 0xfffe,-(sp)"); }
124 /* Assuming the registers (including processor status) have been
125 pushed on the stack in order of ascending GDB register number,
126 restore them and return to the address in the saved PC register. */
129 #define POP_REGISTERS \
130 { asm ("subi.l $8,28(sp)"); \
131 asm ("movem (sp),$ 0xffff"); \
134 #define POP_REGISTERS \
135 { asm ("subil $8,28(sp)"); \
136 asm ("movem (sp),$ 0xffff"); \