kernel: pmm

This commit is contained in:
Matheus
2023-04-12 21:40:16 -03:00
parent d4aef81b43
commit 616b0208c2
3 changed files with 197 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#ifndef _PMM_H
#define _PMM_H
#include <stddef.h>
#include <stdint.h>
#define PMM_SECTION_COUNT 3
#define PMM_SECTION_1MB 0
#define PMM_SECTION_4GB 1
#define PMM_SECTION_DEFAULT 2
void *pmm_alloc(size_t count, int flags);
void pmm_free(void *addr, size_t count);
void pmm_init();
extern uintptr_t hhdmbase;
#define MAKE_HHDM(x) (void *)((uintptr_t)x + hhdmbase)
#define FROM_HHDM(x) (void *)((uintptr_t)x - hhdmbase)
#endif