Commit 7fdf0d7a2012e560fee738bfd7f2af26faeb3a39
Committed by
Linus Torvalds
1 parent
02ef691f6c
Exists in
master
and in
7 other branches
[PATCH] arm26: task_stack_page()
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 2 changed files with 5 additions and 5 deletions Side-by-side Diff
arch/arm26/kernel/traps.c
... | ... | @@ -132,7 +132,7 @@ |
132 | 132 | |
133 | 133 | /*static*/ void __dump_stack(struct task_struct *tsk, unsigned long sp) |
134 | 134 | { |
135 | - dump_mem("Stack: ", sp, 8192+(unsigned long)tsk->thread_info); | |
135 | + dump_mem("Stack: ", sp, 8192+(unsigned long)task_stack_page(tsk)); | |
136 | 136 | } |
137 | 137 | |
138 | 138 | void dump_stack(void) |
... | ... | @@ -158,7 +158,7 @@ |
158 | 158 | } else if (verify_stack(fp)) { |
159 | 159 | printk("invalid frame pointer 0x%08x", fp); |
160 | 160 | ok = 0; |
161 | - } else if (fp < (unsigned long)(tsk->thread_info + 1)) | |
161 | + } else if (fp < (unsigned long)end_of_stack(tsk)) | |
162 | 162 | printk("frame pointer underflow"); |
163 | 163 | printk("\n"); |
164 | 164 | |
... | ... | @@ -168,7 +168,7 @@ |
168 | 168 | |
169 | 169 | /* FIXME - this is probably wrong.. */ |
170 | 170 | void show_stack(struct task_struct *task, unsigned long *sp) { |
171 | - dump_mem("Stack: ", (unsigned long)sp, 8192+(unsigned long)task->thread_info); | |
171 | + dump_mem("Stack: ", (unsigned long)sp, 8192+(unsigned long)task_stack_page(task)); | |
172 | 172 | } |
173 | 173 | |
174 | 174 | DEFINE_SPINLOCK(die_lock); |
... | ... | @@ -187,7 +187,7 @@ |
187 | 187 | printk("CPU: %d\n", smp_processor_id()); |
188 | 188 | show_regs(regs); |
189 | 189 | printk("Process %s (pid: %d, stack limit = 0x%p)\n", |
190 | - current->comm, current->pid, tsk->thread_info + 1); | |
190 | + current->comm, current->pid, end_of_stack(tsk)); | |
191 | 191 | |
192 | 192 | if (!user_mode(regs) || in_interrupt()) { |
193 | 193 | __dump_stack(tsk, (unsigned long)(regs + 1)); |
include/asm-arm26/thread_info.h
... | ... | @@ -82,7 +82,7 @@ |
82 | 82 | |
83 | 83 | /* FIXME - PAGE_SIZE < 32K */ |
84 | 84 | #define THREAD_SIZE (8*32768) // FIXME - this needs attention (see kernel/fork.c which gets a nice div by zero if this is lower than 8*32768 |
85 | -#define task_pt_regs(task) ((struct pt_regs *)((unsigned long)(task)->thread_info + THREAD_SIZE - 8) - 1) | |
85 | +#define task_pt_regs(task) ((struct pt_regs *)(task_stack_page(task) + THREAD_SIZE - 8) - 1) | |
86 | 86 | |
87 | 87 | extern struct thread_info *alloc_thread_info(struct task_struct *task); |
88 | 88 | extern void free_thread_info(struct thread_info *); |