"Intel64 mode"
};
-#define ALIGNED(_v, _a) (!((_v) & (((_a) - 1))))
-#define ALIGN(_v, _a) (ALIGNED((_v), (_a)) ? (_v) : (((_v) & ~((_a) - 1)) + (_a)))
-
static void* _phys_alloc(u32_t size, u32_t align)
{
extern u32_t _mem_start;
return(addr);
}
-static void* _frame_alloc_start(void)
+void* pg_frame_alloc_start(void)
{
u32_t frm;
return(NULL);
}
-static void* _frame_alloc_end(void)
+void* pg_frame_alloc_end(void)
{
u32_t frm;
u64_t ppt_entries[512];
} __attribute__((packed));
+#define ALIGNED(_v, _a) (!((_v) & (((_a) - 1))))
+#define ALIGN(_v, _a) (ALIGNED((_v), (_a)) ? (_v) : (((_v) & ~((_a) - 1)) + (_a)))
+
#define PDPT_ALIGN 32
#define PAGE_ALIGN 0x1000
#define ARCH_ALIGN sizeof(void*)
#define PAGE_ATTR_GLOBAL (1 << 8)
#define PAGE_ATTR_NO_EXEC (1 << 63)
+void* pg_frame_alloc_start(void);
+void* pg_frame_alloc_end(void);
+
int pagedir_init(struct pagedir*);
void* pagedir_map_pages(struct pagedir*);
int pagedir_free(struct pagedir*);