* arm-tdep.h (enum arm_abi): New enum.
[external/binutils.git] / gdb / armnbsd-nat.c
1 /* Native-dependent code for BSD Unix running on ARM's, for GDB.
2    Copyright 1988, 1989, 1991, 1992, 1994, 1996, 1999, 2002
3    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., 59 Temple Place - Suite 330,
20    Boston, MA 02111-1307, USA.  */
21
22 #include "defs.h"
23
24 #include "arm-tdep.h"
25
26 #ifdef FETCH_INFERIOR_REGISTERS
27 #include <sys/types.h>
28 #include <sys/ptrace.h>
29 #include <machine/reg.h>
30 #include <machine/frame.h>
31 #include "inferior.h"
32 #include "regcache.h"
33
34 void
35 fetch_inferior_registers (regno)
36      int regno;
37 {
38   struct reg inferior_registers;
39   struct fpreg inferior_fpregisters;
40
41   ptrace (PT_GETREGS, PIDGET (inferior_ptid),
42           (PTRACE_ARG3_TYPE) &inferior_registers, 0);
43   memcpy (&registers[REGISTER_BYTE (0)], &inferior_registers,
44           16 * sizeof (unsigned int));
45   memcpy (&registers[REGISTER_BYTE (ARM_PS_REGNUM)],
46           &inferior_registers.r_cpsr,
47           sizeof (unsigned int));
48   ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
49           (PTRACE_ARG3_TYPE) &inferior_fpregisters, 0);
50   memcpy (&registers[REGISTER_BYTE (ARM_F0_REGNUM)],
51           &inferior_fpregisters.fpr[0],
52           8 * sizeof (fp_reg_t));
53   memcpy (&registers[REGISTER_BYTE (ARM_FPS_REGNUM)],
54           &inferior_fpregisters.fpr_fpsr, sizeof (unsigned int));
55   registers_fetched ();
56 }
57
58 void
59 store_inferior_registers (regno)
60      int regno;
61 {
62   struct reg inferior_registers;
63
64   memcpy (&inferior_registers, &registers[REGISTER_BYTE (0)],
65           16 * sizeof (unsigned int));
66   memcpy (&inferior_registers.r_cpsr,
67           &registers[REGISTER_BYTE (ARM_PS_REGNUM)],
68           sizeof (unsigned int));
69   ptrace (PT_SETREGS, PIDGET (inferior_ptid),
70           (PTRACE_ARG3_TYPE) &inferior_registers, 0);
71
72   /* XXX Set FP regs. */
73 }
74
75 struct md_core
76 {
77   struct reg intreg;
78   struct fpreg freg;
79 };
80
81 void
82 fetch_core_registers (core_reg_sect, core_reg_size, which, ignore)
83      char *core_reg_sect;
84      unsigned core_reg_size;
85      int which;
86      CORE_ADDR ignore;
87 {
88   struct md_core *core_reg = (struct md_core *) core_reg_sect;
89
90   /* integer registers */
91   memcpy (&registers[REGISTER_BYTE (0)], &core_reg->intreg,
92           sizeof (struct reg));
93   /* floating point registers */
94   /* XXX */
95 }
96
97 #else
98 #error Not FETCH_INFERIOR_REGISTERS 
99 #endif /* !FETCH_INFERIOR_REGISTERS */
100
101 int 
102 get_longjmp_target (CORE_ADDR *addr)
103 {
104   return 0;
105 }