]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/nat/ppc-linux.h
059b99465baad9952060030fb6a40a0755bede6b
[thirdparty/binutils-gdb.git] / gdb / nat / ppc-linux.h
1 /* Copyright (C) 1995-2019 Free Software Foundation, Inc.
2
3 This file is part of GDB.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17
18 #ifndef PPC_LINUX_H
19 #define PPC_LINUX_H 1
20
21 #include <asm/ptrace.h>
22 #include <asm/cputable.h>
23
24 /* This sometimes isn't defined. */
25 #ifndef PT_ORIG_R3
26 #define PT_ORIG_R3 34
27 #endif
28 #ifndef PT_TRAP
29 #define PT_TRAP 40
30 #endif
31
32 /* The PPC_FEATURE_* defines should be provided by <asm/cputable.h>.
33 If they aren't, we can provide them ourselves (their values are fixed
34 because they are part of the kernel ABI). They are used in the AT_HWCAP
35 entry of the AUXV. */
36 #ifndef PPC_FEATURE_CELL
37 #define PPC_FEATURE_CELL 0x00010000
38 #endif
39 #ifndef PPC_FEATURE_BOOKE
40 #define PPC_FEATURE_BOOKE 0x00008000
41 #endif
42 #ifndef PPC_FEATURE_HAS_DFP
43 #define PPC_FEATURE_HAS_DFP 0x00000400 /* Decimal Floating Point. */
44 #endif
45 #ifndef PPC_FEATURE_HAS_VSX
46 #define PPC_FEATURE_HAS_VSX 0x00000080
47 #endif
48 #ifndef PPC_FEATURE_HAS_ALTIVEC
49 #define PPC_FEATURE_HAS_ALTIVEC 0x10000000
50 #endif
51 #ifndef PPC_FEATURE_HAS_SPE
52 #define PPC_FEATURE_HAS_SPE 0x00800000
53 #endif
54 #ifndef PPC_FEATURE2_DSCR
55 #define PPC_FEATURE2_DSCR 0x20000000
56 #endif
57 #ifndef PPC_FEATURE2_ARCH_2_07
58 #define PPC_FEATURE2_ARCH_2_07 0x80000000
59 #endif
60 #ifndef PPC_FEATURE2_TAR
61 #define PPC_FEATURE2_TAR 0x04000000
62 #endif
63 #ifndef PPC_FEATURE2_EBB
64 #define PPC_FEATURE2_EBB 0x10000000
65 #endif
66 #ifndef PPC_FEATURE2_HTM
67 #define PPC_FEATURE2_HTM 0x40000000
68 #endif
69
70 /* Glibc's headers don't define PTRACE_GETVRREGS so we cannot use a
71 configure time check. Some older glibc's (for instance 2.2.1)
72 don't have a specific powerpc version of ptrace.h, and fall back on
73 a generic one. In such cases, sys/ptrace.h defines
74 PTRACE_GETFPXREGS and PTRACE_SETFPXREGS to the same numbers that
75 ppc kernel's asm/ptrace.h defines PTRACE_GETVRREGS and
76 PTRACE_SETVRREGS to be. This also makes a configury check pretty
77 much useless. */
78
79 /* These definitions should really come from the glibc header files,
80 but Glibc doesn't know about the vrregs yet. */
81 #ifndef PTRACE_GETVRREGS
82 #define PTRACE_GETVRREGS 18
83 #define PTRACE_SETVRREGS 19
84 #endif
85
86 /* PTRACE requests for POWER7 VSX registers. */
87 #ifndef PTRACE_GETVSXREGS
88 #define PTRACE_GETVSXREGS 27
89 #define PTRACE_SETVSXREGS 28
90 #endif
91
92 /* Similarly for the ptrace requests for getting / setting the SPE
93 registers (ev0 -- ev31, acc, and spefscr). See the description of
94 gdb_evrregset_t for details. */
95 #ifndef PTRACE_GETEVRREGS
96 #define PTRACE_GETEVRREGS 20
97 #define PTRACE_SETEVRREGS 21
98 #endif
99
100 /* Target Address Register. */
101 #ifndef NT_PPC_TAR
102 #define NT_PPC_TAR 0x103
103 #endif
104
105 /* Program Priority Register. */
106 #ifndef NT_PPC_PPR
107 #define NT_PPC_PPR 0x104
108 #endif
109
110 /* Data Stream Control Register. */
111 #ifndef NT_PPC_DSCR
112 #define NT_PPC_DSCR 0x105
113 #endif
114
115 /* Event Based Branch Registers. */
116 #ifndef NT_PPC_EBB
117 #define NT_PPC_EBB 0x106
118 #endif
119
120 /* Performance Monitor Registers. */
121 #ifndef NT_PPC_PMU
122 #define NT_PPC_PMU 0x107
123 #endif
124
125 /* TM checkpointed GPR Registers. */
126 #ifndef NT_PPC_TM_CGPR
127 #define NT_PPC_TM_CGPR 0x108
128 #endif
129
130 /* TM checkpointed FPR Registers. */
131 #ifndef NT_PPC_TM_CFPR
132 #define NT_PPC_TM_CFPR 0x109
133 #endif
134
135 /* TM checkpointed VMX Registers. */
136 #ifndef NT_PPC_TM_CVMX
137 #define NT_PPC_TM_CVMX 0x10a
138 #endif
139
140 /* TM checkpointed VSX Registers. */
141 #ifndef NT_PPC_TM_CVSX
142 #define NT_PPC_TM_CVSX 0x10b
143 #endif
144
145 /* TM Special Purpose Registers. */
146 #ifndef NT_PPC_TM_SPR
147 #define NT_PPC_TM_SPR 0x10c
148 #endif
149
150 /* TM checkpointed Target Address Register. */
151 #ifndef NT_PPC_TM_CTAR
152 #define NT_PPC_TM_CTAR 0x10d
153 #endif
154
155 /* TM checkpointed Program Priority Register. */
156 #ifndef NT_PPC_TM_CPPR
157 #define NT_PPC_TM_CPPR 0x10e
158 #endif
159
160 /* TM checkpointed Data Stream Control Register. */
161 #ifndef NT_PPC_TM_CDSCR
162 #define NT_PPC_TM_CDSCR 0x10f
163 #endif
164
165 /* Return the wordsize of the target, either 4 or 8 bytes. */
166 int ppc_linux_target_wordsize (int tid);
167
168 #endif