完善execve,使其能加载用户程序文件

This commit is contained in:
fslongjin
2022-05-05 14:14:34 +08:00
parent 1801ddffbd
commit 099b24539a
6 changed files with 161 additions and 42 deletions

View File

@ -279,11 +279,12 @@ struct process_control_block *process_get_pcb(long pid);
* @param next 下一个进程的pcb
*
*/
#define process_switch_mm(prev, next) \
do \
{ \
asm volatile("movq %0, %%cr3 \n\t" ::"r"(next->mm->pgd) \
: "memory"); \
#define process_switch_mm(next_pcb) \
do \
{ \
asm volatile("movq %0, %%cr3 \n\t" ::"r"(next_pcb->mm->pgd) \
: "memory"); \
flush_tlb(); \
} while (0)
// 获取当前cpu id