修复栈泄露的bug
This commit is contained in:
@@ -27,14 +27,14 @@ void thread_exit(void)
|
||||
|
||||
void thread_user_pf_set(thread_t *cur_th, void *pc, void *user_sp, void *ram)
|
||||
{
|
||||
pf_t *cur_pf = (pf_t *)user_sp - 1; // thread_get_pf(cur_th);
|
||||
pf_t *cur_pf = (pf_t *)((addr_t)(user_sp - 8) & ~0x7UL) - 1; // thread_get_pf(cur_th);
|
||||
|
||||
cur_pf->pf_s.xpsr = 0x01000000L;
|
||||
cur_pf->pf_s.lr = (umword_t)thread_exit; //!< 线程退出时调用的函数
|
||||
cur_pf->pf_s.pc = (umword_t)pc | 0x1;
|
||||
cur_pf->rg1[5] = (umword_t)ram;
|
||||
|
||||
cur_th->sp.knl_sp = (char *)cur_th + THREAD_BLOCK_SIZE;
|
||||
cur_th->sp.knl_sp = ((char *)cur_th + THREAD_BLOCK_SIZE - 8);
|
||||
cur_th->sp.user_sp = cur_pf;
|
||||
cur_th->sp.sp_type = 1;
|
||||
// arch_set_user_sp((umword_t)cur_pf);
|
||||
|
||||
Reference in New Issue
Block a user