1 /* Ravenscar PowerPC target support.
3 Copyright (C) 2011-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/>. */
24 #include "ravenscar-thread.h"
25 #include "ppc-ravenscar-thread.h"
29 /* See ppc-tdep.h for register numbers. */
31 static const int powerpc_context_offsets
[] =
34 NO_OFFSET
, 0, 4, NO_OFFSET
,
35 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
36 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
44 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
45 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
46 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
47 NO_OFFSET
, NO_OFFSET
, 96, 104,
54 88, NO_OFFSET
, 84, NO_OFFSET
,
57 NO_OFFSET
, NO_OFFSET
, 240
60 static const int e500_context_offsets
[] =
63 NO_OFFSET
, 4, 12, NO_OFFSET
,
64 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
65 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
66 NO_OFFSET
, 20, 28, 36,
73 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
74 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
75 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
76 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
77 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
78 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
79 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
80 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
83 172, NO_OFFSET
, 168, NO_OFFSET
,
85 /* CTR, XER, FPSCR, MQ */
86 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
89 NO_OFFSET
, 0, 8, NO_OFFSET
,
90 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
91 NO_OFFSET
, NO_OFFSET
, NO_OFFSET
, NO_OFFSET
,
92 NO_OFFSET
, 16, 24, 32,
102 /* The ravenscar_arch_ops vector for most PowerPC targets. */
104 static struct ravenscar_arch_ops ppc_ravenscar_powerpc_ops
105 (powerpc_context_offsets
);
107 /* Register ppc_ravenscar_powerpc_ops in GDBARCH. */
110 register_ppc_ravenscar_ops (struct gdbarch
*gdbarch
)
112 set_gdbarch_ravenscar_ops (gdbarch
, &ppc_ravenscar_powerpc_ops
);
115 /* The ravenscar_arch_ops vector for E500 targets. */
117 static struct ravenscar_arch_ops
ppc_ravenscar_e500_ops (e500_context_offsets
);
119 /* Register ppc_ravenscar_e500_ops in GDBARCH. */
122 register_e500_ravenscar_ops (struct gdbarch
*gdbarch
)
124 set_gdbarch_ravenscar_ops (gdbarch
, &ppc_ravenscar_e500_ops
);