elfcore.h 2.9 KB

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