1 /* Parameters for execution on a 3b1.
2 Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
20 #define HOST_BYTE_ORDER BIG_ENDIAN
25 /* This is the amount to subtract from u.u_ar0
26 to get the offset in the core file of the register values. */
28 #define KERNEL_U_ADDR 0x70000
30 #define REGISTER_U_ADDR(addr, blockend, regno) \
31 { addr = blockend + regno * 4; }
33 /* Interface definitions for kernel debugger KDB. */
35 /* Map machine fault codes into signal numbers.
36 First subtract 0, divide by 4, then index in a table.
37 Faults for which the entry in this table is 0
38 are not handled by KDB; the program's own trap handler
39 gets to handle then. */
41 #define FAULT_CODE_ORIGIN 0
42 #define FAULT_CODE_UNITS 4
44 { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
45 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
46 0, 0, 0, 0, 0, 0, 0, 0, \
49 /* Start running with a stack stretching from BEG to END.
50 BEG and END should be symbols meaningful to the assembler.
51 This is used only for kdb. */
53 #define INIT_STACK(beg, end) \
54 { asm (".globl end"); \
55 asm ("movel $ end, sp"); \
58 /* Push the frame pointer register on the stack. */
59 #define PUSH_FRAME_PTR \
60 asm ("movel fp, -(sp)");
62 /* Copy the top-of-stack to the frame pointer register. */
63 #define POP_FRAME_PTR \
64 asm ("movl (sp), fp");
66 /* After KDB is entered by a fault, push all registers
67 that GDB thinks about (all NUM_REGS of them),
68 so that they appear in order of ascending GDB register number.
69 The fault code will be on the stack beyond the last register. */
71 #define PUSH_REGISTERS \
72 { asm ("clrw -(sp)"); \
74 asm ("movem $ 0xfffe,-(sp)"); }
76 /* Assuming the registers (including processor status) have been
77 pushed on the stack in order of ascending GDB register number,
78 restore them and return to the address in the saved PC register. */
80 #define POP_REGISTERS \
81 { asm ("subil $8,28(sp)"); \
82 asm ("movem (sp),$ 0xffff"); \
This page took 0.032932 seconds and 4 git commands to generate.