2 * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com)
4 * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
8 #define _SYS_PROCFS_H 1
10 /* This is somewhat modelled after the file of the same name on SVR4
11 systems. It provides a definition of the core file format for ELF
12 used on Linux. It doesn't have anything to do with the /proc file
13 system, even though Linux has one.
15 Anyway, the whole purpose of this file is for GDB and GDB only.
16 Don't read too much into it. Don't use it for anything other than
17 GDB unless you know what you are doing. */
21 #include <sys/types.h>
26 /* Type for a general-purpose register. */
27 typedef unsigned long elf_greg_t;
29 /* And the whole bunch of them. We could have used `struct
30 user_regs' directly in the typedef, but tradition says that
31 the register set is an array, which does have some peculiar
32 semantics, so leave it that way. */
34 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
35 typedef struct { } elf_fpregset_t;
40 int si_signo; /* Signal number. */
41 int si_code; /* Extra code. */
42 int si_errno; /* Errno. */
45 /* Definitions to generate Intel SVR4-like core files. These mostly
46 have the same names as the SVR4 types with "elf_" tacked on the
47 front to prevent clashes with Linux definitions, and the typedef
48 forms have been avoided. This is mostly like the SVR4 structure,
49 but more Linuxy, with things that Linux does not support and which
50 GDB doesn't really use excluded. */
54 struct elf_siginfo pr_info; /* Info associated with signal. */
55 short int pr_cursig; /* Current signal. */
56 unsigned long int pr_sigpend; /* Set of pending signals. */
57 unsigned long int pr_sighold; /* Set of held signals. */
62 struct timeval pr_utime; /* User time. */
63 struct timeval pr_stime; /* System time. */
64 struct timeval pr_cutime; /* Cumulative user time. */
65 struct timeval pr_cstime; /* Cumulative system time. */
66 elf_gregset_t pr_reg; /* GP registers. */
67 int pr_fpvalid; /* True if math copro being used. */
71 #define ELF_PRARGSZ (80) /* Number of chars for args. */
75 char pr_state; /* Numeric process state. */
76 char pr_sname; /* Char for pr_state. */
77 char pr_zomb; /* Zombie. */
78 char pr_nice; /* Nice val. */
79 unsigned long int pr_flag; /* Flags. */
80 unsigned short int pr_uid;
81 unsigned short int pr_gid;
82 int pr_pid, pr_ppid, pr_pgrp, pr_sid;
84 char pr_fname[16]; /* Filename of executable. */
85 char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
88 /* The rest of this file provides the types for emulation of the
89 Solaris <proc_service.h> interfaces that should be implemented by
90 users of libthread_db. */
93 typedef void *psaddr_t;
95 /* Register sets. Linux has different names. */
96 typedef elf_gregset_t prgregset_t;
97 typedef elf_fpregset_t prfpregset_t;
99 /* We don't have any differences between processes and threads,
100 therefore have only one PID type. */
101 typedef __pid_t lwpid_t;
103 /* Process status and info. In the end we do provide typedefs for them. */
104 typedef struct elf_prstatus prstatus_t;
105 typedef struct elf_prpsinfo prpsinfo_t;
109 #endif /* sys/procfs.h */