Files
codezero/tasks/libmem/kmalloc/kmalloc.h
Bahadir Balban 89d774f7fa Mixed changes
- Added automatic utcb map/prefaulting of forked tasks for fs0
  so that it does not need to explicitly request those tasks from mm0.
  Eliminating fs0 requests to mm0 reduce deadlock possibilities.

- Replaced kmalloc with a public malloc implementation because of a bug in kmalloc.
- Fixed a kfree bug. default_release_pages was trying to free page_array pages.
2008-09-09 13:36:42 +03:00

32 lines
765 B
C

#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 km_area {
struct list_head list;
unsigned long vaddr;
unsigned long size;
int used;
int pg_alloc_pages; /* Means borrowed from alloc_page() */
};
extern struct list_head km_area_start;
/* Kmalloc initialisation */
void kmalloc_init(void);
/* Kmalloc allocation functions */
void *kmalloc(int size) __attribute__((weak));
void *kzalloc(int size) __attribute__((weak));
int kfree(void *vaddr) __attribute__((weak));
#endif /* __KMALLOC_H__ */