summaryrefslogtreecommitdiff
path: root/kernel/source/paging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/source/paging.cpp')
-rw-r--r--kernel/source/paging.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/source/paging.cpp b/kernel/source/paging.cpp
index d8869fc..66d9bc7 100644
--- a/kernel/source/paging.cpp
+++ b/kernel/source/paging.cpp
@@ -38,11 +38,6 @@ namespace hilbert::kernel::paging {
uint64_t kernel_p4e;
- uint64_t encode_pte(uint64_t addr, bool user, bool write, bool execute) {
- return (addr & 0x0000ffffffffffff) | (execute ? 0 : (1ULL << 63))
- | (user << 2) | (write << 1) | 1;
- }
-
void init_kernel_page_tables(uint64_t kernel_offset) {
__kernel_p4_paddr = (uint64_t)kernel_p4 - kernel_offset;
for (int i = 0; i < 511; ++i)
@@ -87,6 +82,11 @@ namespace hilbert::kernel::paging {
return 0;
}
+ void free_pram_page(uint64_t paddr) {
+ uint64_t page_i = paddr / 4096;
+ pram_usage_bitmap[page_i / 64] &= ~(1ULL << (page_i % 64));
+ }
+
void map_kernel_stacks() {
for (uint64_t vaddr = syscall_stack_bottom;
vaddr < syscall_stack_top; vaddr += 4096)