Rev 2465 | Rev 3207 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2465 | Rev 2725 | ||
---|---|---|---|
Line 82... | Line 82... | ||
82 | if (!size) |
82 | if (!size) |
83 | return 0; |
83 | return 0; |
84 | return (count_t) ((size - 1) >> FRAME_WIDTH) + 1; |
84 | return (count_t) ((size - 1) >> FRAME_WIDTH) + 1; |
85 | } |
85 | } |
86 | 86 | ||
- | 87 | static inline size_t FRAMES2SIZE(count_t frames) |
|
- | 88 | { |
|
- | 89 | return (size_t) (frames << FRAME_WIDTH); |
|
- | 90 | } |
|
- | 91 | ||
87 | #define IS_BUDDY_ORDER_OK(index, order) \ |
92 | #define IS_BUDDY_ORDER_OK(index, order) \ |
88 | ((~(((unative_t) -1) << (order)) & (index)) == 0) |
93 | ((~(((unative_t) -1) << (order)) & (index)) == 0) |
89 | #define IS_BUDDY_LEFT_BLOCK(zone, frame) \ |
94 | #define IS_BUDDY_LEFT_BLOCK(zone, frame) \ |
90 | (((frame_index((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 0) |
95 | (((frame_index((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 0) |
91 | #define IS_BUDDY_RIGHT_BLOCK(zone, frame) \ |
96 | #define IS_BUDDY_RIGHT_BLOCK(zone, frame) \ |
Line 102... | Line 107... | ||
102 | extern void *frame_alloc_generic(uint8_t order, int flags, unsigned int *pzone); |
107 | extern void *frame_alloc_generic(uint8_t order, int flags, unsigned int *pzone); |
103 | extern void frame_free(uintptr_t frame); |
108 | extern void frame_free(uintptr_t frame); |
104 | extern void frame_reference_add(pfn_t pfn); |
109 | extern void frame_reference_add(pfn_t pfn); |
105 | 110 | ||
106 | extern int zone_create(pfn_t start, count_t count, pfn_t confframe, int flags); |
111 | extern int zone_create(pfn_t start, count_t count, pfn_t confframe, int flags); |
107 | void *frame_get_parent(pfn_t frame, unsigned int hint); |
112 | extern void *frame_get_parent(pfn_t frame, unsigned int hint); |
108 | void frame_set_parent(pfn_t frame, void *data, unsigned int hint); |
113 | extern void frame_set_parent(pfn_t frame, void *data, unsigned int hint); |
109 | void frame_mark_unavailable(pfn_t start, count_t count); |
114 | extern void frame_mark_unavailable(pfn_t start, count_t count); |
110 | uintptr_t zone_conf_size(count_t count); |
115 | extern uintptr_t zone_conf_size(count_t count); |
111 | void zone_merge(unsigned int z1, unsigned int z2); |
116 | extern void zone_merge(unsigned int z1, unsigned int z2); |
112 | void zone_merge_all(void); |
117 | extern void zone_merge_all(void); |
- | 118 | extern uint64_t zone_total_size(void); |
|
113 | 119 | ||
114 | /* |
120 | /* |
115 | * Console functions |
121 | * Console functions |
116 | */ |
122 | */ |
117 | extern void zone_print_list(void); |
123 | extern void zone_print_list(void); |
118 | void zone_print_one(unsigned int znum); |
124 | extern void zone_print_one(unsigned int znum); |
119 | 125 | ||
120 | #endif |
126 | #endif |
121 | 127 | ||
122 | /** @} |
128 | /** @} |
123 | */ |
129 | */ |