[PATCH] cris: task_pt_regs()
authorAl Viro <viro@ftp.linux.org.uk>
Thu, 12 Jan 2006 09:06:03 +0000 (01:06 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 12 Jan 2006 17:08:58 +0000 (09:08 -0800)
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>
arch/cris/arch-v10/kernel/process.c
arch/cris/arch-v10/kernel/ptrace.c
arch/cris/arch-v32/kernel/process.c
arch/cris/arch-v32/kernel/ptrace.c
include/asm-cris/processor.h

index 69e28b4057e8bc00f7ea93f4b756a589f20fbd32..0a675ce9e0992895f809b3898084efbd8b973ea6 100644 (file)
@@ -79,7 +79,7 @@ void hard_reset_now (void)
  */
 unsigned long thread_saved_pc(struct task_struct *t)
 {
-       return (unsigned long)user_regs(t->thread_info)->irp;
+       return task_pt_regs(t)->irp;
 }
 
 static void kernel_thread_helper(void* dummy, int (*fn)(void *), void * arg)
@@ -128,7 +128,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
         * remember that the task_struct doubles as the kernel stack for the task
         */
 
-       childregs = user_regs(p->thread_info);        
+       childregs = task_pt_regs(p);
         
        *childregs = *regs;  /* struct copy of pt_regs */
         
index 6cbd34a27b906cdce1805b710eedca1cd6cfa566..f214f74f264e43a65415d490a640ae31364a94de 100644 (file)
@@ -37,7 +37,7 @@ inline long get_reg(struct task_struct *task, unsigned int regno)
        if (regno == PT_USP)
                return task->thread.usp;
        else if (regno < PT_MAX)
-               return ((unsigned long *)user_regs(task->thread_info))[regno];
+               return ((unsigned long *)task_pt_regs(task))[regno];
        else
                return 0;
 }
@@ -51,7 +51,7 @@ inline int put_reg(struct task_struct *task, unsigned int regno,
        if (regno == PT_USP)
                task->thread.usp = data;
        else if (regno < PT_MAX)
-               ((unsigned long *)user_regs(task->thread_info))[regno] = data;
+               ((unsigned long *)task_pt_regs(task))[regno] = data;
        else
                return -1;
        return 0;
index 882be42114f749a625f9a48c9ede2c70009b6f05..e88b13b139d569954f07938c6e1522b4bce5170e 100644 (file)
@@ -96,7 +96,7 @@ hard_reset_now(void)
  */
 unsigned long thread_saved_pc(struct task_struct *t)
 {
-       return (unsigned long)user_regs(t->thread_info)->erp;
+       return task_pt_regs(t)->erp;
 }
 
 static void
@@ -148,7 +148,7 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
         * fix it up. Note: the task_struct doubles as the kernel stack for the
         * task.
         */
-       childregs = user_regs(p->thread_info);
+       childregs = task_pt_regs(p);
        *childregs = *regs;     /* Struct copy of pt_regs. */
         p->set_child_tid = p->clear_child_tid = NULL;
         childregs->r10 = 0;    /* Child returns 0 after a fork/clone. */
index 5528b83a622b62e666f2e4241967353724f47f7e..82cf2e3624a41e93a1b748c671406f62043876bc 100644 (file)
@@ -46,7 +46,7 @@ long get_reg(struct task_struct *task, unsigned int regno)
        unsigned long ret;
 
        if (regno <= PT_EDA)
-               ret = ((unsigned long *)user_regs(task->thread_info))[regno];
+               ret = ((unsigned long *)task_pt_regs(task))[regno];
        else if (regno == PT_USP)
                ret = task->thread.usp;
        else if (regno == PT_PPC)
@@ -65,13 +65,13 @@ long get_reg(struct task_struct *task, unsigned int regno)
 int put_reg(struct task_struct *task, unsigned int regno, unsigned long data)
 {
        if (regno <= PT_EDA)
-               ((unsigned long *)user_regs(task->thread_info))[regno] = data;
+               ((unsigned long *)task_pt_regs(task))[regno] = data;
        else if (regno == PT_USP)
                task->thread.usp = data;
        else if (regno == PT_PPC) {
                /* Write pseudo-PC to ERP only if changed. */
                if (data != get_pseudo_pc(task))
-                       ((unsigned long *)user_regs(task->thread_info))[PT_ERP] = data;
+                       task_pt_regs(task)->erp = data;
        } else if (regno <= PT_MAX)
                return put_debugreg(task->pid, regno, data);
        else
index dce41009eeb086a17811c7e1095709672ddedac4..961e2bceadbc645915fd1379ed939cf008db19ff 100644 (file)
@@ -45,7 +45,8 @@ struct task_struct;
  * Dito but for the currently running task
  */
 
-#define current_regs() user_regs(current->thread_info)
+#define task_pt_regs(task) user_regs(task_thread_info(task))
+#define current_regs() task_pt_regs(current)
 
 static inline void prepare_to_copy(struct task_struct *tsk)
 {