summaryrefslogtreecommitdiff
path: root/arch/i386/include/kernel
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.org>2024-05-27 14:25:27 -0500
committerDanny Holman <dholman@gymli.org>2024-05-27 14:26:45 -0500
commit5fb0ba537ab15f9c83afd9a939cf57c84d443856 (patch)
tree50592128b2ae9779dc570c1ae89db3f3d64ae495 /arch/i386/include/kernel
parente472fbf564a8dee7ec4cb03b3e77a213a017bc76 (diff)
arch: i386: pmem: refactor the physical MM
Refactor the physical memory manager to be dramatically simpler. The new design uses only a single freelist, and only uses temporary mappings where needed. Signed-off-by: Danny Holman <dholman@gymli.org>
Diffstat (limited to 'arch/i386/include/kernel')
-rw-r--r--arch/i386/include/kernel/pmem.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/arch/i386/include/kernel/pmem.h b/arch/i386/include/kernel/pmem.h
index ddd9c8b..da169c7 100644
--- a/arch/i386/include/kernel/pmem.h
+++ b/arch/i386/include/kernel/pmem.h
@@ -4,25 +4,16 @@
#include <kernel/multiboot.h>
#include <stdint.h>
-#define PFA_BLOCK_FREE 1
-#define PFA_BLOCK_ALLOC 3
-
#define PFA_ALLOC_ERR 0xFFFFFFFF
struct pfa_page {
struct pfa_page *next;
};
-struct pfa_zone {
- uintptr_t start;
- uintptr_t size;
- struct pfa_page *freelist;
-};
-
-int pfa_init(struct mboot_info *header);
+void pfa_init(struct mboot_info *header);
uintptr_t pfa_alloc(void);
-void pfa_free(struct pfa_zone *zone, uintptr_t paddr);
-void pfa_free_range(struct pfa_zone *zone, uintptr_t pstart, uintptr_t pend);
+void pfa_free(uintptr_t paddr);
+void pfa_free_range(uintptr_t start, uintptr_t end);
#endif