Index: generic/include/mm/buddy.h
===================================================================
--- generic/include/mm/buddy.h	(revision 93354b06a6ce7c3756530b3c914f438dcc6c091e)
+++ generic/include/mm/buddy.h	(revision 594a4685fd3e8f2a0240297164d050cbcb0f79d9)
@@ -35,10 +35,11 @@
 #define BUDDY_SYSTEM_INNER_BLOCK	0xff
 
+/** Buddy system operations to be implemented by each implementations. */
 struct buddy_system_operations {
-	link_t *(* find_buddy)(link_t *);				/**< Return pointer to left-side or right-side buddy for block passed as argument. */
-	link_t *(* bisect)(link_t *);					/**< Bisect the block passed as argument and return pointer to the new right-side buddy. */
-	link_t *(* coalesce)(link_t *, link_t *);			/**< Coalesce two buddies into a bigger block. */
-	void (*set_order)(link_t *, __u8);				/**< Set order of block passed as argument. */
-	__u8 (*get_order)(link_t *);					/**< Return order of block passed as argument. */
+	link_t *(* find_buddy)(buddy_system_t *, link_t *);		/**< Return pointer to left-side or right-side buddy for block passed as argument. */
+	link_t *(* bisect)(buddy_system_t *, link_t *);			/**< Bisect the block passed as argument and return pointer to the new right-side buddy. */
+	link_t *(* coalesce)(buddy_system_t *, link_t *, link_t *);	/**< Coalesce two buddies into a bigger block. */
+	void (*set_order)(buddy_system_t *, link_t *, __u8);		/**< Set order of block passed as argument. */
+	__u8 (*get_order)(buddy_system_t *, link_t *);			/**< Return order of block passed as argument. */
 };
 
@@ -47,7 +48,8 @@
 	link_t *order;
 	buddy_system_operations_t *op;
+	void *data;				/**< Pointer to be used by the implementation. */
 };
 
-extern buddy_system_t *buddy_system_create(__u8 max_order, buddy_system_operations_t *op);
+extern buddy_system_t *buddy_system_create(__u8 max_order, buddy_system_operations_t *op, void *data);
 extern link_t *buddy_system_alloc(buddy_system_t *b, __u8 i);
 extern void buddy_system_free(buddy_system_t *b, link_t *block);
Index: generic/include/mm/frame.h
===================================================================
--- generic/include/mm/frame.h	(revision 93354b06a6ce7c3756530b3c914f438dcc6c091e)
+++ generic/include/mm/frame.h	(revision 594a4685fd3e8f2a0240297164d050cbcb0f79d9)
@@ -87,9 +87,9 @@
  * Buddy system operations
  */
-link_t * zone_buddy_find_buddy(link_t * buddy);
-link_t * zone_buddy_bisect(link_t * block);
-link_t * zone_buddy_coalesce(link_t * buddy_l, link_t * buddy_r);
-void zone_buddy_set_order(link_t * block, __u8 order);
-__u8 zone_buddy_get_order(link_t * block);
+link_t * zone_buddy_find_buddy(buddy_system_t *b, link_t * buddy);
+link_t * zone_buddy_bisect(buddy_system_t *b, link_t * block);
+link_t * zone_buddy_coalesce(buddy_system_t *b, link_t * buddy_l, link_t * buddy_r);
+void zone_buddy_set_order(buddy_system_t *b, link_t * block, __u8 order);
+__u8 zone_buddy_get_order(buddy_system_t *b, link_t * block);
 
 __address zone_buddy_frame_alloc(int flags, __u8 order);
Index: generic/src/mm/buddy.c
===================================================================
--- generic/src/mm/buddy.c	(revision 93354b06a6ce7c3756530b3c914f438dcc6c091e)
+++ generic/src/mm/buddy.c	(revision 594a4685fd3e8f2a0240297164d050cbcb0f79d9)
@@ -41,8 +41,9 @@
  * @param max_order The biggest allocable size will be 2^max_order.
  * @param op Operations for new buddy system.
+ * @param data Pointer to be used by implentation.
  *
  * @return New buddy system.
  */
-buddy_system_t *buddy_system_create(__u8 max_order, buddy_system_operations_t *op)
+buddy_system_t *buddy_system_create(__u8 max_order, buddy_system_operations_t *op, void *data)
 {
 	buddy_system_t *b;
@@ -77,4 +78,5 @@
 		b->max_order = max_order;
 		b->op = op;
+		b->data = data;
 	}
 	
@@ -131,7 +133,7 @@
 	 * Bisect the block and set order of both of its parts to i.
 	 */
