]>
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, Boston, MA 02111-1307, USA. */
20 #define HOST_BYTE_ORDER BIG_ENDIAN
22 #include <sys/param.h> /* For INT_MIN */
24 #define HAVE_WAIT_STRUCT
26 /* We can't use "isatty" or "fileno" on this machine. This isn't good,
27 but it will have to do. */
28 #define ISATTY(FP) ((FP) == stdin || (FP) == stdout)
30 /* THis is the amount to subtract from u.u_ar0
31 to get the offset in the core file of the register values. */
33 #define KERNEL_U_ADDR UADDR
35 /* The offsets in this macro are from /usr/include/machine/reg.h */
37 #define REGISTER_U_ADDR(addr, blockend, regno) \
38 { static char offsets[] = { \
39 /*d0-d7:*/1,2,3,4,5,6,7,8, \
40 /*a0-a6:*/9,10,11,12,13,14,15, /*sp:*/-4, /*ps:*/0, /*pc:*/-1, \
41 /*fp0-fp7:*/19,22,25,28,31,34,37,40, /*fpc:*/16,17,18 }; \
42 addr = blockend + 4 * offsets[regno]; \
45 /* NewsOS 3.3 does not define errno in <errno.h>. */
48 /* Interface definitions for kernel debugger KDB. */
50 /* Use GNU assembler instead of standard assembler */
53 /* Motorola assembly format */
58 /* Map machine fault codes into signal numbers.
59 First subtract 0, divide by 4, then index in a table.
60 Faults for which the entry in this table is 0
61 are not handled by KDB; the program's own trap handler
62 gets to handle then. */
64 #define FAULT_CODE_ORIGIN 0
65 #define FAULT_CODE_UNITS 4
67 { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
68 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
69 0, 0, 0, 0, 0, 0, 0, 0, \
72 /* Start running with a stack stretching from BEG to END.
73 BEG and END should be symbols meaningful to the assembler.
74 This is used only for kdb. */
77 #define INIT_STACK(beg, end) \
78 { asm (".globl end"); \
79 asm ("move.l $ end, sp"); \
82 #define INIT_STACK(beg, end) \
83 { asm (".globl end"); \
84 asm ("movel $ end, sp"); \
88 /* Push the frame pointer register on the stack. */
90 #define PUSH_FRAME_PTR \
91 asm ("move.l fp, -(sp)");
93 #define PUSH_FRAME_PTR \
94 asm ("movel fp, -(sp)");
97 /* Copy the top-of-stack to the frame pointer register. */
99 #define POP_FRAME_PTR \
100 asm ("move.l (sp), fp");
102 #define POP_FRAME_PTR \
103 asm ("movl (sp), fp");
106 /* After KDB is entered by a fault, push all registers
107 that GDB thinks about (all NUM_REGS of them),
108 so that they appear in order of ascending GDB register number.
109 The fault code will be on the stack beyond the last register. */
112 #define PUSH_REGISTERS \
113 { asm ("clr.w -(sp)"); \
114 asm ("pea (10,sp)"); \
115 asm ("movem $ 0xfffe,-(sp)"); }
117 #define PUSH_REGISTERS \
118 { asm ("clrw -(sp)"); \
119 asm ("pea 10(sp)"); \
120 asm ("movem $ 0xfffe,-(sp)"); }
123 /* Assuming the registers (including processor status) have been
124 pushed on the stack in order of ascending GDB register number,
125 restore them and return to the address in the saved PC register. */
128 #define POP_REGISTERS \
129 { asm ("subi.l $8,28(sp)"); \
130 asm ("movem (sp),$ 0xffff"); \
133 #define POP_REGISTERS \
134 { asm ("subil $8,28(sp)"); \
135 asm ("movem (sp),$ 0xffff"); \