Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
include
mm
mm.h
Go to the documentation of this file.
1
4
#ifndef __MM_H__
5
#define __MM_H__
6
7
#include <stddef.h>
8
#include <stdint.h>
9
10
#define DEF_KMALLOC_SLAB(_size) \
11
{ \
12
.size = _size, .name = "kmalloc-"
#_size \
13
}
14
15
#define KMALLOC_SLAB_TABLE_SIZE \
16
(sizeof(kmalloc_slab_info) / sizeof(struct kmalloc_slab_info))
17
18
struct
kmalloc_header
{
19
size_t
size;
20
};
21
22
struct
kmalloc_slab_info
{
23
char
*name;
24
size_t
size;
25
};
26
32
void
*
kmalloc
(
size_t
size);
33
39
void
kfree
(
void
*ptr);
40
41
unsigned
long
heap_get_total_size(
void
);
42
unsigned
long
heap_get_free_size(
void
);
43
void
heap_init(
void
);
44
void
*__malloc(
size_t
size);
45
void
__free(
void
*ptr);
46
47
#endif
kfree
void kfree(void *ptr)
Free the memory space pointed to by ptr.
Definition:
kernel.c:226
kmalloc
void * kmalloc(size_t size)
Allocate a memory space for using in the kernel.
Definition:
kernel.c:180
kmalloc_header
Definition:
mm.h:18
kmalloc_slab_info
Definition:
mm.h:22
Generated by
1.9.1