Merge branch 'device-sys'
[lunaix-os.git] / lunaix-os / includes / lunaix / mm / kalloc.h
1 #ifndef __LUNAIX_KALLOC_H
2 #define __LUNAIX_KALLOC_H
3
4 #include <stddef.h>
5
6 int
7 kalloc_init();
8
9 /**
10  * @brief Allocate a contiguous and un-initialized memory region in kernel heap. 
11  * 
12  * @remarks 
13  *  This is NOT the same as kmalloc in Linux! 
14  *  LunaixOS does NOT guarantee the continuity in physical pages.
15  * 
16  * @param size 
17  * @return void* 
18  */
19 void*
20 lxmalloc(size_t size);
21
22 /**
23  * @brief Allocate a contiguous and initialized memory region in kernel heap.
24  * @param size 
25  * @return void*
26  */
27 void*
28 lxcalloc(size_t n, size_t elem);
29
30 /**
31  * @brief Free the memory region allocated by kmalloc
32  * 
33  * @param size 
34  * @return void* 
35  */
36 void
37 lxfree(void* ptr);
38
39 #endif /* __LUNAIX_KALLOC_H */