Changeset 594a468 in mainline for generic/src/mm/frame.c


Ignore:
Timestamp:
2005-11-15T16:00:24Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
db79676
Parents:
93354b0
Message:

Make the buddy system more general.
Store implementation defined pointer in buddy_system_t.
Pass buddy system pointer to implementation defined buddy system operations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/mm/frame.c

    r93354b0 r594a468  
    339339                 */
    340340                for (max_order = 0; cnt >> max_order; max_order++);
    341                 z->buddy_system = buddy_system_create(max_order, &zone_buddy_system_operations);
     341                z->buddy_system = buddy_system_create(max_order, &zone_buddy_system_operations, (void *) z);
    342342        }
    343343       
     
    544544
    545545/** Buddy system find_buddy implementation
     546 *
     547 * @param b Buddy system.
    546548 * @param block Block for which buddy should be found
    547549 *
    548550 * @return Buddy for given block if found
    549551 */
    550 link_t * zone_buddy_find_buddy(link_t * block) {
     552link_t * zone_buddy_find_buddy(buddy_system_t *b, link_t * block) {
    551553        frame_t * frame, * f;
    552554        zone_t * zone;
     
    596598/** Buddy system bisect implementation
    597599 *
     600 * @param b Buddy system.
    598601 * @param block Block to bisect
    599602 *
    600603 * @return right block
    601604 */
    602 link_t * zone_buddy_bisect(link_t * block) {
     605link_t * zone_buddy_bisect(buddy_system_t *b, link_t * block) {
    603606        frame_t * frame_l, * frame_r;
    604607       
     
    613616/** Buddy system coalesce implementation
    614617 *
     618 * @param b Buddy system.
    615619 * @param block_1 First block
    616620 * @param block_2 First block's buddy
     
    618622 * @return Coalesced block (actually block that represents lower address)
    619623 */
    620 link_t * zone_buddy_coalesce(link_t * block_1, link_t * block_2) {
     624link_t * zone_buddy_coalesce(buddy_system_t *b, link_t * block_1, link_t * block_2) {
    621625        frame_t * frame1, * frame2;
    622626       
     
    628632
    629633/** Buddy system set_order implementation
     634 *
     635 * @param b Buddy system.
    630636 * @param block Buddy system block
    631637 * @param order Order to set
    632638 */
    633 void zone_buddy_set_order(link_t * block, __u8 order) {
     639void zone_buddy_set_order(buddy_system_t *b, link_t * block, __u8 order) {
    634640        frame_t * frame;
    635641        frame = list_get_instance(block, frame_t, buddy_link);
     
    638644
    639645/** Buddy system get_order implementation
     646 *
     647 * @param b Buddy system.
    640648 * @param block Buddy system block
    641649 *
    642650 * @return Order of block
    643651 */
    644 __u8 zone_buddy_get_order(link_t * block) {
     652__u8 zone_buddy_get_order(buddy_system_t *b, link_t * block) {
    645653        frame_t * frame;
    646654        frame = list_get_instance(block, frame_t, buddy_link);
Note: See TracChangeset for help on using the changeset viewer.