From 737bea025fa4a99fb2394843363bef9204cea15b Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Wed, 8 Jan 2020 00:28:10 +0100 Subject: [PATCH] Minor corrections --- include/asm.h | 5 +++++ include/mm/mm.h | 2 +- kaleid/kernel/ke/isr.asm | 9 +++++---- 3 files changed, 11 insertions(+), 5 deletions(-) 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