Interrupts Tutorial: Difference between revisions

m
Made the 64-bit IDT helper function consistent with the 64-bit IDT entry type
[unchecked revision][unchecked revision]
(idt_set_descriptor() only takes 3 args, but we give 4, the last is the ist, but in idt_set_descriptor() the ist is set to 0 by default so we don't need that fourth argument. I changed it to only give the three arguments needed.)
m (Made the 64-bit IDT helper function consistent with the 64-bit IDT entry type)
Line 159:
void idt_set_descriptor(uint8_t vector, void* isr, uint8_t flags);
void idt_set_descriptor(uint8_t vector, void* isr, uint8_t flags) {
idt_desc_tidt_entry_t* descriptor = &idt[vector];
 
descriptor->base_lowisr_low = (uint64_t)isr & 0xFFFF;
descriptor->cs kernel_cs = GDT_OFFSET_KERNEL_CODE;
descriptor->ist = 0;
descriptor->attributes = flags;
descriptor->base_midisr_mid = ((uint64_t)isr >> 16) & 0xFFFF;
descriptor->base_highisr_high = ((uint64_t)isr >> 32) & 0xFFFFFFFF;
descriptor->rsv0 reserved = 0;
}
</source>
Anonymous user