Skip to content

Commit 27f4513

Browse files
Al ViroLinus Torvalds
authored andcommitted
[PATCH] alpha: task_stack_page()
use task_stack_page() for accesses to stack page of task in alpha-specific parts of tree 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>
1 parent 37bfbaf commit 27f4513

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎arch/alpha/kernel/process.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
276276
{
277277
extern void ret_from_fork(void);
278278

279-
struct thread_info *childti = p->thread_info;
279+
struct thread_info *childti = task_thread_info(p);
280280
struct pt_regs * childregs;
281281
struct switch_stack * childstack, *stack;
282282
unsigned long stack_offset, settls;
@@ -285,7 +285,7 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
285285
if (!(regs->ps & 8))
286286
stack_offset = (PAGE_SIZE-1) & (unsigned long) regs;
287287
childregs = (struct pt_regs *)
288-
(stack_offset + PAGE_SIZE + (long) childti);
288+
(stack_offset + PAGE_SIZE + task_stack_page(p));
289289

290290
*childregs = *regs;
291291
settls = regs->r20;
@@ -492,7 +492,7 @@ do_sys_execve(char __user *ufilename, char __user * __user *argv,
492492
unsigned long
493493
thread_saved_pc(task_t *t)
494494
{
495-
unsigned long base = (unsigned long)t->thread_info;
495+
unsigned long base = (unsigned long)task_stack_page(t);
496496
unsigned long fp, sp = task_thread_info(t)->pcb.ksp;
497497

498498
if (sp > base && sp+6*8 < base + 16*1024) {

‎arch/alpha/kernel/ptrace.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno)
110110
zero = 0;
111111
addr = &zero;
112112
} else {
113-
addr = (void *)task->thread_info + regoff[regno];
113+
addr = task_stack_page(task) + regoff[regno];
114114
}
115115
return addr;
116116
}

‎include/asm-alpha/ptrace.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct switch_stack {
7676
extern void show_regs(struct pt_regs *);
7777

7878
#define alpha_task_regs(task) \
79-
((struct pt_regs *) ((long) (task)->thread_info + 2*PAGE_SIZE) - 1)
79+
((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1)
8080

8181
#define force_successful_syscall_return() (alpha_task_regs(current)->r0 = 0)
8282

0 commit comments

Comments
 (0)