172,7 → 172,7 |
void *data; |
slab_t *slab; |
size_t fsize; |
int i; |
unsigned int i; |
unsigned int zone = 0; |
|
data = frame_alloc_generic(cache->order, FRAME_KA | flags, &zone); |
191,7 → 191,7 |
} |
|
/* Fill in slab structures */ |
for (i=0; i < (1 << cache->order); i++) |
for (i = 0; i < ((unsigned int) 1 << cache->order); i++) |
frame_set_parent(ADDR2PFN(KA2PA(data))+i, slab, zone); |
|
slab->start = data; |
371,7 → 371,7 |
static count_t magazine_destroy(slab_cache_t *cache, |
slab_magazine_t *mag) |
{ |
int i; |
unsigned int i; |
count_t frames = 0; |
|
for (i=0;i < mag->busy; i++) { |
527,7 → 527,7 |
/* Slab cache functions */ |
|
/** Return number of objects that fit in certain cache size */ |
static int comp_objects(slab_cache_t *cache) |
static unsigned int comp_objects(slab_cache_t *cache) |
{ |
if (cache->flags & SLAB_CACHE_SLINSIDE) |
return ((PAGE_SIZE << cache->order) - sizeof(slab_t)) / cache->size; |
536,10 → 536,10 |
} |
|
/** Return wasted space in slab */ |
static int badness(slab_cache_t *cache) |
static unsigned int badness(slab_cache_t *cache) |
{ |
int objects; |
int ssize; |
unsigned int objects; |
unsigned int ssize; |
|
objects = comp_objects(cache); |
ssize = PAGE_SIZE << cache->order; |
553,7 → 553,7 |
*/ |
static void make_magcache(slab_cache_t *cache) |
{ |
int i; |
unsigned int i; |
|
ASSERT(_slab_initialized >= 2); |
|
561,8 → 561,7 |
for (i=0; i < config.cpu_count; i++) { |
memsetb((uintptr_t)&cache->mag_cache[i], |
sizeof(cache->mag_cache[i]), 0); |
spinlock_initialize(&cache->mag_cache[i].lock, |
"slab_maglock_cpu"); |
spinlock_initialize(&cache->mag_cache[i].lock, "slab_maglock_cpu"); |
} |
} |
|
654,7 → 653,7 |
*/ |
static count_t _slab_reclaim(slab_cache_t *cache, int flags) |
{ |
int i; |
unsigned int i; |
slab_magazine_t *mag; |
count_t frames = 0; |
int magcount; |