]>
git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/config/m68k/nm-hp300bsd.h
1 /* Parameters for Hewlett-Packard 9000/300 native support under bsd.
2 Copyright 1986, 1987, 1989, 1991, 1992, 1993
3 Free Software Foundation, Inc.
5 This file is part of GDB.
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.
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.
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., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* Detect whether this is 4.3 or 4.4. */
25 #include <sys/param.h>
28 /* BSD 4.4 alpha or better */
30 /* We can attach to processes using ptrace. */
33 #define PTRACE_ATTACH 10
34 #define PTRACE_DETACH 11
36 /* The third argument of ptrace is declared as this type. */
38 #define PTRACE_ARG3_TYPE caddr_t
40 /* U_REGS_OFFSET is the offset of the registers within the u area for
42 #define U_REGS_OFFSET \
43 ptrace (PT_READ_U, PIDGET (inferior_ptid), \
45 (offsetof (struct user, u_kproc.kp_proc.p_md.md_regs)), 0) \
48 /* No user structure in 4.4, registers are relative to kernel stack
50 #define KERNEL_U_ADDR 0xFFF00000
52 /* FIXME: Is ONE_PROCESS_WRITETEXT still true now that the kernel has
53 copy-on-write? It not, move it to the 4.3-specific section below
54 (now it is in xm-hp300bsd.h). */
58 /* This is BSD 4.3 or something like it. */
60 /* Get kernel u area address at run-time using BSD style nlist (). */
61 #define KERNEL_U_ADDR_BSD
65 /* This was once broken for 4.4, but probably because we had the wrong
68 /* This is a piece of magic that is given a register number REGNO
69 and as BLOCKEND the address in the system of the end of the user structure
70 and stores in ADDR the address in the kernel or core dump
73 #define REGISTER_U_ADDR(addr, blockend, regno) \
75 if (regno < PS_REGNUM) \
76 addr = (int) &((struct frame *)(blockend))->f_regs[regno]; \
77 else if (regno == PS_REGNUM) \
78 addr = (int) &((struct frame *)(blockend))->f_stackadj; \
79 else if (regno == PC_REGNUM) \
80 addr = (int) &((struct frame *)(blockend))->f_pc; \
81 else if (regno < FPC_REGNUM) \
83 &((struct user *)0)->u_pcb.pcb_fpregs.fpf_regs[((regno)-FP0_REGNUM)*3];\
84 else if (regno == FPC_REGNUM) \
85 addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpcr; \
86 else if (regno == FPS_REGNUM) \
87 addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpsr; \
89 addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpiar; \