Skip to content

Commit 0f231dc

Browse files
committed
csky: coding convention: Use task_stack_page
Use task_stack_page instead of p->stack to get stack. Follow the coding convention style. Also for init_stack, the same with other archs. Signed-off-by: Guo Ren <ren_guo@c-sky.com>
1 parent 9216cd7 commit 0f231dc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

arch/csky/include/asm/processor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct thread_struct {
4949
};
5050

5151
#define INIT_THREAD { \
52-
.ksp = (unsigned long) init_thread_union.stack + THREAD_SIZE, \
52+
.ksp = sizeof(init_stack) + (unsigned long) &init_stack, \
5353
.sr = DEFAULT_PSR_VALUE, \
5454
}
5555

@@ -95,7 +95,7 @@ unsigned long get_wchan(struct task_struct *p);
9595
#define KSTK_ESP(tsk) (task_pt_regs(tsk)->usp)
9696

9797
#define task_pt_regs(p) \
98-
((struct pt_regs *)(THREAD_SIZE + p->stack) - 1)
98+
((struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1)
9999

100100
#define cpu_relax() barrier()
101101

arch/csky/kernel/smp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
160160
{
161161
unsigned long mask = 1 << cpu;
162162

163-
secondary_stack = (unsigned int)tidle->stack + THREAD_SIZE - 8;
163+
secondary_stack =
164+
(unsigned int) task_stack_page(tidle) + THREAD_SIZE - 8;
164165
secondary_hint = mfcr("cr31");
165166
secondary_ccr = mfcr("cr18");
166167

0 commit comments

Comments
 (0)