diff -N -u --recursive linux-2.6.29.2.orig//drivers/base/resource_tracker.c linux//drivers/base/resource_tracker.c
--- linux-2.6.29.2.orig//drivers/base/resource_tracker.c	1970-01-01 01:00:00.000000000 +0100
+++ linux//drivers/base/resource_tracker.c	2009-05-01 11:00:16.000000000 +0200
@@ -0,0 +1,426 @@
+/**{ resource_tracker.c *******************************************************************************************************************
+  *
+  * (c) 2008 Gregor Rébel
+  *
+  * compile: gcc -Wall resource_tracker.c resource_tracker
+  *
+  * resource_tracker provides memory-allocation and automatic -release for other kernel-modules.
+  * Each module needs to acquire an unique owner identification number via rt_create_owner() to be 
+  * able to use the rt_XXX() functions.
+  *
+  * + Features
+  *   - allocate kernel pages and plain memory
+  *   - keeps track of all allocated pages and memories automatically
+  *   - handles memory of different client-modules
+  *   - checks for valid arguments + prints corresponding error-messages
+  *   - one call frees all memory of one client-module
+  *   - reentrant code
+  *
+  * + Note
+  *   This source code makes use of text folding. This is a feature being provided by certain 
+  *   text editors to improve readability by collapsing marked sections of text into one line. 
+  *   It allows e.g. to oversee all function declarations of a file on one page. The user then 
+  *   may open all folds of interest.  
+  *   Folds can be nested like brackets. Inside the fold of a function one may find further 
+  *   fold levels for if..else clauses or logically grouped lines of code.
+  *   Several text editors provide the folding feature like jEdit or kate.
+  *   Kate is able to use most folding marks in this source. jEdit is able to make full use of 
+  *   them by use of its module "configurable fold handler". Just configure { and } as fold 
+  *   start- and end-mark.
+  *
+  *   Beside of this, the source should be readable with any text editor.
+  *
+}**/
+
+#include <linux/resource_tracker.h>
+
+/**{ Example                                                                                                                               
+
+   unsigned int rtID;
+   
+   char *hello(void) {                                                                                                                     
+     static char* Buffer = NULL;
+     
+     if (!Buffer) rt_kmalloc0(OwnerID, 10000, GFP_KERNEL, (void**) &Buffer, "Buffer");
+     sprintf(Buffer, "Hello World");
+     
+     return Buffer;
+   }
+   
+   static int m_init(void) {                                                                                                               
+     rtID = rt_create_owner("TestModuleXYZ"); // will return same ID as before in case this module has been loaded earlier
+     printk( hello() );                       // allocates zeroed memory block "Buffer"
+     rt_free_resources(rtID);                 // will free memory block "Buffer" + resets variable Buffer to NULL
+     printk( hello() );                       // automatically reallocates zeroed memory block "Buffer"
+     return 0;
+   }
+   
+   static void m_exit(void) {
+     ...
+     rt_free_resources(rtID);                 // free all resources being allocated by this module during its lifetime
+   }
+}**/
+//{ Module Parameters                                                                                                                      
+
+  // descriptions to be found inside print_help()  
+  static unsigned int  debug_level  = 2;
+
+//}
+//{ Global Variables                                                                                                                       
+
+static           int ErrorStatus        = 0;          // == 0: everything OK; < 0: error-number
+static unsigned char BuffersInitialized = 0;          // == 1: buffers have been initialized
+static unsigned  int rt_OwnerID        = 0;          // owner identification number of resource_tracker
+static unsigned  int AmountPageDatas    = 0;          // first index after last valid entry inside PageDatas[]
+static unsigned  int AmountFreeEntries  = 0;          // amount of valid entries inside FreeEntries[]
+static unsigned  int AmountOwners       = 0;          // amount of valid entries inside Owners[]
+static rt_PageData  PageDatas[rt_MAX_ALLOCATIONS];  // logical start-address of all allocated page-blocks (ToDo: dynamic resizable buffer)
+static unsigned  int FreeEntries[rt_MAX_ALLOCATIONS];// list of indices of free entries inside PageDatas[]
+static         char* Owners[rt_MAX_OWNERS];          // names of memory owners (-> rt_create_owner())
+
+//}Global Variables
+//{ private Functions                                                                                                                      
+
+//{ print_help()                                        help-text for this module                                                          
+void print_help(void) {                                                                                                                    
+
+  printk(KERN_ALERT "resource_tracker.ko - help --------------------------------------------------------------\n");
+  printk(KERN_ALERT "\n");
+  printk(KERN_ALERT "E.g.:\n");
+  printk(KERN_ALERT "\n");
+  printk(KERN_ALERT "COMMON ARGUMENTS:\n");
+  printk(KERN_ALERT "  debug_level               =0: no debug-, =1: some debug-, =2: more debug-messages\n");
+  printk(KERN_ALERT "--------------------------------------------------------------------------------------------\n");
+}
+//}print_help()
+//{ tidy_up()                                           prepare module for first instanciation or exit                                     
+void tidy_up(void) {                                                                                                                        
+  
+    //X AmountFreeEntries = 0;
+    if (debug_level > 1) printk(KERN_ALERT "KRT: tidy_up() - finished.\n");
+
+} //tidy_up()
+//}tidy_up()
+
+//{ checkOwnerIdValid()                                 check if given owner identification number is valid                                
+int checkOwnerIdValid(unsigned int Owner) {                                                                                                
+    
+    if ( unlikely(Owner > rt_MAX_OWNERS) ) {        // illegal value: return 0                                                            
+      printk(KERN_ALERT "KRT: rt_pages_allocate() - ERROR: Got illegal value Owner=%i > rt_MAX_OWNERS!\n", Owner);
+      return 0;
+    }
+    if ( unlikely(Owners[Owner] == NULL) ) {         // no valid string found under given index                                            
+      printk(KERN_ALERT "KRT: rt_pages_allocate() - ERROR: No name registered under given Owner=%i!\n", Owner);
+      return 0;
+    }
+    
+    return 1;                                        // given Owner seems to be valid
+}
+//}checkOwnerIdValid()
+//{ initializeBuffers()                                 initialize internal buffers (call before any other function)                       
+void initializeBuffers(void) {                                                                                                             
+    if (!BuffersInitialized) {                       // first call: initialize buffers                                                     
+      if (debug_level > 0) printk(KERN_ALERT "KRT: initializing buffers\n");
+      
+      // clear arrays..
+      memset(PageDatas, 0, sizeof(rt_PageData)    * rt_MAX_ALLOCATIONS);
+      memset(Owners, 0, sizeof(char*)             * rt_MAX_OWNERS);
+      memset(FreeEntries, 0, sizeof(unsigned int) * rt_MAX_ALLOCATIONS);
+      
+                   rt_create_owner("illegal owner"); // create owner id 0
+      rt_OwnerID = rt_create_owner("KMM");           // create owner id 1
+      
+      BuffersInitialized = 1;
+    }
+}
+//}initializeBuffers()
+//{ rt_free()                                           frees one block of memory without any checks                                       
+void rt_free(unsigned long Address, unsigned long Size, unsigned int Index) {                                                           
+    
+    if (debug_level > 1) printk( KERN_ALERT "KRT:   freeing memory @[%i] vaddr=0x%lx (MFN=0x%lx Size=%li)\n", //{                          
+                                 Index,
+                                 Address, 
+                                 vaddr2mfn((void *) Address),
+                                 Size
+                               ); //}
+    kfree( (void*) Address);
+}
+//}rt_free()
+//{ m_init()                                            module-load                                                                        
+static int m_init(void) {                                                                                                                  
+  
+    if (debug_level > 0) printk(KERN_ALERT "KRT: loading module\n");
+    initializeBuffers();
+    //{ local variables..                                                                                                                  
+    
+    //}
+    tidy_up();                                        // prepare memory-buffers
+    
+    //...
+    
+    if (ErrorStatus) {                               // something weird happened: tidy up + return error                                   
+      tidy_up();
+      return ErrorStatus;
+    }
+    return 0;                                        // module loaded successfully
+} //m_init()
+//}m_init()
+//{ m_exit()                                            module-unload                                                                      
+static void m_exit(void) {                                                                                                                 
+  
+  tidy_up();
+  rt_free_resources(0);                               // free all dynamic memories
+  if (debug_level > 0) printk(KERN_ALERT "KRT: module unloaded.\n");
+
+}
+//}m_exit()
+
+//}private Functions
+//{ exported functions                                                                                                                     
+
+//{ rt_create_owner()                                  registers given string as new memory-owner; returns corresponding owner-id          
+//
+// @Owner:    unique name identifying registrator (each module using resource_tracker.ko is one owner)
+// @return:   each Owner-string gets its own unique identification number to be used for all further function-calls
+//
+unsigned int rt_create_owner(char* Owner) {                                                                                                
+    unsigned int Index = 0;
+    unsigned int FoundIndex = 0;
+    int Compare = 1;
+    if (debug_level > 1) printk(KERN_ALERT "KRT: rt_create_owner(%s)\n", Owner);
+    if ( (Owner == NULL) || (*Owner == 0) ) {        // invalid value for Owner: ERROR + return 0                                          
+      printk(KERN_ALERT "KRT: rt_create_owner(0x%lx) - ERROR: Got invalid argument for Owner (provide non empty string)!\n", (unsigned long) Owner);
+      return 0;
+    }
+    
+    if (Owners[Index])  Compare = strcmp(Owner, Owners[Index]);
+    while ( (Index < AmountOwners) && Compare ) {    // search given Owner in list of all owners                                           
+      if (Owners[Index] != NULL) {                                                                                                         
+        Compare = strcmp(Owner, Owners[Index]);
+        FoundIndex = Index;
+      }
+      Index++;
+    }
+    if (Compare == 0) {                              // Owner has already registered earlier: return its id                                
+      if (debug_level > 0) printk(KERN_ALERT "KRT: rt_create_owner(%s): old owner #%i\n", Owner, FoundIndex);
+      return(FoundIndex);
+    }
+    else {                                           // Owner not found in list: create new owner                                          
+      if (AmountOwners < 2)                          // first two registrations must be from ourself!
+        Owners[AmountOwners] = Owner;                // string is stored in our own stack: simply reference it
+      else {                                         // string is stored in stack of other module: copy it into dynamic memory
+        Owners[AmountOwners] = (char*) rt_kmalloc0(1, strlen(Owner) + 1, GFP_KERNEL, NULL, Owner);
+        strcpy(Owners[AmountOwners], Owner);
+      }
+      if (debug_level > 0) printk(KERN_ALERT "KRT: rt_create_owner(%s): new owner #%i\n", Owner, AmountOwners);
+      return(AmountOwners++);
+    }
+}
+EXPORT_SYMBOL_GPL(rt_create_owner);
+//}rt_create_owner()
+//{ rt_free_resources()                                free all kernel memories allocated by given owner                                   
+//
+// @Owner:  unique identification number of owner of memories to be freed as returned by rt_create_owner()
+//          == 0: free memories of all owners
+//
+void rt_free_resources(unsigned int Owner) {                                                                                               
+    
+    unsigned int Index = 0;
+    struct page* Page;
+    rt_PageData* PageData;
+    
+    if ( checkOwnerIdValid(Owner) ) {                // valid value: free memories                                                         
+      if (debug_level > 0) printk(KERN_ALERT "KRT: rt_free_resources(Owner=%i='%s')..\n", Owner, Owners[Owner]);
+      for (Index = 0; Index < AmountPageDatas; Index++) { // free all allocated memory-pages belonging to given owner                      
+        PageData = PageDatas + Index;
+        if (PageData->LogicalAddress != 0)           // slot is being used +
+          if ( (PageData->Owner==Owner) || (Owner==rt_OwnerID) ) { // Owner matches or Owner is ourself: free this page                     
+            if (PageData->Size >= 0) {               // page-allocation: free via __free_pages()                                           
+              Page = virt_to_page(PageData->LogicalAddress);
+        
+              if (debug_level > 1) printk( KERN_ALERT "KRT:   freeing pages @[%i] vaddr=0x%lx (MFN=0x%lx Order=%i)\n", //{                 
+                                           Index,
+                                           PageData->LogicalAddress, 
+                                           vaddr2mfn((void *) PageData->LogicalAddress),
+                                           (unsigned int) PageData->Size
+                                         ); //}
+              __free_pages(Page, PageData->Size);
+            }
+            else {                                   // memory-allocation: free via kfree()                                                
+              unsigned long Size = (unsigned long) 0 - PageData->Size;
+              rt_free(PageData->LogicalAddress, Size, Index);
+            }
+            PageData->LogicalAddress = 0;
+            if (PageData->Pointer)  *(PageData->Pointer) = NULL;
+            FreeEntries[AmountFreeEntries++] = Index;// record this index as being free for allocations
+          }
+      }
+      if (debug_level > 1) printk(KERN_ALERT "KRT: rt_free_resources() - finished.\n");
+    }
+}
+EXPORT_SYMBOL_GPL(rt_free_resources);
+//}rt_free_resources()
+//{ rt_pages_allocate()                                allocate given amount of memory pages                                               
+unsigned long rt_pages_allocate(unsigned int Owner, unsigned int Order, unsigned char* Purpose) {                                          
+    unsigned long LogicalStartAddress = 0;
+    unsigned  int NewEntryIndex;
+    
+    if (! checkOwnerIdValid(Owner) ) {               // illegal value: return 0                                                            
+      ErrorStatus = -ENOMEM;
+      return 0;
+    }
+    if (AmountPageDatas - AmountFreeEntries >= rt_MAX_ALLOCATIONS) { // limit reached: printk + set ErrorStatus + return 0                 
+      printk(KERN_ALERT "KRT: rt_pages_allocate(Owner=%i (%s) Order=%i) - ERROR: amount of memory allocations reached its limit (%i) - Increase value of rt_MAX_ALLOCATIONS!\n",
+                        Owner, Owners[Owner], Order, rt_MAX_ALLOCATIONS
+            );
+      ErrorStatus = -ENOMEM;
+      return 0;
+    }
+    
+    if (AmountFreeEntries > 0) NewEntryIndex = FreeEntries[--AmountFreeEntries];
+    else                       NewEntryIndex = AmountPageDatas++;
+
+    if ( (debug_level > 0) && (NewEntryIndex > 0) )  // display every allocation but the first one to avoid error like printk
+      printk(KERN_ALERT "KRT: %s allocates pages of order=%i for '%s' @[%i]\n", Owners[Owner], Order, Purpose, NewEntryIndex);
+    LogicalStartAddress = __get_free_pages(GFP_KERNEL | __GFP_ZERO, Order);
+    if ( unlikely(LogicalStartAddress == 0) ) {      // got no memory: printk + set ErrorStatus + return 0                                 
+      printk(KERN_ALERT "KRT: ERROR - could not allocate memory page!\n");
+      ErrorStatus = -ENOMEM;
+      return 0;
+    }
+    
+    PageDatas[NewEntryIndex].LogicalAddress = LogicalStartAddress;
+    PageDatas[NewEntryIndex].Size           = (long) Order;
+    PageDatas[NewEntryIndex].Owner          = Owner;
+    
+    return(LogicalStartAddress);
+}
+EXPORT_SYMBOL_GPL(rt_pages_allocate);
+//}rt_pages_allocate()
+//{ rt_kmalloc()                                       allocate given amount of memory via kmalloc()                                       
+//
+// @Owner:   owner-id as being returned by rt_create_owner() earlier
+// @Size:    amount of bytes to allocate
+// @Flags:   kmalloc flags like GFP_KERNEL, GFP_ATOMIC, GFP_USER, ...
+// @Pointer: !=NULL: variable will be loaded with start address of allocated memory (NULL in case of error)
+//                   Pointer will be stored and reset to NULL automatically by rt_free_resources().
+//                   This allows to allocate memory in static function variables without having to  
+//                   worry about deallocation or even reallocation any more.
+//           ==NULL: feature disabled
+// @Purpose: used in debug messages to identify individual memory allocations 
+//
+unsigned long rt_kmalloc(unsigned int Owner, size_t Size, int Flags, void** Pointer, unsigned char* Purpose) {                              
+    unsigned long LogicalStartAddress = 0;
+    unsigned  int NewEntryIndex;
+    
+    if ( unlikely(Size==0) ) {                       // return NULL                                                                        
+      if ( unlikely(debug_level > 0) )  printk( KERN_ALERT "KRT: %s wants to allocate 0 bytes for '%s'\n", //{                             
+                                                Owners[Owner], 
+                                                Purpose 
+                                              ); //}
+      return 0;
+    }
+    
+    if ( unlikely(! checkOwnerIdValid(Owner) ) ) {                                // illegal value: return 0                                                            
+      ErrorStatus = -ENOMEM;
+      return 0;
+    }
+    if ( unlikely( (Size==0) || (Size > 1<<31) ) ) {                              // illegal value: return 0                                                            
+      printk(KERN_ALERT "KRT: rt_kmalloc(Owner=%i (%s) Size=%li for '%s') - ERROR: Illegal argument Size (0 < Size < 1<<31)!\n", //{            
+                        Owner, 
+                        Owners[Owner], 
+                        (unsigned long) Size, 
+                        Purpose
+             ); //}
+      ErrorStatus = -ENOMEM;
+      return 0;
+    }
+    if ( unlikely(AmountPageDatas - AmountFreeEntries >= rt_MAX_ALLOCATIONS) ) { // limit reached: printk + set ErrorStatus + return 0    
+      printk(KERN_ALERT "KRT: rt_kmalloc(Owner=%i (%s) Size=%li for '%s') - ERROR: amount of memory allocations reached its limit (%i) - Increase value of rt_MAX_ALLOCATIONS!\n", //{
+                        Owner, 
+                        Owners[Owner], 
+                        (unsigned long) Size, 
+                        Purpose,
+                        rt_MAX_ALLOCATIONS
+             ); //}
+      ErrorStatus = -ENOMEM;
+      return 0;
+    }
+    
+    if (AmountFreeEntries > 0) NewEntryIndex = FreeEntries[--AmountFreeEntries];
+    else                       NewEntryIndex = AmountPageDatas++;
+
+    if ( unlikely(debug_level > 0) )  printk( KERN_ALERT "KRT: %s allocates %li bytes for '%s' @[%i]\n", //{                               
+                                              Owners[Owner], 
+                                              (unsigned long) Size, 
+                                              Purpose, 
+                                              NewEntryIndex
+                                            ); //}
+    LogicalStartAddress = (unsigned long) kmalloc(Size, Flags);
+    if ( unlikely(LogicalStartAddress == 0) ) {      // got no memory: printk + set ErrorStatus + return 0                                 
+      printk(KERN_ALERT "KRT: ERROR - could not allocate %li bytes of memory!\n", (unsigned long)  Size);
+      ErrorStatus = -ENOMEM;
+      return 0;
+    }
+    
+    PageDatas[NewEntryIndex].LogicalAddress = LogicalStartAddress;
+    PageDatas[NewEntryIndex].Size           = -Size; // negative values mean 
+    PageDatas[NewEntryIndex].Owner          = Owner;
+    PageDatas[NewEntryIndex].Pointer        = Pointer;
+    
+    if (Pointer)  *Pointer = (void*) LogicalStartAddress;
+    return(LogicalStartAddress);
+}
+EXPORT_SYMBOL_GPL(rt_kmalloc);
+//}rt_kmalloc()
+//{ rt_kmalloc0()                                      allocate given amount of memory via kmalloc() + zero it                             
+unsigned long rt_kmalloc0(unsigned int Owner, size_t Size, int Flags, void** Pointer, unsigned char* Purpose) {                            
+    unsigned long LogicalStartAddress = rt_kmalloc(Owner, Size, Flags, Pointer, Purpose);
+    
+    if (LogicalStartAddress)
+      memset( (void*) LogicalStartAddress, 0, Size );
+
+    return(LogicalStartAddress);
+}
+EXPORT_SYMBOL_GPL(rt_kmalloc0);
+//}rt_kmalloc0()
+//{ rt_kfree()                                         frees one memory block being allocated by rt_kmalloc() or rt_kmalloc0()             
+void rt_kfree(unsigned int Owner, unsigned long Address) {                                                                                 
+    unsigned int Index = 0;
+    rt_PageData* PageData;
+    
+    if ( checkOwnerIdValid(Owner) ) {                              // valid owner: free memories                                           
+      for (Index = 0; Index < AmountPageDatas; Index++) {          // find corresponding page data struct + free it                        
+        PageData = PageDatas + Index;
+        if (PageData->LogicalAddress == Address)                   // address found +
+          if ( (PageData->Owner==Owner) || (Owner==rt_OwnerID) ) { // Owner matches or Owner is ourself: free this page                    
+            if (PageData->Size < 0) {                              // memory-allocation found: free this block                             
+              unsigned long Size = (unsigned long) 0 - PageData->Size;
+              rt_free(PageData->LogicalAddress, Size, Index);
+              PageData->LogicalAddress = 0;
+              if (PageData->Pointer)  *(PageData->Pointer) = NULL;
+              FreeEntries[AmountFreeEntries++] = Index;            // record this index as being free for allocations
+            }
+            else {                                                 // allocation type mismatches: yell error                               
+              printk(KERN_ALERT "KRT: rt_kfree(Owner=%i='%s', Address=0x%lx) - ERROR: block to bee freed is no memory range but allocated pages!\n", Owner, Owners[Owner], Address);
+            }
+          }
+      }
+      if (debug_level > 0) printk(KERN_ALERT "KRT: rt_kfree(Owner=%i='%s', Address=0x%lx)..\n", Owner, Owners[Owner], Address);
+    }
+}
+EXPORT_SYMBOL_GPL(rt_kfree);
+//}rt_kfree()
+
+//}exported functions
+//{ register this source as a kernel module                                                                                                
+
+module_init(m_init);
+module_exit(m_exit);
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Gregor Rebel");
+
+// Current values of parameters to be found inside /sys/module/resource_tracker/parameters/
+module_param(debug_level, uint, 0644);
+
+//}
diff -N -u --recursive linux-2.6.29.2.orig//include/linux/resource_tracker.h linux//include/linux/resource_tracker.h
--- linux-2.6.29.2.orig//include/linux/resource_tracker.h	1970-01-01 01:00:00.000000000 +0100
+++ linux//include/linux/resource_tracker.h	2009-05-01 11:00:40.000000000 +0200
@@ -0,0 +1,87 @@
+/**{ resource_tracker.h *******************************************************************************************************************
+  *
+  * (c) 2008 Gregor Rébel
+  *
+  * compile: gcc -Wall sm_nic.c sm_nic
+  *
+  * + Note
+  *   This source code makes use of text folding. This is a feature being provided by certain 
+  *   text editors to improve readability by collapsing marked sections of text into one line. 
+  *   It allows e.g. to oversee all function declarations of a file on one page. The user then 
+  *   may open all folds of interest.  
+  *   Folds can be nested like brackets. Inside the fold of a function one may find further 
+  *   fold levels for if..else clauses or logically grouped lines of code.
+  *   Several text editors provide the folding feature like jEdit or kate.
+  *   Kate is able to use most folding marks in this source. jEdit is able to make full use of 
+  *   them by use of its module "configurable fold handler". Just configure { and } as fold 
+  *   start- and end-mark.
+  *
+  *   Beside of this, the source should be readable with any text editor.
+  *
+}**/
+
+#ifndef KERNEL_MEMORY_MANAGER_H
+#define KERNEL_MEMORY_MANAGER_H
+
+//{ Includes                                                                                                                               
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <asm-x86/mach-xen/asm/pgtable.h> // virt_to_page(), struct page
+
+//}Includes
+//{ Global Constants                                                                                                                       
+
+#ifndef rt_MAX_ALLOCATIONS
+#define rt_MAX_ALLOCATIONS  100                     // maximum allowed amount of page allocations (-> pages_Allocate() ) ToDo: make it dynamic!
+#endif
+
+#ifndef rt_MAX_OWNERS
+#define rt_MAX_OWNERS 10                            // maximum allowed amount of memory-owners (-> rt_create_owner() )   ToDo: make it dynamic!                         
+#endif
+
+//}
+//{ Structure-definitions                                                                                                                  
+
+typedef struct { // rt_PageData                         registration data of one memory page                                               
+  unsigned int    Owner;                             // unique number identifying application which has allocated this memory pages
+  unsigned long   LogicalAddress;                    // kernel logical start-address of allocate block of pages
+           void** Pointer;                           // points to variable that stores address of this block (or NULL)
+           long   Size;                              // >=0: order of this page-allocation (AmounOfPages = 1 << Order)
+                                                     //  <0: -1 * size of this memory-allocation in bytes
+} rt_PageData;
+
+//}Structure-definitions
+//{ inline functions                                                                                                                       
+  
+//{ vaddr2pfn()                                         convert user virtual address to page frame number                                  
+inline unsigned long vaddr2pfn(void *KernelLogicalAddress) {                                                                               
+  struct page* Page = virt_to_page(KernelLogicalAddress);
+  
+  return page_to_pfn(Page);
+} //vaddr2pfn()
+//}vaddr2pfn()
+//{ vaddr2mfn()                                         convert user virtual address to machine frame number                               
+inline unsigned long vaddr2mfn(void *KernelLogicalAddress) {                                                                               
+  struct page* Page = virt_to_page(KernelLogicalAddress);
+  
+  return pfn_to_mfn( page_to_pfn(Page) );
+} //vaddr2mfn()
+//}vaddr2mfn()
+
+//}inline
+//{ Prototypes                                                                                                                             
+
+          void initializeBuffers(void);
+  unsigned int rt_create_owner(char* Owner);
+          void rt_free_resources(unsigned int Owner);
+ unsigned long rt_pages_allocate(unsigned int Owner, unsigned int Order, unsigned char* Purpose);
+ unsigned long rt_kmalloc(unsigned int Owner, size_t Size, int Flags, void** Pointer, unsigned char* Purpose);
+ unsigned long rt_kmalloc0(unsigned int Owner, size_t Size, int Flags, void** Pointer, unsigned char* Purpose);
+          void rt_kfree(unsigned int Owner, unsigned long Address);
+          void rt_free(unsigned long Address, unsigned long Size, unsigned int Index);
+ 
+//}Prototypes
+
+#endif
