aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/binfmt_elf32.c67
-rw-r--r--arch/powerpc/kernel/process.c28
-rw-r--r--arch/powerpc/kernel/rtas_flash.c2
-rw-r--r--arch/powerpc/kernel/sys_ppc32.c2
-rw-r--r--arch/powerpc/kernel/syscalls.c1
5 files changed, 58 insertions, 42 deletions
diff --git a/arch/powerpc/kernel/binfmt_elf32.c b/arch/powerpc/kernel/binfmt_elf32.c
index 5cb58757e1b1..1d45d7782d4e 100644
--- a/arch/powerpc/kernel/binfmt_elf32.c
+++ b/arch/powerpc/kernel/binfmt_elf32.c
@@ -13,49 +13,44 @@
13 * 2 of the License, or (at your option) any later version. 13 * 2 of the License, or (at your option) any later version.
14 */ 14 */
15 15
16#define ELF_ARCH EM_PPC
17#define ELF_CLASS ELFCLASS32
18#define ELF_DATA ELFDATA2MSB;
19
20#include <asm/processor.h> 16#include <asm/processor.h>
21#include <linux/module.h> 17#include <linux/module.h>
22#include <linux/elfcore.h>
23#include <linux/compat.h> 18#include <linux/compat.h>
19#include <linux/elfcore-compat.h>
20
21#undef ELF_ARCH
22#undef ELF_CLASS
23#define ELF_CLASS ELFCLASS32
24#define ELF_ARCH EM_PPC
25
26#undef elfhdr
27#undef elf_phdr
28#undef elf_note
29#undef elf_addr_t
30#define elfhdr elf32_hdr
31#define elf_phdr elf32_phdr
32#define elf_note elf32_note
33#define elf_addr_t Elf32_Off
24 34
25#define elf_prstatus elf_prstatus32 35#define elf_prstatus compat_elf_prstatus
26struct elf_prstatus32 36#define elf_prpsinfo compat_elf_prpsinfo
37
38#define elf_core_copy_regs compat_elf_core_copy_regs
39static inline void compat_elf_core_copy_regs(compat_elf_gregset_t *elf_regs,
40 struct pt_regs *regs)
27{ 41{
28 struct elf_siginfo pr_info; /* Info associated with signal */ 42 PPC_ELF_CORE_COPY_REGS((*elf_regs), regs);
29 short pr_cursig; /* Current signal */ 43}
30 unsigned int pr_sigpend; /* Set of pending signals */
31 unsigned int pr_sighold; /* Set of held signals */
32 pid_t pr_pid;
33 pid_t pr_ppid;
34 pid_t pr_pgrp;
35 pid_t pr_sid;
36 struct compat_timeval pr_utime; /* User time */
37 struct compat_timeval pr_stime; /* System time */
38 struct compat_timeval pr_cutime; /* Cumulative user time */
39 struct compat_timeval pr_cstime; /* Cumulative system time */
40 elf_gregset_t pr_reg; /* General purpose registers. */
41 int pr_fpvalid; /* True if math co-processor being used. */
42};
43 44
44#define elf_prpsinfo elf_prpsinfo32 45#define elf_core_copy_task_regs compat_elf_core_copy_task_regs
45struct elf_prpsinfo32 46static int compat_elf_core_copy_task_regs(struct task_struct *tsk,
47 compat_elf_gregset_t *elf_regs)
46{ 48{
47 char pr_state; /* numeric process state */ 49 struct pt_regs *regs = tsk->thread.regs;
48 char pr_sname; /* char for pr_state */ 50 if (regs)
49 char pr_zomb; /* zombie */ 51 compat_elf_core_copy_regs(elf_regs, regs);
50 char pr_nice; /* nice val */ 52 return 1;
51 unsigned int pr_flag; /* flags */ 53}
52 u32 pr_uid;
53 u32 pr_gid;
54 pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
55 /* Lots missing */
56 char pr_fname[16]; /* filename of executable */
57 char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
58};
59 54
60#include <linux/time.h> 55#include <linux/time.h>
61 56
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 7949c203cb89..ea6ad7a2a7e3 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -149,10 +149,32 @@ void flush_altivec_to_thread(struct task_struct *tsk)
149 } 149 }
150} 150}
151 151
152int dump_task_altivec(struct pt_regs *regs, elf_vrregset_t *vrregs) 152int dump_task_altivec(struct task_struct *tsk, elf_vrregset_t *vrregs)
153{ 153{
154 flush_altivec_to_thread(current); 154 /* ELF_NVRREG includes the VSCR and VRSAVE which we need to save
155 memcpy(vrregs, &current->thread.vr[0], sizeof(*vrregs)); 155 * separately, see below */
156 const int nregs = ELF_NVRREG - 2;
157 elf_vrreg_t *reg;
158 u32 *dest;
159
160 if (tsk == current)
161 flush_altivec_to_thread(tsk);
162
163 reg = (elf_vrreg_t *)vrregs;
164
165 /* copy the 32 vr registers */
166 memcpy(reg, &tsk->thread.vr[0], nregs * sizeof(*reg));
167 reg += nregs;
168
169 /* copy the vscr */
170 memcpy(reg, &tsk->thread.vscr, sizeof(*reg));
171 reg++;
172
173 /* vrsave is stored in the high 32bit slot of the final 128bits */
174 memset(reg, 0, sizeof(*reg));
175 dest = (u32 *)reg;
176 *dest = tsk->thread.vrsave;
177
156 return 1; 178 return 1;
157} 179}
158#endif /* CONFIG_ALTIVEC */ 180#endif /* CONFIG_ALTIVEC */
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c
index 62b7bf2f3eab..f2276593f416 100644
--- a/arch/powerpc/kernel/rtas_flash.c
+++ b/arch/powerpc/kernel/rtas_flash.c
@@ -286,7 +286,7 @@ static ssize_t rtas_flash_read(struct file *file, char __user *buf,
286} 286}
287 287
288/* constructor for flash_block_cache */ 288/* constructor for flash_block_cache */
289void rtas_block_ctor(void *ptr, struct kmem_cache *cache, unsigned long flags) 289void rtas_block_ctor(struct kmem_cache *cache, void *ptr)
290{ 290{
291 memset(ptr, 0, RTAS_BLK_SIZE); 291 memset(ptr, 0, RTAS_BLK_SIZE);
292} 292}
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index bd85b5fd08c8..4a4f5c6b560b 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -41,10 +41,10 @@
41#include <linux/compat.h> 41#include <linux/compat.h>
42#include <linux/ptrace.h> 42#include <linux/ptrace.h>
43#include <linux/elf.h> 43#include <linux/elf.h>
44#include <linux/ipc.h>
44 45
45#include <asm/ptrace.h> 46#include <asm/ptrace.h>
46#include <asm/types.h> 47#include <asm/types.h>
47#include <asm/ipc.h>
48#include <asm/uaccess.h> 48#include <asm/uaccess.h>
49#include <asm/unistd.h> 49#include <asm/unistd.h>
50#include <asm/semaphore.h> 50#include <asm/semaphore.h>
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
index f85f402ceaef..3b1d5dd65643 100644
--- a/arch/powerpc/kernel/syscalls.c
+++ b/arch/powerpc/kernel/syscalls.c
@@ -38,7 +38,6 @@
38#include <linux/personality.h> 38#include <linux/personality.h>
39 39
40#include <asm/uaccess.h> 40#include <asm/uaccess.h>
41#include <asm/ipc.h>
42#include <asm/semaphore.h> 41#include <asm/semaphore.h>
43#include <asm/syscalls.h> 42#include <asm/syscalls.h>
44#include <asm/time.h> 43#include <asm/time.h>