interrupt: load GDT/IDT on the stack

We have to use a separate Assembly function to do that, but maybe with some effort we can make that inline too
This commit is contained in:
2021-10-14 15:51:50 +08:00
parent ebdc816d82
commit aa11d25fa8
4 changed files with 36 additions and 31 deletions

@ -21,12 +21,9 @@ extern "C" {
#define KERNEL_GDT_MAPPING (KERNEL_MISC_MAPPING + KERNEL_IDT_SIZE)
#define KERNEL_GDT_SIZE (16ull * 8)
#define KERNEL_IDTR_MAPPING (KERNEL_MISC_MAPPING + KERNEL_IDT_SIZE + KERNEL_GDT_SIZE)
#define KERNEL_GDTR_MAPPING (KERNEL_MISC_MAPPING + KERNEL_IDT_SIZE + KERNEL_GDT_SIZE + 12)
#define KERNEL_MISC_NEXT (KERNEL_MISC_MAPPING + KERNEL_IDT_SIZE + KERNEL_GDT_SIZE)
#define KERNEL_MISC_NEXT (KERNEL_MISC_MAPPING + KERNEL_IDT_SIZE + KERNEL_GDT_SIZE + 24)
#define KERNEL_MISC_SIZE (KERNEL_IDT_SIZE + KERNEL_GDT_SIZE + 24) // add all the misc sizes
#define KERNEL_MISC_SIZE (KERNEL_IDT_SIZE + KERNEL_GDT_SIZE) // add all the misc sizes
extern uint64_t paging_LoaderCodeAddress, paging_LoaderCodeSize; // physical address for loader code section