elfcore.h 3.0 KB

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