29 current->
count -= count;
30 void* ret = (
void*)current->
start;
33 current->
start += 4096 * count;
42 current = current->
next;
68 new[i - 1].next =
new + i;
77 while(usable_page % 4096);
84 page_list[i].
start = 0;
85 page_list[i].
count = 0;
87 page_list[i].
next = &page_list[i + 1];
108 if(start >= current->
start && start + (count * 4096) <= current->
start + (current->
count * 4096)) {
109 if(current->
status == status) {
116 uint64_t count_first = (start - start_first) / 4096;
118 if(count_first == 0) {
122 current->
start = start_first;
123 current->
count = count_first;
126 ptr_t start_second = start + (count * 4096);
127 uint64_t count_second = (current->
start + (current->
count * 4096)) - (start + (count * 4096));
131 entry->start = start_second;
132 entry->count = count_second;
133 entry->status = old_status;
137 entry->start = start;
138 entry->count = count;
139 entry->status = status;
145 current = current->
next;
151 new->status = status;
159 logd(
"mm",
"%d free pages starting at 0x%x\n", current->
count, current->
start);
162 current = current->
next;
172 res = current->
start + (current->
count * 4096);
175 current = current->
next;
#define ALLOCATOR_REGION_KERNEL_HEAP
#define logd(component, fmt,...)
void mm_bootstrap(ptr_t usable_page)
void * mm_alloc_pages(uint64_t count)
void mm_print_physical_free_regions(void)
void mm_mark_physical_pages(ptr_t start, uint64_t count, mm_page_status_t status)
ptr_t mm_highest_address(void)
void mm_del_page_list_entry(mm_page_list_entry_t *entry)
mm_page_list_entry_t * mm_get_page_list_entry(mm_page_list_entry_t *start)
mm_page_list_entry_t * mm_physical_page_list
void panic_message(const char *message)
ptr_t vm_context_alloc_pages(struct vm_table *context, region_t region, size_t num)
struct vm_table * VM_KERNEL_CONTEXT