1 /* Ravenscar SPARC target support.
3 Copyright (C) 2004-2024 Free Software Foundation, Inc.
5 This file is part of GDB.
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 3 of the License, or
10 (at your option) any later version.
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.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 #include "sparc-tdep.h"
24 #include "ravenscar-thread.h"
25 #include "sparc-ravenscar-thread.h"
28 /* Register offsets from a referenced address (exempli gratia the
29 Thread_Descriptor). The referenced address depends on the register
30 number. The Thread_Descriptor layout and the stack layout are documented
31 in the GNAT sources, in sparc-bb.h. */
33 static const int sparc_register_offsets
[] =
36 -1, 0x24, 0x28, 0x2C, 0x30, 0x34, 0x38, 0x3C,
38 0x00, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C,
40 0x00, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C,
42 0x20, 0x24, 0x28, 0x2C, 0x30, 0x34, 0x38, 0x3C,
44 0x50, 0x54, 0x58, 0x5C, 0x60, 0x64, 0x68, 0x6C,
45 0x70, 0x74, 0x78, 0x7C, 0x80, 0x84, 0x88, 0x8C,
46 0x90, 0x94, 0x99, 0x9C, 0xA0, 0xA4, 0xA8, 0xAC,
47 0xB0, 0xB4, 0xBB, 0xBC, 0xC0, 0xC4, 0xC8, 0xCC,
48 /* Y PSR WIM TBR PC NPC FPSR CPSR */
49 0x40, 0x20, 0x44, -1, 0x1C, -1, 0x4C, -1
52 static struct ravenscar_arch_ops
sparc_ravenscar_ops (sparc_register_offsets
,
56 /* Register ravenscar_arch_ops in GDBARCH. */
59 register_sparc_ravenscar_ops (struct gdbarch
*gdbarch
)
61 set_gdbarch_ravenscar_ops (gdbarch
, &sparc_ravenscar_ops
);