use crate::structures::gdt::SegmentSelector;
pub use crate::structures::DescriptorTablePointer;
#[inline]
pub unsafe fn lgdt(gdt: &DescriptorTablePointer) {
#[cfg(feature = "inline_asm")]
asm!("lgdt [{}]", in(reg) gdt, options(nostack));
#[cfg(not(feature = "inline_asm"))]
crate::asm::x86_64_asm_lgdt(gdt as *const _);
}
#[inline]
pub unsafe fn lidt(idt: &DescriptorTablePointer) {
#[cfg(feature = "inline_asm")]
asm!("lidt [{}]", in(reg) idt, options(nostack));
#[cfg(not(feature = "inline_asm"))]
crate::asm::x86_64_asm_lidt(idt as *const _);
}
#[inline]
pub unsafe fn load_tss(sel: SegmentSelector) {
#[cfg(feature = "inline_asm")]
asm!("ltr {0:x}", in(reg) sel.0, options(nostack, nomem));
#[cfg(not(feature = "inline_asm"))]
crate::asm::x86_64_asm_ltr(sel.0)
}