run copyright.sh for 2011.
[deliverable/binutils-gdb.git] / gdb / sparc64-linux-nat.c
CommitLineData
386c036b 1/* Native-dependent code for GNU/Linux UltraSPARC.
8b39fe56 2
7b6bb8da 3 Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011
0fb0cc75 4 Free Software Foundation, Inc.
8b39fe56
MK
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
a9762ec7 10 the Free Software Foundation; either version 3 of the License, or
8b39fe56
MK
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
a9762ec7 19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
8b39fe56 20
386c036b 21#include "defs.h"
75e192e6
DM
22#include "regcache.h"
23
24#include <sys/procfs.h>
25#include "gregset.h"
386c036b
MK
26
27#include "sparc64-tdep.h"
75e192e6 28#include "sparc-tdep.h"
386c036b 29#include "sparc-nat.h"
10d6c8cd
DJ
30#include "inferior.h"
31#include "target.h"
32#include "linux-nat.h"
386c036b
MK
33
34static const struct sparc_gregset sparc64_linux_ptrace_gregset =
35{
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) */
45};
46\f
47
75e192e6 48void
7f7fe91e 49supply_gregset (struct regcache *regcache, const prgregset_t *gregs)
75e192e6 50{
7f7fe91e 51 sparc64_supply_gregset (sparc_gregset, regcache, -1, gregs);
75e192e6
DM
52}
53
54void
7f7fe91e 55supply_fpregset (struct regcache *regcache, const prfpregset_t *fpregs)
75e192e6 56{
7f7fe91e 57 sparc64_supply_fpregset (regcache, -1, fpregs);
75e192e6
DM
58}
59
60void
7f7fe91e 61fill_gregset (const struct regcache *regcache, prgregset_t *gregs, int regnum)
75e192e6 62{
7f7fe91e 63 sparc64_collect_gregset (sparc_gregset, regcache, regnum, gregs);
75e192e6
DM
64}
65
66void
7f7fe91e
UW
67fill_fpregset (const struct regcache *regcache,
68 prfpregset_t *fpregs, int regnum)
75e192e6 69{
7f7fe91e 70 sparc64_collect_fpregset (regcache, regnum, fpregs);
75e192e6
DM
71}
72
386c036b
MK
73/* Provide a prototype to silence -Wmissing-prototypes. */
74void _initialize_sparc64_linux_nat (void);
75
76void
77_initialize_sparc64_linux_nat (void)
78{
10d6c8cd
DJ
79 struct target_ops *t;
80
81 /* Fill in the generic GNU/Linux methods. */
82 t = linux_target ();
83
84 /* Add our register access methods. */
6f7a27d5
UW
85 t->to_fetch_registers = sparc_fetch_inferior_registers;
86 t->to_store_registers = sparc_store_inferior_registers;
10d6c8cd
DJ
87
88 /* Register the target. */
f973ed9c 89 linux_nat_add_target (t);
10d6c8cd 90
386c036b
MK
91 sparc_gregset = &sparc64_linux_ptrace_gregset;
92}
This page took 0.661658 seconds and 4 git commands to generate.