#include "arch/kernel/cpu/idtr.hpp" #include "arch/context_switching/descriptor_table/interrupt_descriptor_table_pointer.hpp" namespace teachos::arch::kernel::cpu { auto store_global_descriptor_table() -> context_switching::descriptor_table::global_descriptor_table_pointer { context_switching::descriptor_table::interrupt_descriptor_table_pointer current_value{}; asm("sidt %[output]" : [output] "=m"(current_value)); return current_value; } auto load_interrupt_descriptor_table( context_switching::descriptor_table::interrupt_descriptor_table_pointer const & idt_pointer) -> void { asm volatile("lidt %[input]" : /* no output from call */ : [input] "m"(idt_pointer)); } } // namespace teachos::arch::kernel::cpu