Changeset 6b6626d3 in mainline
- Timestamp:
- 2010-04-28T19:45:46Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6e121b8
- Parents:
- a3900cc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/sysinfo/sysinfo.c
ra3900cc r6b6626d3 37 37 #include <print.h> 38 38 #include <syscall/copy.h> 39 #include <synch/ spinlock.h>39 #include <synch/mutex.h> 40 40 #include <arch/asm.h> 41 41 #include <errno.h> … … 52 52 static slab_cache_t *sysinfo_item_slab; 53 53 54 /** Sysinfo spinlock */55 SPINLOCK_STATIC_INITIALIZE_NAME(sysinfo_lock, "sysinfo_lock");54 /** Sysinfo lock */ 55 static mutex_t sysinfo_lock; 56 56 57 57 /** Sysinfo item constructor … … 98 98 sizeof(sysinfo_item_t), 0, sysinfo_item_constructor, 99 99 sysinfo_item_destructor, SLAB_CACHE_MAGDEFERRED); 100 101 mutex_initialize(&sysinfo_lock, MUTEX_ACTIVE); 100 102 } 101 103 … … 300 302 /* Protect sysinfo tree consistency */ 301 303 ipl_t ipl = interrupts_disable(); 302 spinlock_lock(&sysinfo_lock);304 mutex_lock(&sysinfo_lock); 303 305 304 306 if (root == NULL) … … 311 313 } 312 314 313 spinlock_unlock(&sysinfo_lock);315 mutex_unlock(&sysinfo_lock); 314 316 interrupts_restore(ipl); 315 317 } … … 333 335 /* Protect sysinfo tree consistency */ 334 336 ipl_t ipl = interrupts_disable(); 335 spinlock_lock(&sysinfo_lock);337 mutex_lock(&sysinfo_lock); 336 338 337 339 if (root == NULL) … … 345 347 } 346 348 347 spinlock_unlock(&sysinfo_lock);349 mutex_unlock(&sysinfo_lock); 348 350 interrupts_restore(ipl); 349 351 } … … 362 364 /* Protect sysinfo tree consistency */ 363 365 ipl_t ipl = interrupts_disable(); 364 spinlock_lock(&sysinfo_lock);366 mutex_lock(&sysinfo_lock); 365 367 366 368 if (root == NULL) … … 373 375 } 374 376 375 spinlock_unlock(&sysinfo_lock);377 mutex_unlock(&sysinfo_lock); 376 378 interrupts_restore(ipl); 377 379 } … … 395 397 /* Protect sysinfo tree consistency */ 396 398 ipl_t ipl = interrupts_disable(); 397 spinlock_lock(&sysinfo_lock);399 mutex_lock(&sysinfo_lock); 398 400 399 401 if (root == NULL) … … 406 408 } 407 409 408 spinlock_unlock(&sysinfo_lock);410 mutex_unlock(&sysinfo_lock); 409 411 interrupts_restore(ipl); 410 412 } … … 421 423 /* Protect sysinfo tree consistency */ 422 424 ipl_t ipl = interrupts_disable(); 423 spinlock_lock(&sysinfo_lock);425 mutex_lock(&sysinfo_lock); 424 426 425 427 if (root == NULL) … … 430 432 item->val_type = SYSINFO_VAL_UNDEFINED; 431 433 432 spinlock_unlock(&sysinfo_lock);434 mutex_unlock(&sysinfo_lock); 433 435 interrupts_restore(ipl); 434 436 } … … 447 449 /* Protect sysinfo tree consistency */ 448 450 ipl_t ipl = interrupts_disable(); 449 spinlock_lock(&sysinfo_lock);451 mutex_lock(&sysinfo_lock); 450 452 451 453 if (root == NULL) … … 461 463 } 462 464 463 spinlock_unlock(&sysinfo_lock);465 mutex_unlock(&sysinfo_lock); 464 466 interrupts_restore(ipl); 465 467 } … … 480 482 * 481 483 * Should be called with interrupts disabled 482 * and sysinfo_lock held. Because this routine 483 * might take a reasonable long time to proceed, 484 * having the spinlock held is not optimal, but 485 * there is no better simple solution. 484 * and sysinfo_lock held. 486 485 * 487 486 * @param root Root item of the current (sub)tree. … … 560 559 while we are dumping it */ 561 560 ipl_t ipl = interrupts_disable(); 562 spinlock_lock(&sysinfo_lock);561 mutex_lock(&sysinfo_lock); 563 562 564 563 if (root == NULL) … … 567 566 sysinfo_dump_internal(root, 0); 568 567 569 spinlock_unlock(&sysinfo_lock);568 mutex_unlock(&sysinfo_lock); 570 569 interrupts_restore(ipl); 571 570 } … … 660 659 */ 661 660 ipl_t ipl = interrupts_disable(); 662 spinlock_lock(&sysinfo_lock);661 mutex_lock(&sysinfo_lock); 663 662 ret = sysinfo_get_item(path, NULL, dry_run); 664 spinlock_unlock(&sysinfo_lock);663 mutex_unlock(&sysinfo_lock); 665 664 interrupts_restore(ipl); 666 665 }
Note:
See TracChangeset
for help on using the changeset viewer.