Changes in kernel/generic/src/mm/slab.c [ccb426c:7a0359b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/slab.c
rccb426c r7a0359b 177 177 * 178 178 */ 179 static slab_t *slab_space_alloc(slab_cache_t *cache, unsigned int flags) 179 NO_TRACE static slab_t *slab_space_alloc(slab_cache_t *cache, 180 unsigned int flags) 180 181 { 181 182 … … 224 225 * 225 226 */ 226 static size_t slab_space_free(slab_cache_t *cache, slab_t *slab)227 NO_TRACE static size_t slab_space_free(slab_cache_t *cache, slab_t *slab) 227 228 { 228 229 frame_free(KA2PA(slab->start)); … … 236 237 237 238 /** Map object to slab structure */ 238 static slab_t *obj2slab(void *obj)239 NO_TRACE static slab_t *obj2slab(void *obj) 239 240 { 240 241 return (slab_t *) frame_get_parent(ADDR2PFN(KA2PA(obj)), 0); … … 252 253 * 253 254 */ 254 static size_t slab_obj_destroy(slab_cache_t *cache, void *obj, slab_t *slab) 255 NO_TRACE static size_t slab_obj_destroy(slab_cache_t *cache, void *obj, 256 slab_t *slab) 255 257 { 256 258 if (!slab) … … 293 295 * 294 296 */ 295 static void *slab_obj_create(slab_cache_t *cache,int flags)297 NO_TRACE static void *slab_obj_create(slab_cache_t *cache, unsigned int flags) 296 298 { 297 299 spinlock_lock(&cache->slablock); … … 349 351 * 350 352 */ 351 static slab_magazine_t *get_mag_from_cache(slab_cache_t *cache, bool first) 353 NO_TRACE static slab_magazine_t *get_mag_from_cache(slab_cache_t *cache, 354 bool first) 352 355 { 353 356 slab_magazine_t *mag = NULL; … … 373 376 * 374 377 */ 375 static void put_mag_to_cache(slab_cache_t *cache, slab_magazine_t *mag) 378 NO_TRACE static void put_mag_to_cache(slab_cache_t *cache, 379 slab_magazine_t *mag) 376 380 { 377 381 spinlock_lock(&cache->maglock); … … 388 392 * 389 393 */ 390 static size_t magazine_destroy(slab_cache_t *cache, slab_magazine_t *mag) 394 NO_TRACE static size_t magazine_destroy(slab_cache_t *cache, 395 slab_magazine_t *mag) 391 396 { 392 397 size_t i; … … 406 411 * 407 412 */ 408 static slab_magazine_t *get_full_current_mag(slab_cache_t *cache)413 NO_TRACE static slab_magazine_t *get_full_current_mag(slab_cache_t *cache) 409 414 { 410 415 slab_magazine_t *cmag = cache->mag_cache[CPU->id].current; 411 416 slab_magazine_t *lastmag = cache->mag_cache[CPU->id].last; 412 417 413 418 ASSERT(spinlock_locked(&cache->mag_cache[CPU->id].lock)); 414 419 … … 443 448 * 444 449 */ 445 static void *magazine_obj_get(slab_cache_t *cache)450 NO_TRACE static void *magazine_obj_get(slab_cache_t *cache) 446 451 { 447 452 if (!CPU) … … 473 478 * 474 479 */ 475 static slab_magazine_t *make_empty_current_mag(slab_cache_t *cache)480 NO_TRACE static slab_magazine_t *make_empty_current_mag(slab_cache_t *cache) 476 481 { 477 482 slab_magazine_t *cmag = cache->mag_cache[CPU->id].current; … … 479 484 480 485 ASSERT(spinlock_locked(&cache->mag_cache[CPU->id].lock)); 481 486 482 487 if (cmag) { 483 488 if (cmag->busy < cmag->size) … … 523 528 * 524 529 */ 525 static int magazine_obj_put(slab_cache_t *cache, void *obj)530 NO_TRACE static int magazine_obj_put(slab_cache_t *cache, void *obj) 526 531 { 527 532 if (!CPU) … … 552 557 * 553 558 */ 554 static size_t comp_objects(slab_cache_t *cache)559 NO_TRACE static size_t comp_objects(slab_cache_t *cache) 555 560 { 556 561 if (cache->flags & SLAB_CACHE_SLINSIDE) … … 564 569 * 565 570 */ 566 static size_t badness(slab_cache_t *cache)571 NO_TRACE static size_t badness(slab_cache_t *cache) 567 572 { 568 573 size_t objects = comp_objects(cache); … … 578 583 * 579 584 */ 580 static bool make_magcache(slab_cache_t *cache)585 NO_TRACE static bool make_magcache(slab_cache_t *cache) 581 586 { 582 587 ASSERT(_slab_initialized >= 2); … … 600 605 * 601 606 */ 602 static void _slab_cache_create(slab_cache_t *cache, const char *name,607 NO_TRACE static void _slab_cache_create(slab_cache_t *cache, const char *name, 603 608 size_t size, size_t align, int (*constructor)(void *obj, 604 609 unsigned int kmflag), size_t (*destructor)(void *obj), unsigned int flags) … … 676 681 * 677 682 */ 678 static size_t _slab_reclaim(slab_cache_t *cache, unsigned int flags)683 NO_TRACE static size_t _slab_reclaim(slab_cache_t *cache, unsigned int flags) 679 684 { 680 685 if (cache->flags & SLAB_CACHE_NOMAGAZINE) … … 781 786 * 782 787 */ 783 static void _slab_free(slab_cache_t *cache, void *obj, slab_t *slab)788 NO_TRACE static void _slab_free(slab_cache_t *cache, void *obj, slab_t *slab) 784 789 { 785 790 ipl_t ipl = interrupts_disable();
Note:
See TracChangeset
for help on using the changeset viewer.