diff options
author | Danny Holman <dholman@gymli.org> | 2024-03-28 21:30:12 -0500 |
---|---|---|
committer | Danny Holman <dholman@gymli.org> | 2024-03-28 21:30:12 -0500 |
commit | cbe2690cd5d1b290633c466ebb4df7b64b09b037 (patch) | |
tree | 99f77ef19f303c42c028be11cbb4210245b8a583 /arch/i386/include/kernel/paging.h | |
parent | 891f1010bbdc1351bda8d2a6139094a14bdfd5e1 (diff) |
arch: i386: kernel: add mostly finished PFA and paging system
Add the mostly finished physical memory allocator and expose its
functions to the paging system.
Signed-off-by: Danny Holman <dholman@gymli.org>
Diffstat (limited to 'arch/i386/include/kernel/paging.h')
-rw-r--r-- | arch/i386/include/kernel/paging.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/i386/include/kernel/paging.h b/arch/i386/include/kernel/paging.h index 7f820e8..e949e32 100644 --- a/arch/i386/include/kernel/paging.h +++ b/arch/i386/include/kernel/paging.h @@ -23,9 +23,10 @@ #define ERR_RESERVED 0x8 #define ERR_INST 0x10 -#define PAGE_SIZE 4096 +#define PGROUNDUP(size) (((size)+PAGE_SIZE-1) & ~(PAGE_SIZE-1)) +#define PGROUNDDN(size) (((size)) & ~(PAGE_SIZE-1)) -uint32_t* init_page_table(uint32_t flags); +int init_page_directory(uintptr_t *pd, int user); void enable_paging(uintptr_t pd_addr); void paging_init(void); |