Changeset 0f3fc9b in mainline for kernel/generic/include
- Timestamp:
- 2007-01-22T13:34:55Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 726e1043
- Parents:
- e7b7be3f
- Location:
- kernel/generic/include
- Files:
-
- 2 edited
-
mm/buddy.h (modified) (2 diffs)
-
typedefs.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/mm/buddy.h
re7b7be3f r0f3fc9b 41 41 #define BUDDY_SYSTEM_INNER_BLOCK 0xff 42 42 43 struct buddy_system; 44 43 45 /** Buddy system operations to be implemented by each implementation. */ 44 struct buddy_system_operations{46 typedef struct { 45 47 /** Return pointer to left-side or right-side buddy for block passed as 46 48 * argument. */ 47 link_t *(* find_buddy)( buddy_system_t*, link_t *);49 link_t *(* find_buddy)(struct buddy_system *, link_t *); 48 50 /** Bisect the block passed as argument and return pointer to the new 49 51 * right-side buddy. */ 50 link_t *(* bisect)( buddy_system_t*, link_t *);52 link_t *(* bisect)(struct buddy_system *, link_t *); 51 53 /** Coalesce two buddies into a bigger block. */ 52 link_t *(* coalesce)( buddy_system_t*, link_t *, link_t *);54 link_t *(* coalesce)(struct buddy_system *, link_t *, link_t *); 53 55 /** Set order of block passed as argument. */ 54 void (*set_order)( buddy_system_t*, link_t *, uint8_t);56 void (*set_order)(struct buddy_system *, link_t *, uint8_t); 55 57 /** Return order of block passed as argument. */ 56 uint8_t (*get_order)( buddy_system_t*, link_t *);58 uint8_t (*get_order)(struct buddy_system *, link_t *); 57 59 /** Mark block as busy. */ 58 void (*mark_busy)( buddy_system_t*, link_t *);60 void (*mark_busy)(struct buddy_system *, link_t *); 59 61 /** Mark block as available. */ 60 void (*mark_available)( buddy_system_t*, link_t *);62 void (*mark_available)(struct buddy_system *, link_t *); 61 63 /** Find parent of block that has given order */ 62 link_t *(* find_block)( buddy_system_t*, link_t *, uint8_t);63 void (* print_id)( buddy_system_t*, link_t *);64 } ;64 link_t *(* find_block)(struct buddy_system *, link_t *, uint8_t); 65 void (* print_id)(struct buddy_system *, link_t *); 66 } buddy_system_operations_t; 65 67 66 struct buddy_system {68 typedef struct buddy_system { 67 69 /** Maximal order of block which can be stored by buddy system. */ 68 70 uint8_t max_order; … … 71 73 /** Pointer to be used by the implementation. */ 72 74 void *data; 73 } ;75 } buddy_system_t; 74 76 75 77 extern void buddy_system_create(buddy_system_t *b, uint8_t max_order, -
kernel/generic/include/typedefs.h
re7b7be3f r0f3fc9b 50 50 typedef struct task task_t; 51 51 typedef struct thread thread_t; 52 typedef struct context context_t;53 typedef struct fpu_context fpu_context_t;54 52 55 53 typedef struct spinlock spinlock_t; … … 61 59 typedef struct waitq waitq_t; 62 60 typedef struct futex futex_t; 63 64 typedef struct buddy_system buddy_system_t;65 typedef struct buddy_system_operations buddy_system_operations_t;66 61 67 62 typedef struct as_area as_area_t;
Note:
See TracChangeset
for help on using the changeset viewer.
