[PATCH] cris: task_pt_regs()

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>

authored by Al Viro and committed by Linus Torvalds 95ca0dc6 0cec6fd1

+11 -10
+2 -2
arch/cris/arch-v10/kernel/process.c
··· 79 */ 80 unsigned long thread_saved_pc(struct task_struct *t) 81 { 82 - return (unsigned long)user_regs(t->thread_info)->irp; 83 } 84 85 static void kernel_thread_helper(void* dummy, int (*fn)(void *), void * arg) ··· 128 * remember that the task_struct doubles as the kernel stack for the task 129 */ 130 131 - childregs = user_regs(p->thread_info); 132 133 *childregs = *regs; /* struct copy of pt_regs */ 134
··· 79 */ 80 unsigned long thread_saved_pc(struct task_struct *t) 81 { 82 + return task_pt_regs(t)->irp; 83 } 84 85 static void kernel_thread_helper(void* dummy, int (*fn)(void *), void * arg) ··· 128 * remember that the task_struct doubles as the kernel stack for the task 129 */ 130 131 + childregs = task_pt_regs(p); 132 133 *childregs = *regs; /* struct copy of pt_regs */ 134
+2 -2
arch/cris/arch-v10/kernel/ptrace.c
··· 37 if (regno == PT_USP) 38 return task->thread.usp; 39 else if (regno < PT_MAX) 40 - return ((unsigned long *)user_regs(task->thread_info))[regno]; 41 else 42 return 0; 43 } ··· 51 if (regno == PT_USP) 52 task->thread.usp = data; 53 else if (regno < PT_MAX) 54 - ((unsigned long *)user_regs(task->thread_info))[regno] = data; 55 else 56 return -1; 57 return 0;
··· 37 if (regno == PT_USP) 38 return task->thread.usp; 39 else if (regno < PT_MAX) 40 + return ((unsigned long *)task_pt_regs(task))[regno]; 41 else 42 return 0; 43 } ··· 51 if (regno == PT_USP) 52 task->thread.usp = data; 53 else if (regno < PT_MAX) 54 + ((unsigned long *)task_pt_regs(task))[regno] = data; 55 else 56 return -1; 57 return 0;
+2 -2
arch/cris/arch-v32/kernel/process.c
··· 96 */ 97 unsigned long thread_saved_pc(struct task_struct *t) 98 { 99 - return (unsigned long)user_regs(t->thread_info)->erp; 100 } 101 102 static void ··· 148 * fix it up. Note: the task_struct doubles as the kernel stack for the 149 * task. 150 */ 151 - childregs = user_regs(p->thread_info); 152 *childregs = *regs; /* Struct copy of pt_regs. */ 153 p->set_child_tid = p->clear_child_tid = NULL; 154 childregs->r10 = 0; /* Child returns 0 after a fork/clone. */
··· 96 */ 97 unsigned long thread_saved_pc(struct task_struct *t) 98 { 99 + return task_pt_regs(t)->erp; 100 } 101 102 static void ··· 148 * fix it up. Note: the task_struct doubles as the kernel stack for the 149 * task. 150 */ 151 + childregs = task_pt_regs(p); 152 *childregs = *regs; /* Struct copy of pt_regs. */ 153 p->set_child_tid = p->clear_child_tid = NULL; 154 childregs->r10 = 0; /* Child returns 0 after a fork/clone. */
+3 -3
arch/cris/arch-v32/kernel/ptrace.c
··· 46 unsigned long ret; 47 48 if (regno <= PT_EDA) 49 - ret = ((unsigned long *)user_regs(task->thread_info))[regno]; 50 else if (regno == PT_USP) 51 ret = task->thread.usp; 52 else if (regno == PT_PPC) ··· 65 int put_reg(struct task_struct *task, unsigned int regno, unsigned long data) 66 { 67 if (regno <= PT_EDA) 68 - ((unsigned long *)user_regs(task->thread_info))[regno] = data; 69 else if (regno == PT_USP) 70 task->thread.usp = data; 71 else if (regno == PT_PPC) { 72 /* Write pseudo-PC to ERP only if changed. */ 73 if (data != get_pseudo_pc(task)) 74 - ((unsigned long *)user_regs(task->thread_info))[PT_ERP] = data; 75 } else if (regno <= PT_MAX) 76 return put_debugreg(task->pid, regno, data); 77 else
··· 46 unsigned long ret; 47 48 if (regno <= PT_EDA) 49 + ret = ((unsigned long *)task_pt_regs(task))[regno]; 50 else if (regno == PT_USP) 51 ret = task->thread.usp; 52 else if (regno == PT_PPC) ··· 65 int put_reg(struct task_struct *task, unsigned int regno, unsigned long data) 66 { 67 if (regno <= PT_EDA) 68 + ((unsigned long *)task_pt_regs(task))[regno] = data; 69 else if (regno == PT_USP) 70 task->thread.usp = data; 71 else if (regno == PT_PPC) { 72 /* Write pseudo-PC to ERP only if changed. */ 73 if (data != get_pseudo_pc(task)) 74 + task_pt_regs(task)->erp = data; 75 } else if (regno <= PT_MAX) 76 return put_debugreg(task->pid, regno, data); 77 else
+2 -1
include/asm-cris/processor.h
··· 45 * Dito but for the currently running task 46 */ 47 48 - #define current_regs() user_regs(current->thread_info) 49 50 static inline void prepare_to_copy(struct task_struct *tsk) 51 {
··· 45 * Dito but for the currently running task 46 */ 47 48 + #define task_pt_regs(task) user_regs(task_thread_info(task)) 49 + #define current_regs() task_pt_regs(current) 50 51 static inline void prepare_to_copy(struct task_struct *tsk) 52 {