feat(idt): add load_idt instructions

This commit is contained in:
aliamelo committed 2021-07-14 21:32:15 +02:00
1 parent 8162cb5011
commit 48cc6590a9
1 file changed
+20
+20
View File
@@ -0,0 +1,20 @@
#include "idt.h"
static struct idt idt = { 0 };
static void load_idt()
{
struct idt_r idtr;
idtr.addr = (uint32_t)&idt;
idtr.limit = IDT_SIZE - 1;
asm volatile("lidt %0\n"
:
: "m" (idtr)
: "memory");
}
void init_idt()
{
load_idt();
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.