pub fn enable_fast_syscalls() {
    let cs_selector = GdtTable::kernel_cs_selector();
    let ss_selector = GdtTable::kernel_ss_selector();

    unsafe {
        let mut star = rdmsr(IA32_STAR);
        star |= (cs_selector.bits() as u64) << 32;
        star |= (ss_selector.bits() as u64) << 48;
        wrmsr(IA32_STAR, star);

        // System call RIP
        let rip = syscall_enter as u64;
        wrmsr(IA32_LSTAR, rip);
        debug!("Set up fast syscalls. `sysenter` will jump to {:#x}.", rip);

        wrmsr(
            IA32_FMASK,
            !(rflags::RFlags::FLAGS_IOPL3 | rflags::RFlags::FLAGS_A1).bits(),
        );

        // Enable fast syscalls
        let efer = rdmsr(IA32_EFER) | 0b1;
        wrmsr(IA32_EFER, efer);
    }
}
/// Enables syscall/sysret functionality.
Enables syscall/sysret functionality.
Enables syscall / sysret functionality .
pub fn enable_fast_syscalls() {
    let cs_selector = GdtTable::kernel_cs_selector();
    let ss_selector = GdtTable::kernel_ss_selector();
    unsafe {
        let mut star = rdmsr(IA32_STAR);
        star |= (cs_selector.bits() as u64) << 32;
        star |= (ss_selector.bits() as u64) << 48;
        wrmsr(IA32_STAR, star);
        // System call RIP
        let rip = syscall_enter as u64;
        wrmsr(IA32_LSTAR, rip);
        debug!("Set up fast syscalls. `sysenter` will jump to {:#x}.", rip);
        wrmsr(
            IA32_FMASK,
            !(rflags::RFlags::FLAGS_IOPL3 | rflags::RFlags::FLAGS_A1).bits(),
        );
        // Enable fast syscalls
        let efer = rdmsr(IA32_EFER) | 0b1;
        wrmsr(IA32_EFER, efer);
    }
}
pub fn enable_fast_syscalls ( ) { let cs_selector = GdtTable :: kernel_cs_selector ( ) ; let ss_selector = GdtTable :: kernel_ss_selector ( ) ; unsafe { let mut star = rdmsr ( IA32_STAR ) ; star |= ( cs_selector . bits ( ) as u64 ) << 32 ; star |= ( ss_selector . bits ( ) as u64 ) << 48 ; wrmsr ( IA32_STAR , star ) ; // System call RIP let rip = syscall_enter as u64 ; wrmsr ( IA32_LSTAR , rip ) ; debug ! ( " " rip ) ; wrmsr ( IA32_FMASK , ! ( rflags :: RFlags :: FLAGS_IOPL3 | rflags :: RFlags :: FLAGS_A1 ) . bits ( ) , ) ; // Enable fast syscalls let efer = rdmsr ( IA32_EFER ) | 0b1 ; wrmsr ( IA32_EFER , efer ) ; } }
Enables syscall/sysret functionality.
Enables syscall / sysret functionality .