提交 0c071b12 编写于 作者: H He Sheng 提交者: guzitao

sw64: init sp with kernel stack top for idle thread

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5PNF1

--------------------------------

For secondary CPU, it has to do ($sp - THREAD_SIZE) to find current
thread_info.
Signed-off-by: NHe Sheng <hesheng@wxiat.com>
Signed-off-by: NGu Zitao <guzitao@wxiat.com>
上级 7e660d1e
......@@ -218,4 +218,5 @@ void foo(void)
OFFSET(TASK_THREAD_S5, task_struct, thread.s[5]);
OFFSET(TASK_THREAD_S6, task_struct, thread.s[6]);
BLANK();
DEFINE(ASM_THREAD_SIZE, THREAD_SIZE);
}
......@@ -24,7 +24,7 @@ __start:
/* We need to get current_task_info loaded up... */
ldi $8, init_thread_union
/* ... and find our stack ... */
ldi $30, 0x4000 - PT_REGS_SIZE($8)
ldi $30, ASM_THREAD_SIZE($8)
/* ... and then we can clear bss data. */
ldi $2, __bss_start
ldi $3, __bss_stop
......@@ -51,7 +51,7 @@ __start:
ldl $29, 0($30)
addl $29, $0, $29
/* Repoint the sp into the new kernel image */
ldi $30, 0x4000 - PT_REGS_SIZE($8)
ldi $30, ASM_THREAD_SIZE($8)
#endif
/* ... and then we can start the kernel. */
call $26, sw64_start_kernel
......@@ -84,8 +84,7 @@ __smp_callin:
s8addl $0, $2, $2
ldl $30, 0($2) # Get ksp of idle thread
ldi $8, 0x3fff # Find "current".
bic $30, $8, $8
ldi $8, -ASM_THREAD_SIZE($30) # Find "current"
call $26, smp_callin
sys_call HMC_halt
......
......@@ -159,7 +159,7 @@ static int secondary_cpu_start(int cpuid, struct task_struct *idle)
/*
* Precalculate the target ksp.
*/
tidle_ksp[cpuid] = idle->stack + sizeof(union thread_union) - 16;
tidle_ksp[cpuid] = idle->stack + THREAD_SIZE;
DBGS("Starting secondary cpu %d: state 0x%lx\n", cpuid, idle->state);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册