diff --git a/include/asm.h b/include/asm.h index 4694222..15f8bc5 100644 --- a/include/asm.h +++ b/include/asm.h @@ -136,6 +136,11 @@ static inline ulong KeReadStsc(void) { return ((ulong)edx << 32) + eax; } +static inline void KeFlushTlbSingle(unsigned long addr) +{ + asm volatile("invlpg (%0)" ::"r" (addr) : "memory"); +} + //------------------------------------------// // Misc. I/O // //------------------------------------------// diff --git a/include/mm/mm.h b/include/mm/mm.h index 283f262..ed0e57a 100644 --- a/include/mm/mm.h +++ b/include/mm/mm.h @@ -41,7 +41,7 @@ #define BADRAM_ZONE 5 // Invalid zone because material problem... #define MAX_ENTRIES 2048 // Max number of memory map entries #define KPAGESIZE (4 * KB) -#define UPAGESIZE (2 * MB) +#define UPAGESIZE (4 * KB) //----------------------------------------------------------------------------// diff --git a/kaleid/kernel/ke/isr.asm b/kaleid/kernel/ke/isr.asm index 43b5374..7c07e6f 100644 --- a/kaleid/kernel/ke/isr.asm +++ b/kaleid/kernel/ke/isr.asm @@ -58,10 +58,11 @@ isrPreHandler: push rax ; Check if we are switching from user mode to supervisor mode - ;mov rax, [rsp + 152] - ;and rax, 0x3000 - ;jz .SEnter - ;swapgs ; XXX need TSS + mov rax, [rsp + 152] + and rax, 0x3000 + jz .SEnter + + swapgs ; XXX need TSS .SEnter: ; Increment mask count as we configure all interrupts to mask IF