Commit 95ca0dc603ab58f3e4c5a1c23f675bd1f5b5fef3

Authored by Al Viro
Committed by Linus Torvalds
1 parent 0cec6fd137

[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>

Showing 5 changed files with 11 additions and 10 deletions Side-by-side Diff

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