summaryrefslogtreecommitdiff
path: root/src/kernel/mem/mem.h
blob: cb9c396ea93033284ce72b01edb66fb2348ba2ca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef DEF_MEM_H
#define DEF_MEM_H

/*	mem.c provides the kernel's allocation and freeing functions.
	kmalloc_page and kfree_page are used mostly for paging. */

#include <types.h>
#include "_dlmalloc.h"

void* kmalloc_page(size_t *phys);
void kfree_page(void* page);

// Internal, used by dlmalloc
void* ksbrk(size_t size);
void kbrk(void* ptr);

#define kmalloc dlmalloc
#define kfree dlfree

void kheap_init();

extern int _no_more_ksbrk;
extern size_t mem_placementAddr;
extern void end;	//Symbol defined by linker : end of kernel code

extern void k_highhalf_addr;	// Symbol defined by linker : high half position of the kerne
								// Should be at 0xC0000000
#define K_HIGHHALF_ADDR ((size_t)(&k_highhalf_addr))

#endif