Files
mop3/kernel/mm/pmm.h
kamkow1 e5ebd7f3ba
All checks were successful
Build ISO image / build-and-deploy (push) Successful in 2m21s
Build documentation / build-and-deploy (push) Successful in 54s
Use a big-lock for kernel sychronization instead of fine-grained locking
2026-04-27 18:06:02 +02:00

34 lines
580 B
C

#ifndef _KERNEL_MM_PMM_H
#define _KERNEL_MM_PMM_H
#include <libk/bm.h>
#include <libk/std.h>
#include <sync/spin_lock.h>
#define PMM_ALLOC_ERR ((uintptr_t)-1)
#define PMM_REGIONS_MAX 32
#define PMM_REGION_ACTIVE (1 << 0)
struct pmm_region {
struct bm bm;
uintptr_t membase;
size_t size;
uint32_t flags;
};
struct pmm {
struct pmm_region regions[PMM_REGIONS_MAX];
};
void pmm_init(void);
uintptr_t pmm_alloc(size_t nblks);
uintptr_t pmm_alloc_aligned(size_t nblks, size_t align_pages);
void pmm_free(uintptr_t p_addr, size_t nblks);
#endif // _KERNEL_MM_PMM_H