XenevaOS
Loading...
Searching...
No Matches
XenevaOS
BaseHdr
Mm
buddy.h
Go to the documentation of this file.
1
30
#ifndef __BUDDY_H__
31
#define __BUDDY_H__
32
33
#include <stdint.h>
34
35
#if 0
36
37
#define BUDDY_MAGIC 0x160602
38
/*
39
* BuddyBlock size should be
40
* aligned to 32 byte
41
*/
42
#pragma pack(push,1)
43
typedef
struct
_buddy_block_ {
44
_buddy_block_ *next;
45
_buddy_block_ *prev;
46
void
*
head
;
47
uint32_t
buddy_magic;
48
uint32_t
size
;
49
}BuddyBlock;
50
#pragma pack(pop)
51
52
typedef
struct
_buddy_free_list_ {
53
BuddyBlock *first;
54
}BuddyFreeList;
55
56
57
/*
58
* AuBuddyInitialise -- initialise the buddy allocator
59
*/
60
extern
void
AuBuddyInitialise();
61
62
/*
63
* AuBuddyGetLevel -- Return the buddy level by its size
64
* @param size -- required size
65
*/
66
extern
size_t
AuBuddyGetLevel(
size_t
size
);
67
68
/*
69
* __AuBuddyAlloc -- allocates a memory from given level
70
* @param level -- level to check
71
*/
72
extern
void
* __AuBuddyAlloc(
size_t
level
);
73
74
/*
75
* AuBuddyAlloc -- Allocate some memory
76
* @param sz -- Size to allocate
77
*/
78
extern
void
* AuBuddyAlloc(
size_t
sz);
79
80
/*
81
* AuBuddyFree -- frees up an allocated
82
* object
83
* @param p -- Pointer to memory block
84
*/
85
extern
void
AuBuddyFree(
void
* p);
86
87
#endif
88
89
#endif
uint32_t
unsigned int uint32_t
Definition
acefiex.h:163
size
size_t size
Definition
drm_bridge.h:1299
level
const char * level
Definition
drm_print.h:515
head
int const struct list_head const struct list_head struct list_head * head
Definition
list_sort.h:13
Generated by
1.9.8