thread_enter_user_mode()- Disable all interrupts.
- Call
xstatus_for_xret()to getxstatuswithxstatus.PIEset to1,xstatus.PPset toU-mode. - The returned
xstatuswill be saved along with$a0,$a1,$a2,$a3,user_sp,entry_func, and$xieto current thread’s reg context (struct thread_ctx_regs). - Call
__thread_enter_user_mode()to switch to U-mode.entry_funcis set tothread_ctx_regs.raand then set to$xepcso that whenxretis called to return to U-mode,entry_funcwill be executed. - Re-enable original interrupts.
thread_enter_user_mode()c
Loading...