From 5a4038a196887994a09968dc08bee4b11e30c411 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Mon, 30 Jul 2018 04:46:10 +1000 Subject: Added a new subroutine invlpg() to asm.s which simply checks the current CPU is not an i386 before executing the invlpg instruction with the provided address. This will once again make the kernel compatible with the i386 processor as executing the invlpg instruction without these checks would have resulted in an invalid opcode exception. --- kernel/memory.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'kernel/memory.c') diff --git a/kernel/memory.c b/kernel/memory.c index 0c73970..67ad69c 100644 --- a/kernel/memory.c +++ b/kernel/memory.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -82,12 +83,8 @@ void *map_page(void *page) { page = (void*) ((uint32_t) page & ~0xFFF); ktab[(p >> 12) & 0x3FF] = (uint32_t) page | 0x003; - /* - * invalidate any cached entries for - * the mapped page window. - * TODO: skip this on i386 - */ - __asm__ ("invlpg %0" :: "m" (mapped_page)); + + invlpg(mapped_page); return mapped_page; } -- cgit v1.3