Subversion Repositories HelenOS

Rev

Rev 3057 | Rev 3180 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3057 Rev 3104
Line 557... Line 557...
557
   
557
   
558
    ASSERT(_slab_initialized >= 2);
558
    ASSERT(_slab_initialized >= 2);
559
 
559
 
560
    cache->mag_cache = malloc(sizeof(slab_mag_cache_t) * config.cpu_count,0);
560
    cache->mag_cache = malloc(sizeof(slab_mag_cache_t) * config.cpu_count,0);
561
    for (i = 0; i < config.cpu_count; i++) {
561
    for (i = 0; i < config.cpu_count; i++) {
562
        memsetb((uintptr_t)&cache->mag_cache[i],
-
 
563
            sizeof(cache->mag_cache[i]), 0);
562
        memsetb(&cache->mag_cache[i], sizeof(cache->mag_cache[i]), 0);
564
        spinlock_initialize(&cache->mag_cache[i].lock, "slab_maglock_cpu");
563
        spinlock_initialize(&cache->mag_cache[i].lock, "slab_maglock_cpu");
565
    }
564
    }
566
}
565
}
567
 
566
 
568
/** Initialize allocated memory as a slab cache */
567
/** Initialize allocated memory as a slab cache */
Line 576... Line 575...
576
           int flags)
575
           int flags)
577
{
576
{
578
    int pages;
577
    int pages;
579
    ipl_t ipl;
578
    ipl_t ipl;
580
 
579
 
581
    memsetb((uintptr_t)cache, sizeof(*cache), 0);
580
    memsetb(cache, sizeof(*cache), 0);
582
    cache->name = name;
581
    cache->name = name;
583
 
582
 
584
    if (align < sizeof(unative_t))
583
    if (align < sizeof(unative_t))
585
        align = sizeof(unative_t);
584
        align = sizeof(unative_t);
586
    size = ALIGN_UP(size, align);
585
    size = ALIGN_UP(size, align);