Rev 532 | Rev 534 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 532 | Rev 533 | ||
---|---|---|---|
Line 39... | Line 39... | ||
39 | link_t *(* find_buddy)(buddy_system_t *, link_t *); /**< Return pointer to left-side or right-side buddy for block passed as argument. */ |
39 | link_t *(* find_buddy)(buddy_system_t *, link_t *); /**< Return pointer to left-side or right-side buddy for block passed as argument. */ |
40 | link_t *(* bisect)(buddy_system_t *, link_t *); /**< Bisect the block passed as argument and return pointer to the new right-side buddy. */ |
40 | link_t *(* bisect)(buddy_system_t *, link_t *); /**< Bisect the block passed as argument and return pointer to the new right-side buddy. */ |
41 | link_t *(* coalesce)(buddy_system_t *, link_t *, link_t *); /**< Coalesce two buddies into a bigger block. */ |
41 | link_t *(* coalesce)(buddy_system_t *, link_t *, link_t *); /**< Coalesce two buddies into a bigger block. */ |
42 | void (*set_order)(buddy_system_t *, link_t *, __u8); /**< Set order of block passed as argument. */ |
42 | void (*set_order)(buddy_system_t *, link_t *, __u8); /**< Set order of block passed as argument. */ |
43 | __u8 (*get_order)(buddy_system_t *, link_t *); /**< Return order of block passed as argument. */ |
43 | __u8 (*get_order)(buddy_system_t *, link_t *); /**< Return order of block passed as argument. */ |
- | 44 | void (*mark_busy)(buddy_system_t *, link_t *); /**< Mark block as busy */ |
|
44 | }; |
45 | }; |
45 | 46 | ||
46 | struct buddy_system { |
47 | struct buddy_system { |
47 | __u8 max_order; |
48 | __u8 max_order; |
48 | link_t *order; |
49 | link_t *order; |
Line 50... | Line 51... | ||
50 | void *data; /**< Pointer to be used by the implementation. */ |
51 | void *data; /**< Pointer to be used by the implementation. */ |
51 | }; |
52 | }; |
52 | 53 | ||
53 | extern buddy_system_t *buddy_system_create(__u8 max_order, buddy_system_operations_t *op, void *data); |
54 | extern buddy_system_t *buddy_system_create(__u8 max_order, buddy_system_operations_t *op, void *data); |
54 | extern link_t *buddy_system_alloc(buddy_system_t *b, __u8 i); |
55 | extern link_t *buddy_system_alloc(buddy_system_t *b, __u8 i); |
- | 56 | extern bool buddy_system_can_alloc(buddy_system_t *b, __u8 order); |
|
55 | extern void buddy_system_free(buddy_system_t *b, link_t *block); |
57 | extern void buddy_system_free(buddy_system_t *b, link_t *block); |
56 | 58 | ||
57 | #endif |
59 | #endif |