X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/9fe5e02cf615ad121c4460fbaaac2787d1e09c0e..7b0dccbab69e806a63c4504c3ddb82e45241985b:/lunaix-os/includes/lunaix/mm/page.h diff --git a/lunaix-os/includes/lunaix/mm/page.h b/lunaix-os/includes/lunaix/mm/page.h index e97de1d..935909c 100644 --- a/lunaix-os/includes/lunaix/mm/page.h +++ b/lunaix-os/includes/lunaix/mm/page.h @@ -3,13 +3,16 @@ #include #include -#define PG_SIZE_BITS 12 +#define PG_SIZE_BITS 12 +#define PG_SIZE (1 << PG_SIZE_BITS) #define PG_INDEX_BITS 10 #define PG_MAX_ENTRIES 1024U #define PG_LAST_TABLE PG_MAX_ENTRIES - 1 #define PG_FIRST_TABLE 0 +#define PTE_NULL 0 + #define P2V(paddr) ((uintptr_t)(paddr) + HIGHER_HLF_BASE) #define V2P(vaddr) ((uintptr_t)(vaddr) - HIGHER_HLF_BASE) @@ -78,5 +81,12 @@ typedef struct { uint16_t flags; } v_mapping; +typedef uint32_t x86_pte_t; +typedef struct +{ + x86_pte_t entry[PG_MAX_ENTRIES]; +} __attribute__((packed)) x86_page_table; + + #endif /* __LUNAIX_PAGE_H */