aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/ia32/elfcore32.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/ia32/elfcore32.h')
-rw-r--r--arch/ia64/ia32/elfcore32.h148
1 files changed, 0 insertions, 148 deletions
diff --git a/arch/ia64/ia32/elfcore32.h b/arch/ia64/ia32/elfcore32.h
deleted file mode 100644
index 657725742617..000000000000
--- a/arch/ia64/ia32/elfcore32.h
+++ /dev/null
@@ -1,148 +0,0 @@
1/*
2 * IA-32 ELF core dump support.
3 *
4 * Copyright (C) 2003 Arun Sharma <arun.sharma@intel.com>
5 *
6 * Derived from the x86_64 version
7 */
8#ifndef _ELFCORE32_H_
9#define _ELFCORE32_H_
10
11#include <asm/intrinsics.h>
12#include <asm/uaccess.h>
13
14/* Override elfcore.h */
15#define _LINUX_ELFCORE_H 1
16typedef unsigned int elf_greg_t;
17
18#define ELF_NGREG (sizeof (struct user_regs_struct32) / sizeof(elf_greg_t))
19typedef elf_greg_t elf_gregset_t[ELF_NGREG];
20
21typedef struct ia32_user_i387_struct elf_fpregset_t;
22typedef struct ia32_user_fxsr_struct elf_fpxregset_t;
23
24struct elf_siginfo
25{
26 int si_signo; /* signal number */
27 int si_code; /* extra code */
28 int si_errno; /* errno */
29};
30
31#ifdef CONFIG_VIRT_CPU_ACCOUNTING
32/*
33 * Hacks are here since types between compat_timeval (= pair of s32) and
34 * ia64-native timeval (= pair of s64) are not compatible, at least a file
35 * arch/ia64/ia32/../../../fs/binfmt_elf.c will get warnings from compiler on
36 * use of cputime_to_timeval(), which usually an alias of jiffies_to_timeval().
37 */
38#define cputime_to_timeval(a,b) \
39 do { (b)->tv_usec = 0; (b)->tv_sec = (a)/NSEC_PER_SEC; } while(0)
40#else
41#define jiffies_to_timeval(a,b) \
42 do { (b)->tv_usec = 0; (b)->tv_sec = (a)/HZ; } while(0)
43#endif
44
45struct elf_prstatus
46{
47 struct elf_siginfo pr_info; /* Info associated with signal */
48 short pr_cursig; /* Current signal */
49 unsigned int pr_sigpend; /* Set of pending signals */
50 unsigned 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 compat_timeval pr_utime; /* User time */
56 struct compat_timeval pr_stime; /* System time */
57 struct compat_timeval pr_cutime; /* Cumulative user time */
58 struct compat_timeval pr_cstime; /* Cumulative system time */
59 elf_gregset_t pr_reg; /* GP registers */
60 int pr_fpvalid; /* True if math co-processor being used. */
61};
62
63#define ELF_PRARGSZ (80) /* Number of chars for args */
64
65struct elf_prpsinfo
66{
67 char pr_state; /* numeric process state */
68 char pr_sname; /* char for pr_state */
69 char pr_zomb; /* zombie */
70 char pr_nice; /* nice val */
71 unsigned int pr_flag; /* flags */
72 __u16 pr_uid;
73 __u16 pr_gid;
74 pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
75 /* Lots missing */
76 char pr_fname[16]; /* filename of executable */
77 char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
78};
79
80#define ELF_CORE_COPY_REGS(pr_reg, regs) \
81 pr_reg[0] = regs->r11; \
82 pr_reg[1] = regs->r9; \
83 pr_reg[2] = regs->r10; \
84 pr_reg[3] = regs->r14; \
85 pr_reg[4] = regs->r15; \
86 pr_reg[5] = regs->r13; \
87 pr_reg[6] = regs->r8; \
88 pr_reg[7] = regs->r16 & 0xffff; \
89 pr_reg[8] = (regs->r16 >> 16) & 0xffff; \
90 pr_reg[9] = (regs->r16 >> 32) & 0xffff; \
91 pr_reg[10] = (regs->r16 >> 48) & 0xffff; \
92 pr_reg[11] = regs->r1; \
93 pr_reg[12] = regs->cr_iip; \
94 pr_reg[13] = regs->r17 & 0xffff; \
95 pr_reg[14] = ia64_getreg(_IA64_REG_AR_EFLAG); \
96 pr_reg[15] = regs->r12; \
97 pr_reg[16] = (regs->r17 >> 16) & 0xffff;
98
99static inline void elf_core_copy_regs(elf_gregset_t *elfregs,
100 struct pt_regs *regs)
101{
102 ELF_CORE_COPY_REGS((*elfregs), regs)
103}
104
105static inline int elf_core_copy_task_regs(struct task_struct *t,
106 elf_gregset_t* elfregs)
107{
108 ELF_CORE_COPY_REGS((*elfregs), task_pt_regs(t));
109 return 1;
110}
111
112static inline int
113elf_core_copy_task_fpregs(struct task_struct *tsk, struct pt_regs *regs, elf_fpregset_t *fpu)
114{
115 struct ia32_user_i387_struct *fpstate = (void*)fpu;
116 mm_segment_t old_fs;
117
118 if (!tsk_used_math(tsk))
119 return 0;
120
121 old_fs = get_fs();
122 set_fs(KERNEL_DS);
123 save_ia32_fpstate(tsk, (struct ia32_user_i387_struct __user *) fpstate);
124 set_fs(old_fs);
125
126 return 1;
127}
128
129#define ELF_CORE_COPY_XFPREGS 1
130#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
131static inline int
132elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t *xfpu)
133{
134 struct ia32_user_fxsr_struct *fpxstate = (void*) xfpu;
135 mm_segment_t old_fs;
136
137 if (!tsk_used_math(tsk))
138 return 0;
139
140 old_fs = get_fs();
141 set_fs(KERNEL_DS);
142 save_ia32_fpxstate(tsk, (struct ia32_user_fxsr_struct __user *) fpxstate);
143 set_fs(old_fs);
144
145 return 1;
146}
147
148#endif /* _ELFCORE32_H_ */