diff options
Diffstat (limited to 'src/core/paging.hpp')
| -rw-r--r-- | src/core/paging.hpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/core/paging.hpp b/src/core/paging.hpp index 4bb668c..089bd47 100644 --- a/src/core/paging.hpp +++ b/src/core/paging.hpp @@ -18,9 +18,14 @@ /// @brief Get page address that contain addr #define PAGE(addr) (addr&(~(0xFFF))) -#define PAGING_MAP(addr) paging_allocate_addr(kpml4,(u64)(addr),(u64)(addr),PAGING_OPT_P|PAGING_OPT_RW) +#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 -extern u64* kpml4; +/// @brief All PAE table structures are allocated here +extern u64 kpages[MAX_TABLES][512]; + +/// @brief Various variables from the linker +extern u64 kernel_vma,stack_pma,userspace_pma; /** * Setup and enable PAE paging @@ -56,13 +61,16 @@ void paging_deallocate_table(u64* table); /** * Allocate table structure (pml4, pdp etc..) */ -u64* paging_allocate_table(); +u64* paging_allocate_table_local(); /** * Map virtual page associated to virt * to the physical page associated with phy + * Offset can be used to convert pml4_table address + * content to virtual addresses (since physical addresses from the pml4_table are not + * available after the trampoline into High-Half memory) */ -void paging_allocate_addr(u64* pml4_table,u64 virt, u64 phy, u16 options); +void paging_allocate_addr(u64* pml4_table,u64 virt, u64 phy, u16 options, u64 offset); /** * Get associated physical address |
