summaryrefslogtreecommitdiff
path: root/arch/i386/include/kernel
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.org>2024-05-29 00:26:59 -0500
committerDanny Holman <dholman@gymli.org>2024-05-29 00:26:59 -0500
commitffc782f8740027d21793c37c6094ebed06d1dfd2 (patch)
treefadd5544ed493d9935d6c4052a442f70c17030fd /arch/i386/include/kernel
parent5fb0ba537ab15f9c83afd9a939cf57c84d443856 (diff)
arch: i386: fix several bugs in paging subsystem
Fix several triple-faulting bugs in the paging initialization routines. These include causing a page fault during physical memory manager initialization, causing a page fault during paging initialization and other double-faulting and triple-faulting bugs. Signed-off-by: Danny Holman <dholman@gymli.org>
Diffstat (limited to 'arch/i386/include/kernel')
-rw-r--r--arch/i386/include/kernel/paging.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/i386/include/kernel/paging.h b/arch/i386/include/kernel/paging.h
index e949e32..5999986 100644
--- a/arch/i386/include/kernel/paging.h
+++ b/arch/i386/include/kernel/paging.h
@@ -3,7 +3,6 @@
#include <kernel/asm.h>
#include <kernel/multiboot.h>
-#include <kernel/data/list.h>
#include <stdint.h>
#define PD_PRES 0x0001
@@ -26,15 +25,18 @@
#define PGROUNDUP(size) (((size)+PAGE_SIZE-1) & ~(PAGE_SIZE-1))
#define PGROUNDDN(size) (((size)) & ~(PAGE_SIZE-1))
-int init_page_directory(uintptr_t *pd, int user);
-void enable_paging(uintptr_t pd_addr);
+#define GET_PADDR(x) (((uint32_t)(x)) - 0xC0000000)
+#define GET_VADDR(x) (((uint32_t)(x)) + 0xC0000000)
-void paging_init(void);
-void page_fault_handler(struct regs *regs);
+#define GET_PDX(x) (((uintptr_t)(x) >> 22) & 0x3FF)
+#define GET_PTX(x) (((uintptr_t)(x) >> 12) & 0x3FF)
-uint32_t get_vaddr(uintptr_t paddr);
+uintptr_t* init_page_table(void);
+void paging_init(void);
void map_page(uint32_t *pd, uintptr_t paddr, uintptr_t vaddr, uint32_t flags);
void unmap_page(uint32_t *pd, uintptr_t vaddr);
+void page_fault_handler(struct isr_frame *frame);
+
#endif