1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _UAPI_LINUX_ELFCORE_H
3#define _UAPI_LINUX_ELFCORE_H
4
5#include <linux/types.h>
6#include <linux/signal.h>
7#include <linux/time.h>
8#include <linux/ptrace.h>
9#include <linux/elf.h>
10#include <linux/fs.h>
11
12struct elf_siginfo
13{
14 int si_signo; /* signal number */
15 int si_code; /* extra code */
16 int si_errno; /* errno */
17};
18
19
20#ifndef __KERNEL__
21typedef elf_greg_t greg_t;
22typedef elf_gregset_t gregset_t;
23typedef elf_fpregset_t fpregset_t;
24typedef elf_fpxregset_t fpxregset_t;
25#define NGREG ELF_NGREG
26#endif
27
28/*
29 * Definitions to generate Intel SVR4-like core files.
30 * These mostly have the same names as the SVR4 types with "elf_"
31 * tacked on the front to prevent clashes with linux definitions,
32 * and the typedef forms have been avoided. This is mostly like
33 * the SVR4 structure, but more Linuxy, with things that Linux does
34 * not support and which gdb doesn't really use excluded.
35 * Fields present but not used are marked with "XXX".
36 */
37struct elf_prstatus
38{
39#if 0
40 long pr_flags; /* XXX Process flags */
41 short pr_why; /* XXX Reason for process halt */
42 short pr_what; /* XXX More detailed reason */
43#endif
44 struct elf_siginfo pr_info; /* Info associated with signal */
45 short pr_cursig; /* Current signal */
46 unsigned long pr_sigpend; /* Set of pending signals */
47 unsigned long pr_sighold; /* Set of held signals */
48#if 0
49 struct sigaltstack pr_altstack; /* Alternate stack info */
50 struct sigaction pr_action; /* Signal action for current sig */
51#endif
52 pid_t pr_pid;
53 pid_t pr_ppid;
54 pid_t pr_pgrp;
55 pid_t pr_sid;
56 struct timeval pr_utime; /* User time */
57 struct timeval pr_stime; /* System time */
58 struct timeval pr_cutime; /* Cumulative user time */
59 struct timeval pr_cstime; /* Cumulative system time */
60#if 0
61 long pr_instr; /* Current instruction */
62#endif
63 elf_gregset_t pr_reg; /* GP registers */
64#ifdef CONFIG_BINFMT_ELF_FDPIC
65 /* When using FDPIC, the loadmap addresses need to be communicated
66 * to GDB in order for GDB to do the necessary relocations. The
67 * fields (below) used to communicate this information are placed
68 * immediately after ``pr_reg'', so that the loadmap addresses may
69 * be viewed as part of the register set if so desired.
70 */
71 unsigned long pr_exec_fdpic_loadmap;
72 unsigned long pr_interp_fdpic_loadmap;
73#endif
74 int pr_fpvalid; /* True if math co-processor being used. */
75};
76
77#define ELF_PRARGSZ (80) /* Number of chars for args */
78
79struct elf_prpsinfo
80{
81 char pr_state; /* numeric process state */
82 char pr_sname; /* char for pr_state */
83 char pr_zomb; /* zombie */
84 char pr_nice; /* nice val */
85 unsigned long pr_flag; /* flags */
86 __kernel_uid_t pr_uid;
87 __kernel_gid_t pr_gid;
88 pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
89 /* Lots missing */
90 char pr_fname[16]; /* filename of executable */
91 char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
92};
93
94#ifndef __KERNEL__
95typedef struct elf_prstatus prstatus_t;
96typedef struct elf_prpsinfo prpsinfo_t;
97#define PRARGSZ ELF_PRARGSZ
98#endif
99
100
101#endif /* _UAPI_LINUX_ELFCORE_H */
102