Skip to main content

initial_userspace_jump

Function initial_userspace_jump 

Source
pub unsafe fn initial_userspace_jump(
    root_page_phys: u64,
    entry: u64,
    stack_top: VirtAddr,
) -> !
Expand description

First transition into userspace; uses a fake stack frame and iretq to jump to userspace for the first time

§Safety

The caller must guarantee the following:

  • The process’s address space is fully and correctly mapped
  • entry needs to point to valid executable code in that address space
  • stack_top needs to be valid, mapped and user-accessible
  • The kernel higher half needs to be mapped in the address space