diff options
| author | Jake Mannens <jake72360@gmail.com> | 2018-07-30 04:46:10 +1000 |
|---|---|---|
| committer | Jake Mannens <jake72360@gmail.com> | 2018-07-30 04:46:10 +1000 |
| commit | 5a4038a196887994a09968dc08bee4b11e30c411 (patch) | |
| tree | b157ce10ea6893bf2327327a84eeb01fda3bdd5e /kernel/memory.c | |
| parent | 902abebefe10e5e8bc9d80b73e46bcb1635f0be8 (diff) | |
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.
Diffstat (limited to 'kernel/memory.c')
| -rw-r--r-- | kernel/memory.c | 9 |
1 files changed, 3 insertions, 6 deletions
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 <asm/system.h> #include <kernel/memory.h> #include <stdint.h> #include <sys/types.h> @@ -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; } |
