diff options
-rw-r--r-- | arch/xtensa/kernel/process.c | 4 | ||||
-rw-r--r-- | arch/xtensa/kernel/ptrace.c | 12 | ||||
-rw-r--r-- | include/asm-xtensa/processor.h | 6 | ||||
-rw-r--r-- | include/asm-xtensa/ptrace.h | 4 |
4 files changed, 13 insertions, 13 deletions
diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c index 6a44b54ae817..f1f596644bfc 100644 --- a/arch/xtensa/kernel/process.c +++ b/arch/xtensa/kernel/process.c | |||
@@ -145,7 +145,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | |||
145 | int user_mode = user_mode(regs); | 145 | int user_mode = user_mode(regs); |
146 | 146 | ||
147 | /* Set up new TSS. */ | 147 | /* Set up new TSS. */ |
148 | tos = (unsigned long)p->thread_info + THREAD_SIZE; | 148 | tos = (unsigned long)task_stack_page(p) + THREAD_SIZE; |
149 | if (user_mode) | 149 | if (user_mode) |
150 | childregs = (struct pt_regs*)(tos - PT_USER_SIZE); | 150 | childregs = (struct pt_regs*)(tos - PT_USER_SIZE); |
151 | else | 151 | else |
@@ -217,7 +217,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | |||
217 | unsigned long get_wchan(struct task_struct *p) | 217 | unsigned long get_wchan(struct task_struct *p) |
218 | { | 218 | { |
219 | unsigned long sp, pc; | 219 | unsigned long sp, pc; |
220 | unsigned long stack_page = (unsigned long) p->thread_info; | 220 | unsigned long stack_page = (unsigned long) task_stack_page(p); |
221 | int count = 0; | 221 | int count = 0; |
222 | 222 | ||
223 | if (!p || p == current || p->state == TASK_RUNNING) | 223 | if (!p || p == current || p->state == TASK_RUNNING) |
diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c index ab5c4c65b5c4..4cc85285a70a 100644 --- a/arch/xtensa/kernel/ptrace.c +++ b/arch/xtensa/kernel/ptrace.c | |||
@@ -72,7 +72,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
72 | struct pt_regs *regs; | 72 | struct pt_regs *regs; |
73 | unsigned long tmp; | 73 | unsigned long tmp; |
74 | 74 | ||
75 | regs = xtensa_pt_regs(child); | 75 | regs = task_pt_regs(child); |
76 | tmp = 0; /* Default return value. */ | 76 | tmp = 0; /* Default return value. */ |
77 | 77 | ||
78 | switch(addr) { | 78 | switch(addr) { |
@@ -149,7 +149,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
149 | case PTRACE_POKEUSR: | 149 | case PTRACE_POKEUSR: |
150 | { | 150 | { |
151 | struct pt_regs *regs; | 151 | struct pt_regs *regs; |
152 | regs = xtensa_pt_regs(child); | 152 | regs = task_pt_regs(child); |
153 | 153 | ||
154 | switch (addr) { | 154 | switch (addr) { |
155 | case REG_AR_BASE ... REG_AR_BASE + XCHAL_NUM_AREGS - 1: | 155 | case REG_AR_BASE ... REG_AR_BASE + XCHAL_NUM_AREGS - 1: |
@@ -240,7 +240,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
240 | * elf_gregset_t format. */ | 240 | * elf_gregset_t format. */ |
241 | 241 | ||
242 | xtensa_gregset_t format; | 242 | xtensa_gregset_t format; |
243 | struct pt_regs *regs = xtensa_pt_regs(child); | 243 | struct pt_regs *regs = task_pt_regs(child); |
244 | 244 | ||
245 | do_copy_regs (&format, regs, child); | 245 | do_copy_regs (&format, regs, child); |
246 | 246 | ||
@@ -257,7 +257,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
257 | * values in the elf_gregset_t format. */ | 257 | * values in the elf_gregset_t format. */ |
258 | 258 | ||
259 | xtensa_gregset_t format; | 259 | xtensa_gregset_t format; |
260 | struct pt_regs *regs = xtensa_pt_regs(child); | 260 | struct pt_regs *regs = task_pt_regs(child); |
261 | 261 | ||
262 | if (copy_from_user(&format,(void *)data,sizeof(elf_gregset_t))){ | 262 | if (copy_from_user(&format,(void *)data,sizeof(elf_gregset_t))){ |
263 | ret = -EFAULT; | 263 | ret = -EFAULT; |
@@ -281,7 +281,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
281 | * elf_fpregset_t format. */ | 281 | * elf_fpregset_t format. */ |
282 | 282 | ||
283 | elf_fpregset_t fpregs; | 283 | elf_fpregset_t fpregs; |
284 | struct pt_regs *regs = xtensa_pt_regs(child); | 284 | struct pt_regs *regs = task_pt_regs(child); |
285 | 285 | ||
286 | do_save_fpregs (&fpregs, regs, child); | 286 | do_save_fpregs (&fpregs, regs, child); |
287 | 287 | ||
@@ -299,7 +299,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
299 | * values in the elf_fpregset_t format. | 299 | * values in the elf_fpregset_t format. |
300 | */ | 300 | */ |
301 | elf_fpregset_t fpregs; | 301 | elf_fpregset_t fpregs; |
302 | struct pt_regs *regs = xtensa_pt_regs(child); | 302 | struct pt_regs *regs = task_pt_regs(child); |
303 | 303 | ||
304 | ret = 0; | 304 | ret = 0; |
305 | if (copy_from_user(&fpregs, (void *)data, sizeof(elf_fpregset_t))) { | 305 | if (copy_from_user(&fpregs, (void *)data, sizeof(elf_fpregset_t))) { |
diff --git a/include/asm-xtensa/processor.h b/include/asm-xtensa/processor.h index 9cab5e4298b9..d1d72ad36f08 100644 --- a/include/asm-xtensa/processor.h +++ b/include/asm-xtensa/processor.h | |||
@@ -184,12 +184,12 @@ extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); | |||
184 | #define release_segments(mm) do { } while(0) | 184 | #define release_segments(mm) do { } while(0) |
185 | #define forget_segments() do { } while (0) | 185 | #define forget_segments() do { } while (0) |
186 | 186 | ||
187 | #define thread_saved_pc(tsk) (xtensa_pt_regs(tsk)->pc) | 187 | #define thread_saved_pc(tsk) (task_pt_regs(tsk)->pc) |
188 | 188 | ||
189 | extern unsigned long get_wchan(struct task_struct *p); | 189 | extern unsigned long get_wchan(struct task_struct *p); |
190 | 190 | ||
191 | #define KSTK_EIP(tsk) (xtensa_pt_regs(tsk)->pc) | 191 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) |
192 | #define KSTK_ESP(tsk) (xtensa_pt_regs(tsk)->areg[1]) | 192 | #define KSTK_ESP(tsk) (task_pt_regs(tsk)->areg[1]) |
193 | 193 | ||
194 | #define cpu_relax() do { } while (0) | 194 | #define cpu_relax() do { } while (0) |
195 | 195 | ||
diff --git a/include/asm-xtensa/ptrace.h b/include/asm-xtensa/ptrace.h index aa4fd7fb3ce7..a5ac71a5205c 100644 --- a/include/asm-xtensa/ptrace.h +++ b/include/asm-xtensa/ptrace.h | |||
@@ -113,8 +113,8 @@ struct pt_regs { | |||
113 | }; | 113 | }; |
114 | 114 | ||
115 | #ifdef __KERNEL__ | 115 | #ifdef __KERNEL__ |
116 | # define xtensa_pt_regs(tsk) ((struct pt_regs*) \ | 116 | # define task_pt_regs(tsk) ((struct pt_regs*) \ |
117 | (((long)(tsk)->thread_info + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4)) - 1) | 117 | (task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1) |
118 | # define user_mode(regs) (((regs)->ps & 0x00000020)!=0) | 118 | # define user_mode(regs) (((regs)->ps & 0x00000020)!=0) |
119 | # define instruction_pointer(regs) ((regs)->pc) | 119 | # define instruction_pointer(regs) ((regs)->pc) |
120 | extern void show_regs(struct pt_regs *); | 120 | extern void show_regs(struct pt_regs *); |