Compare commits

...

2 Commits

Author SHA1 Message Date
c8a9fcf0d5 idt: add INT_KERNEL_SWINT 2023-11-28 10:30:16 -05:00
dc231741b7 cpu: add swint() 2023-11-28 10:30:03 -05:00
2 changed files with 7 additions and 0 deletions

View File

@ -284,3 +284,9 @@ void cpuid1(uint * ebx, uint * ecx, uint * edx)
{
__asm("cpuid", "=*{ebx},=*{ecx},=*{edx},{eax}", ebx, ecx, edx, 1u);
}
void swint(int swint_id)()
{
static assert((0 <= swint_id) && (swint_id <= 255));
mixin(`__asm("int $$`, swint_id, `", "");`);
}

View File

@ -74,6 +74,7 @@ struct Idt
public static enum ulong INT_APIC_TIMER = 0x70u;
public static enum ulong INT_APIC_LINT0 = 0x71u;
public static enum ulong INT_APIC_LINT1 = 0x72u;
public static enum ulong INT_KERNEL_SWINT = 0x80u;
public static enum ulong INT_APIC_SPURIOUS = 0xFFu;
struct idtr_t