aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/elfcore.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/elfcore.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/linux/elfcore.h')
-rw-r--r--include/linux/elfcore.h129
1 files changed, 129 insertions, 0 deletions
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
new file mode 100644
index 000000000000..dbd7bb4a33b7
--- /dev/null
+++ b/include/linux/elfcore.h
@@ -0,0 +1,129 @@
1#ifndef _LINUX_ELFCORE_H
2#define _LINUX_ELFCORE_H
3
4#include <linux/types.h>
5#include <linux/signal.h>
6#include <linux/time.h>
7#include <linux/user.h>
8
9struct elf_siginfo
10{
11 int si_signo; /* signal number */
12 int si_code; /* extra code */
13 int si_errno; /* errno */
14};
15
16#include <asm/elf.h>
17
18#ifndef __KERNEL__
19typedef elf_greg_t greg_t;
20typedef elf_gregset_t gregset_t;
21typedef elf_fpregset_t fpregset_t;
22typedef elf_fpxregset_t fpxregset_t;
23#define NGREG ELF_NGREG
24#endif
25
26/*
27 * Definitions to generate Intel SVR4-like core files.
28 * These mostly have the same names as the SVR4 types with "elf_"
29 * tacked on the front to prevent clashes with linux definitions,
30 * and the typedef forms have been avoided. This is mostly like
31 * the SVR4 structure, but more Linuxy, with things that Linux does
32 * not support and which gdb doesn't really use excluded.
33 * Fields present but not used are marked with "XXX".
34 */
35struct elf_prstatus
36{
37#if 0
38 long pr_flags; /* XXX Process flags */
39 short pr_why; /* XXX Reason for process halt */
40 short pr_what; /* XXX More detailed reason */
41#endif
42 struct elf_siginfo pr_info; /* Info associated with signal */
43 short pr_cursig; /* Current signal */
44 unsigned long pr_sigpend; /* Set of pending signals */
45 unsigned long pr_sighold; /* Set of held signals */
46#if 0
47 struct sigaltstack pr_altstack; /* Alternate stack info */
48 struct sigaction pr_action; /* Signal action for current sig */
49#endif
50 pid_t pr_pid;
51 pid_t pr_ppid;
52 pid_t pr_pgrp;
53 pid_t pr_sid;
54 struct timeval pr_utime; /* User time */
55 struct timeval pr_stime; /* System time */
56 struct timeval pr_cutime; /* Cumulative user time */
57 struct timeval pr_cstime; /* Cumulative system time */
58#if 0
59 long pr_instr; /* Current instruction */
60#endif
61 elf_gregset_t pr_reg; /* GP registers */
62 int pr_fpvalid; /* True if math co-processor being used. */
63};
64
65#define ELF_PRARGSZ (80) /* Number of chars for args */
66
67struct elf_prpsinfo
68{
69 char pr_state; /* numeric process state */
70 char pr_sname; /* char for pr_state */
71 char pr_zomb; /* zombie */
72 char pr_nice; /* nice val */
73 unsigned long pr_flag; /* flags */
74 __kernel_uid_t pr_uid;
75 __kernel_gid_t pr_gid;
76 pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
77 /* Lots missing */
78 char pr_fname[16]; /* filename of executable */
79 char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
80};
81
82#ifndef __KERNEL__
83typedef struct elf_prstatus prstatus_t;
84typedef struct elf_prpsinfo prpsinfo_t;
85#define PRARGSZ ELF_PRARGSZ
86#endif
87
88#ifdef __KERNEL__
89static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *regs)
90{
91#ifdef ELF_CORE_COPY_REGS
92 ELF_CORE_COPY_REGS((*elfregs), regs)
93#else
94 BUG_ON(sizeof(*elfregs) != sizeof(*regs));
95 *(struct pt_regs *)elfregs = *regs;
96#endif
97}
98
99static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs)
100{
101#ifdef ELF_CORE_COPY_TASK_REGS
102
103 return ELF_CORE_COPY_TASK_REGS(t, elfregs);
104#endif
105 return 0;
106}
107
108extern int dump_fpu (struct pt_regs *, elf_fpregset_t *);
109
110static inline int elf_core_copy_task_fpregs(struct task_struct *t, struct pt_regs *regs, elf_fpregset_t *fpu)
111{
112#ifdef ELF_CORE_COPY_FPREGS
113 return ELF_CORE_COPY_FPREGS(t, fpu);
114#else
115 return dump_fpu(regs, fpu);
116#endif
117}
118
119#ifdef ELF_CORE_COPY_XFPREGS
120static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu)
121{
122 return ELF_CORE_COPY_XFPREGS(t, xfpu);
123}
124#endif
125
126#endif /* __KERNEL__ */
127
128
129#endif /* _LINUX_ELFCORE_H */