Rev 1766 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1766 | Rev 1780 | ||
---|---|---|---|
Line 547... | Line 547... | ||
547 | 547 | ||
548 | ASSERT(_slab_initialized >= 2); |
548 | ASSERT(_slab_initialized >= 2); |
549 | 549 | ||
550 | cache->mag_cache = malloc(sizeof(slab_mag_cache_t)*config.cpu_count,0); |
550 | cache->mag_cache = malloc(sizeof(slab_mag_cache_t)*config.cpu_count,0); |
551 | for (i=0; i < config.cpu_count; i++) { |
551 | for (i=0; i < config.cpu_count; i++) { |
552 | memsetb((__address)&cache->mag_cache[i], |
552 | memsetb((uintptr_t)&cache->mag_cache[i], |
553 | sizeof(cache->mag_cache[i]), 0); |
553 | sizeof(cache->mag_cache[i]), 0); |
554 | spinlock_initialize(&cache->mag_cache[i].lock, |
554 | spinlock_initialize(&cache->mag_cache[i].lock, |
555 | "slab_maglock_cpu"); |
555 | "slab_maglock_cpu"); |
556 | } |
556 | } |
557 | } |
557 | } |
Line 567... | Line 567... | ||
567 | int flags) |
567 | int flags) |
568 | { |
568 | { |
569 | int pages; |
569 | int pages; |
570 | ipl_t ipl; |
570 | ipl_t ipl; |
571 | 571 | ||
572 | memsetb((__address)cache, sizeof(*cache), 0); |
572 | memsetb((uintptr_t)cache, sizeof(*cache), 0); |
573 | cache->name = name; |
573 | cache->name = name; |
574 | 574 | ||
575 | if (align < sizeof(__native)) |
575 | if (align < sizeof(unative_t)) |
576 | align = sizeof(__native); |
576 | align = sizeof(unative_t); |
577 | size = ALIGN_UP(size, align); |
577 | size = ALIGN_UP(size, align); |
578 | 578 | ||
579 | cache->size = size; |
579 | cache->size = size; |
580 | 580 | ||
581 | cache->constructor = constructor; |
581 | cache->constructor = constructor; |
Line 818... | Line 818... | ||
818 | 818 | ||
819 | /* Initialize magazine cache */ |
819 | /* Initialize magazine cache */ |
820 | _slab_cache_create(&mag_cache, |
820 | _slab_cache_create(&mag_cache, |
821 | "slab_magazine", |
821 | "slab_magazine", |
822 | sizeof(slab_magazine_t)+SLAB_MAG_SIZE*sizeof(void*), |
822 | sizeof(slab_magazine_t)+SLAB_MAG_SIZE*sizeof(void*), |
823 | sizeof(__address), |
823 | sizeof(uintptr_t), |
824 | NULL, NULL, |
824 | NULL, NULL, |
825 | SLAB_CACHE_NOMAGAZINE | SLAB_CACHE_SLINSIDE); |
825 | SLAB_CACHE_NOMAGAZINE | SLAB_CACHE_SLINSIDE); |
826 | /* Initialize slab_cache cache */ |
826 | /* Initialize slab_cache cache */ |
827 | _slab_cache_create(&slab_cache_cache, |
827 | _slab_cache_create(&slab_cache_cache, |
828 | "slab_cache", |
828 | "slab_cache", |
829 | sizeof(slab_cache_cache), |
829 | sizeof(slab_cache_cache), |
830 | sizeof(__address), |
830 | sizeof(uintptr_t), |
831 | NULL, NULL, |
831 | NULL, NULL, |
832 | SLAB_CACHE_NOMAGAZINE | SLAB_CACHE_SLINSIDE); |
832 | SLAB_CACHE_NOMAGAZINE | SLAB_CACHE_SLINSIDE); |
833 | /* Initialize external slab cache */ |
833 | /* Initialize external slab cache */ |
834 | slab_extern_cache = slab_cache_create("slab_extern", |
834 | slab_extern_cache = slab_cache_create("slab_extern", |
835 | sizeof(slab_t), |
835 | sizeof(slab_t), |