PatchworkOS
Loading...
Searching...
No Matches
pmm_stack.h
Go to the documentation of this file.
1#pragma once
2
3#include <sys/proc.h>
4
21typedef struct page_buffer
22{
26 struct page_buffer* prev;
30 void* pages[];
32
36#define PMM_BUFFER_MAX ((PAGE_SIZE - sizeof(page_buffer_t)) / sizeof(void*))
37
56
63
71
79
void * pmm_stack_alloc(pmm_stack_t *stack)
Allocates a single page from the stack.
Definition pmm_stack.c:12
void pmm_stack_init(pmm_stack_t *stack)
Initializes a PMM stack.
Definition pmm_stack.c:5
void pmm_stack_free(pmm_stack_t *stack, void *address)
Frees a single page, returning it to the stack.
Definition pmm_stack.c:36
static uintptr_t address
Definition hpet.c:12
static pmm_stack_t stack
Definition pmm.c:36
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
Structure for a page buffer in the PMM stack.
Definition pmm_stack.h:22
struct page_buffer * prev
Pointer to the previous page buffer in the stack.
Definition pmm_stack.h:26
PMM stack structure for managing higher physical memory.
Definition pmm_stack.h:42
uint64_t free
The number of free pages in the stack.
Definition pmm_stack.h:54
page_buffer_t * last
Pointer to the last page buffer in the stack.
Definition pmm_stack.h:46
uint64_t index
Current index within the pages array of the last page buffer.
Definition pmm_stack.h:50