* m32c/gdb-if.c (m32c_signal_to_host): Rename to
[gdb/SamB.git] / gdb / sparc64-linux-nat.c
blobe8e796dc5ff2da9c588993df5806b354a63ca125
1 /* Native-dependent code for GNU/Linux UltraSPARC.
3 Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009
4 Free Software Foundation, Inc.
6 This file is part of GDB.
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 3 of the License, or
11 (at your option) any later version.
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.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 #include "defs.h"
22 #include "regcache.h"
24 #include <sys/procfs.h>
25 #include "gregset.h"
27 #include "sparc64-tdep.h"
28 #include "sparc-tdep.h"
29 #include "sparc-nat.h"
30 #include "inferior.h"
31 #include "target.h"
32 #include "linux-nat.h"
34 static const struct sparc_gregset sparc64_linux_ptrace_gregset =
36 16 * 8, /* "tstate" */
37 17 * 8, /* %pc */
38 18 * 8, /* %npc */
39 19 * 8, /* %y */
40 -1, /* %wim */
41 -1, /* %tbr */
42 0 * 8, /* %g1 */
43 -1, /* %l0 */
44 4 /* sizeof (%y) */
48 void
49 supply_gregset (struct regcache *regcache, const prgregset_t *gregs)
51 sparc64_supply_gregset (sparc_gregset, regcache, -1, gregs);
54 void
55 supply_fpregset (struct regcache *regcache, const prfpregset_t *fpregs)
57 sparc64_supply_fpregset (regcache, -1, fpregs);
60 void
61 fill_gregset (const struct regcache *regcache, prgregset_t *gregs, int regnum)
63 sparc64_collect_gregset (sparc_gregset, regcache, regnum, gregs);
66 void
67 fill_fpregset (const struct regcache *regcache,
68 prfpregset_t *fpregs, int regnum)
70 sparc64_collect_fpregset (regcache, regnum, fpregs);
73 /* Provide a prototype to silence -Wmissing-prototypes. */
74 void _initialize_sparc64_linux_nat (void);
76 void
77 _initialize_sparc64_linux_nat (void)
79 struct target_ops *t;
81 /* Fill in the generic GNU/Linux methods. */
82 t = linux_target ();
84 /* Add our register access methods. */
85 t->to_fetch_registers = sparc_fetch_inferior_registers;
86 t->to_store_registers = sparc_store_inferior_registers;
88 /* Register the target. */
89 linux_nat_add_target (t);
91 sparc_gregset = &sparc64_linux_ptrace_gregset;