You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
492 B

#include "idt.hpp"
namespace idt
{
auto create_entry(void* address) -> hv::idt_entry_t
{
hv::idt_addr_t idt_addr{ (u64) address };
hv::idt_entry_t result{};
result.dpl = 0;
result.storage_segment = 0;
result.segment_selector = readcs();
result.gate_type = SEGMENT_DESCRIPTOR_TYPE_INTERRUPT_GATE;
result.present = 1;
result.offset_high = idt_addr.offset_high;
result.offset_middle = idt_addr.offset_middle;
result.offset_low = idt_addr.offset_low;
return result;
}
}