1 /* Ravenscar Aarch64 target support.
3 Copyright (C) 2017-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 "aarch64-tdep.h"
24 #include "ravenscar-thread.h"
25 #include "aarch64-ravenscar-thread.h"
30 /* See aarch64-tdep.h for register numbers. */
32 static const int aarch64_context_offsets
[] =
35 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
36 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
37 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
38 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
39 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, 0,
44 /* FP, LR, SP, PC, CPSR */
45 /* Note that as task switch is synchronous, PC is in fact the LR here */
63 #define V_INIT_OFFSET 640
65 /* The ravenscar_arch_ops vector for most Aarch64 targets. */
67 static struct ravenscar_arch_ops aarch64_ravenscar_ops
68 (aarch64_context_offsets
,
71 /* The FPU context buffer starts with the FPSR register. */
72 aarch64_context_offsets
[AARCH64_FPSR_REGNUM
],
73 AARCH64_V0_REGNUM
, AARCH64_FPCR_REGNUM
);
75 /* Register aarch64_ravenscar_ops in GDBARCH. */
78 register_aarch64_ravenscar_ops (struct gdbarch
*gdbarch
)
80 set_gdbarch_ravenscar_ops (gdbarch
, &aarch64_ravenscar_ops
);