summaryrefslogtreecommitdiff
path: root/kernel/includes/mmu.h
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-03-20 18:08:57 +0100
committerAnton Kling <anton@kling.gg>2024-03-20 19:08:18 +0100
commita950021011e41b7d4fd285dde278cf9b06f89574 (patch)
tree1d88d00ac2f31d8d7c47dc84a954caea68c0b5f2 /kernel/includes/mmu.h
parent553b43d2e563dcff74d4c86904fa3737e96d7365 (diff)
MMU: Fixed massive problem in assumption of RAM layout
This caused certain addreses which where not RAM memory to be assigned to virtual addresses incorrectly. This caused a significant slowdown when running it with KVM due to constantly having to exit the VM if the OS writes to memory that is not RAM. This fix increased the performance of KVM significantly and improved TCG performance.
Diffstat (limited to 'kernel/includes/mmu.h')
-rw-r--r--kernel/includes/mmu.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/includes/mmu.h b/kernel/includes/mmu.h
index 68fd134..1a3f7c9 100644
--- a/kernel/includes/mmu.h
+++ b/kernel/includes/mmu.h
@@ -1,6 +1,7 @@
#ifndef PAGING_H
#define PAGING_H
#include "kmalloc.h"
+#include <multiboot.h>
#include <typedefs.h>
typedef u8 mmu_flags;
@@ -49,7 +50,7 @@ void *mmu_is_valid_userpointer(const void *ptr, size_t s);
void *mmu_is_valid_user_c_string(const char *ptr, size_t *size);
void flush_tlb(void);
-void paging_init(u64 memsize);
+void paging_init(u64 memsize, multiboot_info_t *mb);
PageDirectory *get_active_pagedirectory(void);
void move_stack(u32 new_stack_address, u32 size);
void switch_page_directory(PageDirectory *directory);
@@ -58,6 +59,7 @@ PageDirectory *clone_directory(PageDirectory *original);
void *virtual_to_physical(void *address, PageDirectory *directory);
void *ksbrk(size_t s);
void *ksbrk_physical(size_t s, void **physical);
+void write_to_frame(u32 frame_address, u8 on);
Page *get_page(void *ptr, PageDirectory *directory, int create_new_page,
int set_user);