aboutsummaryrefslogtreecommitdiff
path: root/src/core/paging.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/paging.hpp')
-rw-r--r--src/core/paging.hpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/paging.hpp b/src/core/paging.hpp
index 01e45a7..5817765 100644
--- a/src/core/paging.hpp
+++ b/src/core/paging.hpp
@@ -2,6 +2,7 @@
#include "core/types.hpp"
+#define MAX_TABLES 280
#define PAGING_MAX_PAGE (20*512)
/**
* Current number of page (from the beginning of the ram) used by the kernel that
@@ -18,15 +19,17 @@
/// @brief Get page address that contain addr
#define PAGE(addr) (addr&(~(0xFFF)))
-#define PAGING_MAP(addr) paging_allocate_addr(kpages[0],(u64)(addr),(u64)(addr),PAGING_OPT_P|PAGING_OPT_RW,kernel_vma)
-#define MAX_TABLES 280
+#define PAGING_MAP(addr) paging_allocate_addr(kpages[0],(u64)(addr),(u64)(addr),PAGING_OPT_P|PAGING_OPT_RW,kvar_kernel_vma)
+#define PAGING_MAP_RANGE(addr, n) { \
+ for(u64 i=0;i<(n);i++){ \
+ paging_allocate_addr(kpages[0],((u64)(addr))+i,((u64)(addr))+i,PAGING_OPT_P|PAGING_OPT_RW,kvar_kernel_vma); \
+}}
/// @brief All PAE table structures are allocated here
extern u64 kpages[MAX_TABLES][512];
-/// cf boucane.hpp
-extern u64 kernel_vma,stack_pma,userspace_pma;
-
+/// CF boucane.hpp
+extern u64 kvar_kernel_vma,kvar_stack_pma,kvar_userspace_pma;
/**
* Setup and enable PAE paging