procfs.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /* Core image file related definitions, RISC-V version.
  2. Copyright (C) 1996-2018 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library. If not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef _SYS_PROCFS_H
  16. #define _SYS_PROCFS_H 1
  17. /* This is somehow modelled after the file of the same name on SysVr4
  18. systems. It provides a definition of the core file format for ELF
  19. used on Linux. */
  20. #include <features.h>
  21. #include <sys/time.h>
  22. #include <sys/types.h>
  23. #include <sys/user.h>
  24. #include <sys/ucontext.h>
  25. /* ELF register definitions */
  26. #define ELF_NGREG NGREG
  27. #define ELF_NFPREG NFPREG
  28. typedef unsigned long int elf_greg_t;
  29. typedef unsigned long int elf_gregset_t[32];
  30. typedef union __riscv_mc_fp_state elf_fpregset_t;
  31. __BEGIN_DECLS
  32. struct elf_siginfo
  33. {
  34. int si_signo; /* Signal number. */
  35. int si_code; /* Extra code. */
  36. int si_errno; /* Errno. */
  37. };
  38. /* Definitions to generate Intel SVR4-like core files. These mostly
  39. have the same names as the SVR4 types with "elf_" tacked on the
  40. front to prevent clashes with linux definitions, and the typedef
  41. forms have been avoided. This is mostly like the SVR4 structure,
  42. but more Linuxy, with things that Linux does not support and which
  43. gdb doesn't really use excluded. Fields present but not used are
  44. marked with "XXX". */
  45. struct elf_prstatus
  46. {
  47. struct elf_siginfo pr_info; /* Info associated with signal. */
  48. short int pr_cursig; /* Current signal. */
  49. unsigned long int pr_sigpend; /* Set of pending signals. */
  50. unsigned long int pr_sighold; /* Set of held signals. */
  51. __pid_t pr_pid;
  52. __pid_t pr_ppid;
  53. __pid_t pr_pgrp;
  54. __pid_t pr_sid;
  55. struct timeval pr_utime; /* User time. */
  56. struct timeval pr_stime; /* System time. */
  57. struct timeval pr_cutime; /* Cumulative user time. */
  58. struct timeval pr_cstime; /* Cumulative system time. */
  59. elf_gregset_t pr_reg; /* GP registers. */
  60. int pr_fpvalid; /* True if math copro being used. */
  61. };
  62. #define ELF_PRARGSZ (80) /* Number of chars for args */
  63. struct elf_prpsinfo
  64. {
  65. char pr_state; /* Numeric process state. */
  66. char pr_sname; /* Char for pr_state. */
  67. char pr_zomb; /* Zombie. */
  68. char pr_nice; /* Nice val. */
  69. unsigned long int pr_flag; /* Flags. */
  70. long int pr_uid;
  71. long int pr_gid;
  72. int pr_pid, pr_ppid, pr_pgrp, pr_sid;
  73. /* Lots missing */
  74. char pr_fname[16]; /* Filename of executable. */
  75. char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
  76. };
  77. /* The rest of this file provides the types for emulation of the
  78. Solaris <proc_service.h> interfaces that should be implemented by
  79. users of libthread_db. */
  80. /* Addresses. */
  81. typedef void *psaddr_t;
  82. /* Register sets. Linux has different names. */
  83. typedef elf_gregset_t prgregset_t;
  84. typedef elf_fpregset_t prfpregset_t;
  85. /* We don't have any differences between processes and threads,
  86. therefore habe only ine PID type. */
  87. typedef __pid_t lwpid_t;
  88. /* Process status and info. In the end we do provide typedefs for them. */
  89. typedef struct elf_prstatus prstatus_t;
  90. typedef struct elf_prpsinfo prpsinfo_t;
  91. __END_DECLS
  92. #endif /* sys/procfs.h */