Upload files to "include/mm"

This commit is contained in:
2025-05-20 20:41:52 -05:00
parent afc08c3d0d
commit ab7ff12a2f
4 changed files with 47 additions and 0 deletions

19
include/mm/heap.h Normal file
View File

@ -0,0 +1,19 @@
#ifndef _HEAP_H
#define _HEAP_H
#include <types.h>
#define HEAP_START 0xC0000000
#define HEAP_SIZE (1024 * 4096) /* 1MB heap */
void heap_init(void);
void* malloc(size_t size);
void* malloc_aligned(size_t size, size_t alignment);
void* calloc(size_t nmemb, size_t size);
void* realloc(void* ptr, size_t size);
void free(void* ptr);
#endif

8
include/mm/mm.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef _MM_H
#define _MM_H
#include <mm/pmm.h>
#include <mm/heap.h>
#include <mm/paging.h>
#endif

9
include/mm/paging.h Normal file
View File

@ -0,0 +1,9 @@
#ifndef _PAGING_H
#define _PAGING_H
#include <types.h>
void paging_init(void);
void map_page(void* phys, void* virt);
#endif

11
include/mm/pmm.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef _PMM_H
#define _PMM_H
#include <stdint.h>
#include <multiboot.h>
void pmm_init(multiboot_info_t* mb_info);
void* alloc_page(void);
void free_page(void* ptr);
#endif