Initial import from FreeBSD RELENG_4:
[dragonfly.git] / gnu / usr.bin / binutils / gdb / i386 / tm.h
1 /* $FreeBSD: src/gnu/usr.bin/binutils/gdb/i386/tm.h,v 1.12.2.1 2000/07/06 21:56:42 obrien Exp $ */
2 /* Target macro definitions for i386 running FreeBSD
3    Copyright (C) 1997 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
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.
11
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.
16
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., 675 Mass Ave, Cambridge, MA 02139, USA.  */
20
21 #ifndef TM_FBSD_H
22 #define TM_FBSD_H 1
23
24 #include "i386/tm-i386bsd.h"
25
26 #undef NUM_REGS
27 #define NUM_REGS 16
28
29 extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *));
30
31 #define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv)
32
33 extern void i386_float_info PARAMS ((void));
34
35 #define FLOAT_INFO i386_float_info ()
36
37 #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) STREQ (name, "_DYNAMIC")
38
39 /* Saved Pc.  Get it from sigcontext if within sigtramp.  */
40
41 extern CORE_ADDR fbsd_kern_frame_saved_pc (struct frame_info *);
42 #undef FRAME_SAVED_PC
43 #define FRAME_SAVED_PC(FRAME) \
44   (kernel_debugging ? fbsd_kern_frame_saved_pc(FRAME) : \
45   (((FRAME)->signal_handler_caller \
46     ? sigtramp_saved_pc (FRAME) \
47     : read_memory_integer ((FRAME)->frame + 4, 4)) \
48    ))
49
50 /* On FreeBSD, sigtramp has size 0x18 and is immediately below the
51    ps_strings struct which has size 0x10 and is at the top of the
52    user stack.  */
53
54 #undef SIGTRAMP_START
55 #undef SIGTRAMP_END
56 #define SIGTRAMP_START(pc)      0xbfbfdfd8
57 #define SIGTRAMP_END(pc)        0xbfbfdff0
58
59 struct objfile;
60 void freebsd_uthread_new_objfile PARAMS ((struct objfile *objfile));
61 #define target_new_objfile(OBJFILE) freebsd_uthread_new_objfile (OBJFILE)
62
63 extern char *freebsd_uthread_pid_to_str PARAMS ((int pid));
64 #define target_pid_to_str(PID) freebsd_uthread_pid_to_str (PID)
65
66 #endif  /* ifndef TM_FBSD_H */