1/* $FreeBSD: releng/10.3/gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c 173705 2007-11-17 21:30:03Z cognet $ */
2
3/* Target-specific functions for ARM running under NetBSD.
4   Copyright 2002, 2003 Free Software Foundation, Inc.
5
6   This file is part of GDB.
7
8   This program is free software; you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation; either version 2 of the License, or
11   (at your option) any later version.
12
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18   You should have received a copy of the GNU General Public License
19   along with this program; if not, write to the Free Software
20   Foundation, Inc., 59 Temple Place - Suite 330,
21   Boston, MA 02111-1307, USA.  */
22
23#include "defs.h"
24#include "osabi.h"
25
26#include "arch-utils.h"
27#include "arm-tdep.h"
28#include "solib-svr4.h"
29
30/* Description of the longjmp buffer.  */
31#define ARM_FBSD_JB_PC 24
32#define ARM_FBSD_JB_ELEMENT_SIZE INT_REGISTER_SIZE
33
34static void
35arm_freebsd_init_abi_common (struct gdbarch_info info,
36			    struct gdbarch *gdbarch)
37{
38  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
39
40  tdep->lowest_pc = 0x8000;
41
42  tdep->jb_pc = ARM_FBSD_JB_PC;
43  tdep->jb_elt_size = ARM_FBSD_JB_ELEMENT_SIZE;
44}
45
46static void
47arm_freebsd_elf_init_abi (struct gdbarch_info info,
48			 struct gdbarch *gdbarch)
49{
50  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
51
52  arm_freebsd_init_abi_common (info, gdbarch);
53
54  /* FreeBSD ELF uses SVR4-style shared libraries.  */
55  set_gdbarch_in_solib_call_trampoline
56    (gdbarch, generic_in_solib_call_trampoline);
57  set_solib_svr4_fetch_link_map_offsets
58    (gdbarch, svr4_ilp32_fetch_link_map_offsets);
59
60  tdep->fp_model = ARM_FLOAT_SOFT_VFP;
61}
62
63void
64_initialize_armfbsd_tdep (void)
65{
66  gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_FREEBSD_ELF,
67                          arm_freebsd_elf_init_abi);
68}
69