Show
Ignore:
Timestamp:
05/24/08 09:55:50 (6 months ago)
Author:
mwhitworth
Message:

Update build process.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/hybrid/memory/slab.c

    r495 r541  
    2222#include <error.h> 
    2323#include <i386/i386.h> 
     24#include <imports.h> 
    2425 
    2526/*  
     
    9798        if (i == count(cacheSizes)) /* Too big */ 
    9899        { 
    99                 printf("malloc(%u) failed\n",size); 
     100                KePrint("malloc(%u) failed\n",size); 
    100101                IrqRestoreFlags(flags); 
    101102                return NULL; 
     
    165166 
    166167/* FIXME! */ 
    167         printf("free did not free %#X (from %#X)\n",p,__builtin_return_address(0)); 
     168        KePrint("free did not free %#X (from %#X)\n",p,__builtin_return_address(0)); 
    168169        cli(); hlt(); 
    169170} 
     
    326327        } 
    327328 
    328         printf("MemCacheAlloc(%#X) - failed to allocate memory\n",cache); 
     329        KePrint("MemCacheAlloc(%#X) - failed to allocate memory\n",cache); 
    329330        IrqRestoreFlags(flags); 
    330331        /* Shouldn't get here, as all memory requests should be satifisted by adding slabs */ 
     
    413414SYMBOL_EXPORT(MemCacheCreate); 
    414415 
     416DWORD functions[]= 
     417{ 
     418        (DWORD)malloc, 
     419        (DWORD)free, 
     420        (DWORD)MemCacheCreate, 
     421        (DWORD)MemCacheAlloc, 
     422        (DWORD)MemCacheFree, 
     423}; 
     424 
    415425int SlabInit() 
    416426{ 
     
    418428 
    419429        /* Set up the cache cache */ 
    420         ListAdd(&cacheList,&cacheCache.list); 
     430        ListAdd(&cacheList, &cacheCache.list); 
    421431 
    422432        /* Now start allocating caches */ 
     
    430440                if (!cacheSizes[i].cache) 
    431441                { 
    432                         printf("Malloc slab allocation failed!\n"); 
     442                        KePrint("Malloc slab allocation failed!\n"); 
    433443                        return -ENOMEM; 
    434444                } 
    435445        } 
    436446 
     447        ResolveSetMemFunctions(functions); 
     448 
    437449        return 0; 
    438450} 
     451 
     452ModuleInit(SlabInit);