-	hlp = b->op->bisect(res);
-	b->op->set_order(res, i);
-	b->op->set_order(hlp, i);
+	hlp = b->op->bisect(b, res);
+	b->op->set_order(b, res, i);
+	b->op->set_order(b, hlp, i);
 	
 	/*
@@ -159,5 +161,5 @@
 	 * Determine block's order.
 	 */
-	i = b->op->get_order(block);
+	i = b->op->get_order(b, block);
 
 	ASSERT(i < b->max_order);
@@ -167,8 +169,8 @@
 		 * See if there is any buddy in the list of order i.
 		 */
-		buddy = b->op->find_buddy(block);
+		buddy = b->op->find_buddy(b, block);
 		if (buddy) {
 
-			ASSERT(b->op->get_order(buddy) == i);
+			ASSERT(b->op->get_order(b, buddy) == i);
 		
 			/*
@@ -180,16 +182,16 @@
 			 * Invalidate order of both block and buddy.
 			 */
-			b->op->set_order(block, BUDDY_SYSTEM_INNER_BLOCK);
-			b->op->set_order(buddy, BUDDY_SYSTEM_INNER_BLOCK);
+			b->op->set_order(b, block, BUDDY_SYSTEM_INNER_BLOCK);
+			b->op->set_order(b, buddy, BUDDY_SYSTEM_INNER_BLOCK);
 		
 			/*
 			 * Coalesce block and buddy into one block.
 			 */
-			hlp = b->op->coalesce(block, buddy);
+			hlp = b->op->coalesce(b, block, buddy);
 
 			/*
 			 * Set order of the coalesced block to i + 1.
 			 */
-			b->op->set_order(hlp, i + 1);
+			b->op->set_order(b, hlp, i + 1);
 
 			/*
Index: generic/src/mm/frame.c
===================================================================
--- generic/src/mm/frame.c	(revision 93354b06a6ce7c3756530b3c914f438dcc6c091e)
+++ generic/src/mm/frame.c	(revision 594a4685fd3e8f2a0240297164d050cbcb0f79d9)
@@ -339,5 +339,5 @@
 		 */
 		for (max_order = 0; cnt >> max_order; max_order++);
-		z->buddy_system = buddy_system_create(max_order, &zone_buddy_system_operations);
+		z->buddy_system = buddy_system_create(max_order, &zone_buddy_system_operations, (void *) z);
 	}
 	
@@ -544,9 +544,11 @@
 
 /** Buddy system find_buddy implementation
+ *
+ * @param b Buddy system.
  * @param block Block for which buddy should be found
  *
  * @return Buddy for given block if found
  */
-link_t * zone_buddy_find_buddy(link_t * block) {
+link_t * zone_buddy_find_buddy(buddy_system_t *b, link_t * block) {
 	frame_t * frame, * f;
 	zone_t * zone;
@@ -596,9 +598,10 @@
 /** Buddy system bisect implementation
  *
+ * @param b Buddy system.
  * @param block Block to bisect
  *
  * @return right block
  */
-link_t * zone_buddy_bisect(link_t * block) {
+link_t * zone_buddy_bisect(buddy_system_t *b, link_t * block) {
 	frame_t * frame_l, * frame_r;
 	
@@ -613,4 +616,5 @@
 /** Buddy system coalesce implementation
  *
+ * @param b Buddy system.
  * @param block_1 First block
  * @param block_2 First block's buddy
@@ -618,5 +622,5 @@
  * @return Coalesced block (actually block that represents lower address)
  */
-link_t * zone_buddy_coalesce(link_t * block_1, link_t * block_2) {
+link_t * zone_buddy_coalesce(buddy_system_t *b, link_t * block_1, link_t * block_2) {
 	frame_t * frame1, * frame2;
 	
@@ -628,8 +632,10 @@
 
 /** Buddy system set_order implementation
+ *
+ * @param b Buddy system.
  * @param block Buddy system block
  * @param order Order to set
  */
-void zone_buddy_set_order(link_t * block, __u8 order) {
+void zone_buddy_set_order(buddy_system_t *b, link_t * block, __u8 order) {
 	frame_t * frame;
 	frame = list_get_instance(block, frame_t, buddy_link);
@@ -638,9 +644,11 @@
 
 /** Buddy system get_order implementation
+ *
+ * @param b Buddy system.
  * @param block Buddy system block
  *
  * @return Order of block
  */
-__u8 zone_buddy_get_order(link_t * block) {
+__u8 zone_buddy_get_order(buddy_system_t *b, link_t * block) {
 	frame_t * frame;
 	frame = list_get_instance(block, frame_t, buddy_link);
