驱动内存映射修改为缺页模拟方式

This commit is contained in:
zhangzheng
2025-01-26 15:48:13 +08:00
parent 501482c512
commit 7303d5071a
17 changed files with 112 additions and 35 deletions

View File

@@ -214,7 +214,8 @@ static inline pf_t *thread_get_pf(thread_t *th)
static inline thread_t *thread_get_current(void)
{
umword_t sp = arch_get_sp();
thread_t *th = (thread_t *)(ALIGN_DOWN(sp, CONFIG_THREAD_BLOCK_SIZE));
// thread_t *th = (thread_t *)(ALIGN_DOWN(sp, CONFIG_THREAD_BLOCK_SIZE));
thread_t *th = (thread_t *)((sp / CONFIG_THREAD_BLOCK_SIZE) * CONFIG_THREAD_BLOCK_SIZE);
return th;
}