diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-01-12 04:05:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-12 12:08:54 -0500 |
commit | 6c3559fc458e3ed171d7a8bf6a6d7eaea1e7b2e5 (patch) | |
tree | e6c68721887f4f6fbc5aa0c2e6629f30f73f74b2 /arch | |
parent | b7f6961d83d480c8636543d1d0dbb9584b878a68 (diff) |
[PATCH] m32r: task_pt_regs(), task_stack_page(), task_thread_info()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/m32r/kernel/process.c | 5 | ||||
-rw-r--r-- | arch/m32r/kernel/ptrace.c | 25 | ||||
-rw-r--r-- | arch/m32r/kernel/smpboot.c | 2 |
3 files changed, 6 insertions, 26 deletions
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c index 2a1f250349b7..5dfc7ea45cf7 100644 --- a/arch/m32r/kernel/process.c +++ b/arch/m32r/kernel/process.c | |||
@@ -242,13 +242,10 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) | |||
242 | int copy_thread(int nr, unsigned long clone_flags, unsigned long spu, | 242 | int copy_thread(int nr, unsigned long clone_flags, unsigned long spu, |
243 | unsigned long unused, struct task_struct *tsk, struct pt_regs *regs) | 243 | unsigned long unused, struct task_struct *tsk, struct pt_regs *regs) |
244 | { | 244 | { |
245 | struct pt_regs *childregs; | 245 | struct pt_regs *childregs = task_pt_regs(tsk); |
246 | unsigned long sp = (unsigned long)tsk->thread_info + THREAD_SIZE; | ||
247 | extern void ret_from_fork(void); | 246 | extern void ret_from_fork(void); |
248 | 247 | ||
249 | /* Copy registers */ | 248 | /* Copy registers */ |
250 | sp -= sizeof (struct pt_regs); | ||
251 | childregs = (struct pt_regs *)sp; | ||
252 | *childregs = *regs; | 249 | *childregs = *regs; |
253 | 250 | ||
254 | childregs->spu = spu; | 251 | childregs->spu = spu; |
diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c index 9b75caaf5cec..340a3bf59b88 100644 --- a/arch/m32r/kernel/ptrace.c +++ b/arch/m32r/kernel/ptrace.c | |||
@@ -35,23 +35,6 @@ | |||
35 | #include <asm/mmu_context.h> | 35 | #include <asm/mmu_context.h> |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * Get the address of the live pt_regs for the specified task. | ||
39 | * These are saved onto the top kernel stack when the process | ||
40 | * is not running. | ||
41 | * | ||
42 | * Note: if a user thread is execve'd from kernel space, the | ||
43 | * kernel stack will not be empty on entry to the kernel, so | ||
44 | * ptracing these tasks will fail. | ||
45 | */ | ||
46 | static inline struct pt_regs * | ||
47 | get_user_regs(struct task_struct *task) | ||
48 | { | ||
49 | return (struct pt_regs *) | ||
50 | ((unsigned long)task->thread_info + THREAD_SIZE | ||
51 | - sizeof(struct pt_regs)); | ||
52 | } | ||
53 | |||
54 | /* | ||
55 | * This routine will get a word off of the process kernel stack. | 38 | * This routine will get a word off of the process kernel stack. |
56 | */ | 39 | */ |
57 | static inline unsigned long int | 40 | static inline unsigned long int |
@@ -59,7 +42,7 @@ get_stack_long(struct task_struct *task, int offset) | |||
59 | { | 42 | { |
60 | unsigned long *stack; | 43 | unsigned long *stack; |
61 | 44 | ||
62 | stack = (unsigned long *)get_user_regs(task); | 45 | stack = (unsigned long *)task_pt_regs(task); |
63 | 46 | ||
64 | return stack[offset]; | 47 | return stack[offset]; |
65 | } | 48 | } |
@@ -72,7 +55,7 @@ put_stack_long(struct task_struct *task, int offset, unsigned long data) | |||
72 | { | 55 | { |
73 | unsigned long *stack; | 56 | unsigned long *stack; |
74 | 57 | ||
75 | stack = (unsigned long *)get_user_regs(task); | 58 | stack = (unsigned long *)task_pt_regs(task); |
76 | stack[offset] = data; | 59 | stack[offset] = data; |
77 | 60 | ||
78 | return 0; | 61 | return 0; |
@@ -208,7 +191,7 @@ static int ptrace_write_user(struct task_struct *tsk, unsigned long off, | |||
208 | */ | 191 | */ |
209 | static int ptrace_getregs(struct task_struct *tsk, void __user *uregs) | 192 | static int ptrace_getregs(struct task_struct *tsk, void __user *uregs) |
210 | { | 193 | { |
211 | struct pt_regs *regs = get_user_regs(tsk); | 194 | struct pt_regs *regs = task_pt_regs(tsk); |
212 | 195 | ||
213 | return copy_to_user(uregs, regs, sizeof(struct pt_regs)) ? -EFAULT : 0; | 196 | return copy_to_user(uregs, regs, sizeof(struct pt_regs)) ? -EFAULT : 0; |
214 | } | 197 | } |
@@ -223,7 +206,7 @@ static int ptrace_setregs(struct task_struct *tsk, void __user *uregs) | |||
223 | 206 | ||
224 | ret = -EFAULT; | 207 | ret = -EFAULT; |
225 | if (copy_from_user(&newregs, uregs, sizeof(struct pt_regs)) == 0) { | 208 | if (copy_from_user(&newregs, uregs, sizeof(struct pt_regs)) == 0) { |
226 | struct pt_regs *regs = get_user_regs(tsk); | 209 | struct pt_regs *regs = task_pt_regs(tsk); |
227 | *regs = newregs; | 210 | *regs = newregs; |
228 | ret = 0; | 211 | ret = 0; |
229 | } | 212 | } |
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c index b90c54169fa5..d7ec16e7fb25 100644 --- a/arch/m32r/kernel/smpboot.c +++ b/arch/m32r/kernel/smpboot.c | |||
@@ -286,7 +286,7 @@ static void __init do_boot_cpu(int phys_id) | |||
286 | /* So we see what's up */ | 286 | /* So we see what's up */ |
287 | printk("Booting processor %d/%d\n", phys_id, cpu_id); | 287 | printk("Booting processor %d/%d\n", phys_id, cpu_id); |
288 | stack_start.spi = (void *)idle->thread.sp; | 288 | stack_start.spi = (void *)idle->thread.sp; |
289 | idle->thread_info->cpu = cpu_id; | 289 | task_thread_info(idle)->cpu = cpu_id; |
290 | 290 | ||
291 | /* | 291 | /* |
292 | * Send Startup IPI | 292 | * Send Startup IPI |