Upload files to "include/mm"
This commit is contained in:
19
include/mm/heap.h
Normal file
19
include/mm/heap.h
Normal 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
8
include/mm/mm.h
Normal 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
9
include/mm/paging.h
Normal 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
11
include/mm/pmm.h
Normal 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
|
Reference in New Issue
Block a user