mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
pmm: full rewrite
I've decided to do a rewrite on it due to some plans that would make refcounting physical pages nescessary among other things. now instead of a bitmap it uses a list of pages with each physical page having a page_t associated with it
This commit is contained in:
@@ -9,9 +9,37 @@
|
||||
#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();
|
||||
#define PAGE_FLAGS_FREE 1
|
||||
|
||||
typedef struct page_t {
|
||||
struct vnode_t *backing;
|
||||
uintmax_t offset;
|
||||
struct page_t *hashnext;
|
||||
struct page_t *hashprev;
|
||||
struct page_t *vnodenext;
|
||||
struct page_t *vnodeprev;
|
||||
union {
|
||||
struct {
|
||||
struct page_t *freenext;
|
||||
struct page_t *freeprev;
|
||||
};
|
||||
struct {
|
||||
struct page_t *writenext;
|
||||
struct page_t *writeprev;
|
||||
};
|
||||
};
|
||||
uintmax_t refcount;
|
||||
int flags;
|
||||
} page_t;
|
||||
|
||||
void *pmm_allocpage(int section);
|
||||
page_t *pmm_getpage(void *addr);
|
||||
void pmm_hold(void *addr);
|
||||
void pmm_release(void *addr);
|
||||
void pmm_makefree(void *address, size_t count);
|
||||
void *pmm_alloc(size_t size, int section);
|
||||
void pmm_free(void *addr, size_t size);
|
||||
void pmm_init();
|
||||
|
||||
extern uintptr_t hhdmbase;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user