mirror of
https://github.com/drasko/codezero.git
synced 2026-03-01 02:03:29 +01:00
Initial commit
This commit is contained in:
28
tasks/libmem/kmalloc/kmalloc.h.orig
Normal file
28
tasks/libmem/kmalloc/kmalloc.h.orig
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef __KMALLOC_H__
|
||||
#define __KMALLOC_H__
|
||||
|
||||
#include <mm/alloc_page.h>
|
||||
#include <l4/lib/list.h>
|
||||
/* List member to keep track of free and unused regions in subpages.
|
||||
* Smallest unit it represents is one byte, but note that it is also
|
||||
* used for describing regions that span across multiple pages. */
|
||||
struct subpage_area {
|
||||
struct list_head list;
|
||||
unsigned int vaddr;
|
||||
unsigned int size;
|
||||
unsigned int used;
|
||||
unsigned int head_of_pages; /* Means head of alloc_page() */
|
||||
};
|
||||
|
||||
extern struct subpage_area subpage_area_start;
|
||||
|
||||
/* Kmalloc initialisation */
|
||||
void kmalloc_init(void);
|
||||
|
||||
/* Kmalloc allocation functions */
|
||||
void *kmalloc(int size);
|
||||
void *kzalloc(int size);
|
||||
int kfree(void *vaddr);
|
||||
|
||||
#endif /* __KMALLOC_H__ */
|
||||
|
||||
Reference in New Issue
Block a user