Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openjdk-multiarch-jdk8u
Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/agent/src/os/linux/glibc_procfs.h
38833 views
1
/* Copyright (C) 2001, 2004 Free Software Foundation, Inc.
2
This file is part of the GNU C Library.
3
The GNU C Library is free software; you can redistribute it and/or
4
modify it under the terms of the GNU Lesser General Public
5
License as published by the Free Software Foundation; either
6
version 2.1 of the License, or (at your option) any later version.
7
The GNU C Library is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10
Lesser General Public License for more details.
11
You should have received a copy of the GNU Lesser General Public
12
License along with the GNU C Library; if not, write to the Free
13
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
14
02111-1307 USA. */
15
16
#ifndef _SYS_PROCFS_H
17
#define _SYS_PROCFS_H 1
18
19
#define USE_LOCAL_PROCFS 1
20
21
/* This is somewhat modelled after the file of the same name on SVR4
22
systems. It provides a definition of the core file format for ELF
23
used on Linux. It doesn't have anything to do with the /proc file
24
system, even though Linux has one.
25
Anyway, the whole purpose of this file is for GDB and GDB only.
26
Don't read too much into it. Don't use it for anything other than
27
GDB unless you know what you are doing. */
28
29
#include <features.h>
30
#include <sys/time.h>
31
#include <sys/types.h>
32
#include <sys/user.h>
33
34
#ifndef USE_LOCAL_PROCFS
35
# include <sys/procfs.h>
36
#else
37
# include <sys/cdefs.h>
38
# include <sys/ucontext.h>
39
#endif
40
41
__BEGIN_DECLS
42
43
#ifdef USE_LOCAL_PROCFS
44
45
#if defined(__arm__)
46
typedef struct user_fpregs fpregset_t;
47
#elif defined(__aarch64__)
48
/*
49
struct user_regs_struct {
50
uint64_t regs[31];
51
uint64_t sp;
52
uint64_t pc;
53
uint64_t pstate;
54
};
55
*/
56
struct user_fpsimd_struct {
57
__uint128_t vregs[32];
58
uint32_t fpsr;
59
uint32_t fpcr;
60
};
61
typedef struct user_fpsimd_struct fpregset_t;
62
/*
63
#elif defined(__i386__)
64
struct _libc_fpreg {
65
unsigned short significand[4];
66
unsigned short exponent;
67
};
68
69
struct _libc_fpstate {
70
unsigned long cw;
71
unsigned long sw;
72
unsigned long tag;
73
unsigned long ipoff;
74
unsigned long cssel;
75
unsigned long dataoff;
76
unsigned long datasel;
77
struct _libc_fpreg _st[8];
78
unsigned long status;
79
};
80
81
typedef struct _libc_fpstate* fpregset_t;
82
#elif defined(__x86_64__)
83
struct _libc_fpxreg {
84
unsigned short significand[4];
85
unsigned short exponent;
86
unsigned short padding[3];
87
};
88
89
struct _libc_xmmreg {
90
uint32_t element[4];
91
};
92
93
struct _libc_fpstate {
94
uint16_t cwd;
95
uint16_t swd;
96
uint16_t ftw;
97
uint16_t fop;
98
uint64_t rip;
99
uint64_t rdp;
100
uint32_t mxcsr;
101
uint32_t mxcr_mask;
102
struct _libc_fpxreg _st[8];
103
struct _libc_xmmreg _xmm[16];
104
uint32_t padding[24];
105
};
106
107
typedef struct _libc_fpstate* fpregset_t;
108
*/
109
#endif
110
111
typedef unsigned long elf_greg_t;
112
typedef elf_greg_t elf_gregset_t[NGREG];
113
114
typedef fpregset_t elf_fpregset_t;
115
116
#if defined(__i386__)
117
typedef struct user_fpxregs_struct elf_fpxregset_t;
118
#endif
119
120
typedef elf_gregset_t prgregset_t;
121
typedef elf_fpregset_t prfpregset_t;
122
123
typedef pid_t lwpid_t;
124
typedef void* psaddr_t;
125
126
struct elf_siginfo {
127
int si_signo;
128
int si_code;
129
int si_errno;
130
};
131
132
#endif // USE_LOCAL_PROCFS
133
134
/* And the whole bunch of them. We could have used `struct
135
user_regs_struct' directly in the typedef, but tradition says that
136
the register set is an array, which does have some peculiar
137
semantics, so leave it that way. */
138
#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
139
140
#if !defined(__x86_64__) && !defined(__i386__)
141
/* Definitions to generate Intel SVR4-like core files. These mostly
142
have the same names as the SVR4 types with "elf_" tacked on the
143
front to prevent clashes with Linux definitions, and the typedef
144
forms have been avoided. This is mostly like the SVR4 structure,
145
but more Linuxy, with things that Linux does not support and which
146
GDB doesn't really use excluded. */
147
struct elf_prstatus
148
{
149
struct elf_siginfo pr_info; /* Info associated with signal. */
150
short int pr_cursig; /* Current signal. */
151
unsigned long int pr_sigpend; /* Set of pending signals. */
152
unsigned long int pr_sighold; /* Set of held signals. */
153
__pid_t pr_pid;
154
__pid_t pr_ppid;
155
__pid_t pr_pgrp;
156
__pid_t pr_sid;
157
struct timeval pr_utime; /* User time. */
158
struct timeval pr_stime; /* System time. */
159
struct timeval pr_cutime; /* Cumulative user time. */
160
struct timeval pr_cstime; /* Cumulative system time. */
161
elf_gregset_t pr_reg; /* GP registers. */
162
int pr_fpvalid; /* True if math copro being used. */
163
};
164
165
#define ELF_PRARGSZ (80) /* Number of chars for args. */
166
struct elf_prpsinfo
167
{
168
char pr_state; /* Numeric process state. */
169
char pr_sname; /* Char for pr_state. */
170
char pr_zomb; /* Zombie. */
171
char pr_nice; /* Nice val. */
172
unsigned long int pr_flag; /* Flags. */
173
#if __WORDSIZE == 32
174
unsigned short int pr_uid;
175
unsigned short int pr_gid;
176
#else
177
unsigned int pr_uid;
178
unsigned int pr_gid;
179
#endif
180
int pr_pid, pr_ppid, pr_pgrp, pr_sid;
181
/* Lots missing */
182
char pr_fname[16]; /* Filename of executable. */
183
char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
184
};
185
186
/* The rest of this file provides the types for emulation of the
187
Solaris <proc_service.h> interfaces that should be implemented by
188
users of libthread_db. */
189
190
/* Addresses. */
191
typedef void *psaddr_t;
192
193
/* We don't have any differences between processes and threads,
194
therefore have only one PID type. */
195
typedef __pid_t lwpid_t;
196
197
/* Register sets. Linux has different names. */
198
typedef elf_gregset_t prgregset_t;
199
typedef elf_fpregset_t prfpregset_t;
200
201
#endif // !__x86_64__ && !__i386__
202
203
/* Process status and info. In the end we do provide typedefs for them. */
204
typedef struct elf_prstatus prstatus_t;
205
typedef struct elf_prpsinfo prpsinfo_t;
206
207
__END_DECLS
208
209
#endif /* sys/procfs.h */
210
211