kmalloc()/kfree() re-implementation
This commit is contained in:
@@ -19,11 +19,13 @@
|
||||
* CPU Local Storage (cls)
|
||||
*/
|
||||
|
||||
struct malloc_header {
|
||||
unsigned int check;
|
||||
struct kmalloc_header {
|
||||
unsigned int front_magic;
|
||||
unsigned int cpu_id;
|
||||
struct malloc_header *next;
|
||||
unsigned long size;
|
||||
struct list_head list;
|
||||
int size; /* The size of this chunk without the header */
|
||||
unsigned int end_magic;
|
||||
/* 32 bytes */
|
||||
};
|
||||
|
||||
#include <ihk/lock.h>
|
||||
@@ -38,8 +40,9 @@ extern ihk_spinlock_t cpu_status_lock;
|
||||
|
||||
struct cpu_local_var {
|
||||
/* malloc */
|
||||
struct malloc_header free_list;
|
||||
struct malloc_header *remote_free_list;
|
||||
struct list_head free_list;
|
||||
struct list_head remote_free_list;
|
||||
ihk_spinlock_t remote_free_list_lock;
|
||||
|
||||
struct thread idle;
|
||||
struct process idle_proc;
|
||||
|
||||
@@ -32,8 +32,6 @@ void *_kmalloc(int size, enum ihk_mc_ap_flag flag, char *file, int line);
|
||||
void _kfree(void *ptr, char *file, int line);
|
||||
void *__kmalloc(int size, enum ihk_mc_ap_flag flag);
|
||||
void __kfree(void *ptr);
|
||||
void *___kmalloc(int size, enum ihk_mc_ap_flag flag);
|
||||
void ___kfree(void *ptr);
|
||||
|
||||
int _memcheck(void *ptr, char *msg, char *file, int line, int free);
|
||||
int memcheckall();
|
||||
|
||||
Reference in New Issue
Block a user