summaryrefslogtreecommitdiff
path: root/arch/m32r/kernel/ptrace.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2006-01-12 01:05:52 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-12 09:08:54 -0800
commit6c3559fc458e3ed171d7a8bf6a6d7eaea1e7b2e5 (patch)
treee6c68721887f4f6fbc5aa0c2e6629f30f73f74b2 /arch/m32r/kernel/ptrace.c
parentb7f6961d83d480c8636543d1d0dbb9584b878a68 (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/m32r/kernel/ptrace.c')
-rw-r--r--arch/m32r/kernel/ptrace.c25
1 files changed, 4 insertions, 21 deletions
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 @@
#include <asm/mmu_context.h>
/*
- * Get the address of the live pt_regs for the specified task.
- * These are saved onto the top kernel stack when the process
- * is not running.
- *
- * Note: if a user thread is execve'd from kernel space, the
- * kernel stack will not be empty on entry to the kernel, so
- * ptracing these tasks will fail.
- */
-static inline struct pt_regs *
-get_user_regs(struct task_struct *task)
-{
- return (struct pt_regs *)
- ((unsigned long)task->thread_info + THREAD_SIZE
- - sizeof(struct pt_regs));
-}
-
-/*
* This routine will get a word off of the process kernel stack.
*/
static inline unsigned long int
@@ -59,7 +42,7 @@ get_stack_long(struct task_struct *task, int offset)
{
unsigned long *stack;
- stack = (unsigned long *)get_user_regs(task);
+ stack = (unsigned long *)task_pt_regs(task);
return stack[offset];
}
@@ -72,7 +55,7 @@ put_stack_long(struct task_struct *task, int offset, unsigned long data)
{
unsigned long *stack;
- stack = (unsigned long *)get_user_regs(task);
+ stack = (unsigned long *)task_pt_regs(task);
stack[offset] = data;
return 0;
@@ -208,7 +191,7 @@ static int ptrace_write_user(struct task_struct *tsk, unsigned long off,
*/
static int ptrace_getregs(struct task_struct *tsk, void __user *uregs)
{
- struct pt_regs *regs = get_user_regs(tsk);
+ struct pt_regs *regs = task_pt_regs(tsk);
return copy_to_user(uregs, regs, sizeof(struct pt_regs)) ? -EFAULT : 0;
}
@@ -223,7 +206,7 @@ static int ptrace_setregs(struct task_struct *tsk, void __user *uregs)
ret = -EFAULT;
if (copy_from_user(&newregs, uregs, sizeof(struct pt_regs)) == 0) {
- struct pt_regs *regs = get_user_regs(tsk);
+ struct pt_regs *regs = task_pt_regs(tsk);
*regs = newregs;
ret = 0;
}