Rev 378 | Rev 430 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 378 | Rev 381 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | #include <arch/types.h> |
32 | #include <arch/types.h> |
33 | #include <typedefs.h> |
33 | #include <typedefs.h> |
34 | 34 | ||
35 | #define BUDDY_SYSTEM_INNER_BLOCK 0xff |
35 | #define BUDDY_SYSTEM_INNER_BLOCK 0xff |
36 | 36 | ||
37 | struct buddy_operations { |
37 | struct buddy_system_operations { |
38 | link_t *(* find_buddy)(link_t *); |
38 | link_t *(* find_buddy)(link_t *); |
39 | link_t *(* bisect)(link_t *); |
39 | link_t *(* bisect)(link_t *); |
40 | link_t *(* coalesce)(link_t *, link_t *); |
40 | link_t *(* coalesce)(link_t *, link_t *); |
41 | void (*set_order)(link_t *, __u8); |
41 | void (*set_order)(link_t *, __u8); |
42 | __u8 (*get_order)(link_t *); |
42 | __u8 (*get_order)(link_t *); |
43 | }; |
43 | }; |
44 | 44 | ||
45 | struct buddy_system { |
45 | struct buddy_system { |
46 | __u8 max_order; |
46 | __u8 max_order; |
47 | link_t *order; |
47 | link_t *order; |
48 | buddy_operations_t *op; |
48 | buddy_system_operations_t *op; |
49 | }; |
49 | }; |
50 | 50 | ||
51 | extern buddy_system_t *buddy_system_create(__u8 max_order, buddy_operations_t *op); |
51 | extern buddy_system_t *buddy_system_create(__u8 max_order, buddy_system_operations_t *op); |
52 | extern link_t *buddy_system_alloc(buddy_system_t *b, __u8 i); |
52 | extern link_t *buddy_system_alloc(buddy_system_t *b, __u8 i); |
53 | extern void buddy_system_free(buddy_system_t *b, link_t *block); |
53 | extern void buddy_system_free(buddy_system_t *b, link_t *block); |
54 | 54 | ||
55 | #endif |
55 | #endif |