Changeset 74b92e6 in mainline
- Timestamp:
- 2025-04-12T15:55:08Z (2 days ago)
- Branches:
- master
- Children:
- 1cea9c0, 2ef2a0d
- Parents:
- 8165a7a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/sysinfo/sysinfo.c
r8165a7a r74b92e6 34 34 */ 35 35 36 #include <arch/asm.h> 36 37 #include <assert.h> 37 #include <sysinfo/sysinfo.h> 38 #include <errno.h> 39 #include <macros.h> 38 40 #include <mm/slab.h> 39 41 #include <stdio.h> 42 #include <stdlib.h> 43 #include <synch/mutex.h> 40 44 #include <syscall/copy.h> 41 #include <synch/mutex.h> 42 #include <arch/asm.h> 43 #include <errno.h> 44 #include <macros.h> 45 #include <stdlib.h> 45 #include <sysinfo/sysinfo.h> 46 46 47 47 /** Maximal sysinfo path length */ … … 57 57 58 58 /** Sysinfo lock */ 59 static IRQ_SPINLOCK_INITIALIZE(sysinfo_lock);59 static MUTEX_INITIALIZE(sysinfo_lock, MUTEX_PASSIVE); 60 60 61 61 /** Sysinfo item constructor … … 327 327 { 328 328 /* Protect sysinfo tree consistency */ 329 irq_spinlock_lock(&sysinfo_lock, true);329 mutex_lock(&sysinfo_lock); 330 330 331 331 if (root == NULL) … … 340 340 } 341 341 342 irq_spinlock_unlock(&sysinfo_lock, true);342 mutex_unlock(&sysinfo_lock); 343 343 } 344 344 … … 360 360 { 361 361 /* Protect sysinfo tree consistency */ 362 irq_spinlock_lock(&sysinfo_lock, true);362 mutex_lock(&sysinfo_lock); 363 363 364 364 if (root == NULL) … … 374 374 } 375 375 376 irq_spinlock_unlock(&sysinfo_lock, true);376 mutex_unlock(&sysinfo_lock); 377 377 } 378 378 … … 390 390 { 391 391 /* Protect sysinfo tree consistency */ 392 irq_spinlock_lock(&sysinfo_lock, true);392 mutex_lock(&sysinfo_lock); 393 393 394 394 if (root == NULL) … … 404 404 } 405 405 406 irq_spinlock_unlock(&sysinfo_lock, true);406 mutex_unlock(&sysinfo_lock); 407 407 } 408 408 … … 425 425 { 426 426 /* Protect sysinfo tree consistency */ 427 irq_spinlock_lock(&sysinfo_lock, true);427 mutex_lock(&sysinfo_lock); 428 428 429 429 if (root == NULL) … … 439 439 } 440 440 441 irq_spinlock_unlock(&sysinfo_lock, true);441 mutex_unlock(&sysinfo_lock); 442 442 } 443 443 … … 452 452 { 453 453 /* Protect sysinfo tree consistency */ 454 irq_spinlock_lock(&sysinfo_lock, true);454 mutex_lock(&sysinfo_lock); 455 455 456 456 if (root == NULL) … … 463 463 printf("Could not set sysinfo item %s.\n", name); 464 464 465 irq_spinlock_unlock(&sysinfo_lock, true);465 mutex_unlock(&sysinfo_lock); 466 466 } 467 467 … … 479 479 { 480 480 /* Protect sysinfo tree consistency */ 481 irq_spinlock_lock(&sysinfo_lock, true);481 mutex_lock(&sysinfo_lock); 482 482 483 483 if (root == NULL) … … 498 498 } 499 499 500 irq_spinlock_unlock(&sysinfo_lock, true);500 mutex_unlock(&sysinfo_lock); 501 501 } 502 502 … … 596 596 * while we are dumping it 597 597 */ 598 irq_spinlock_lock(&sysinfo_lock, true);598 mutex_lock(&sysinfo_lock); 599 599 600 600 if (root == NULL) … … 603 603 sysinfo_dump_internal(root, 0); 604 604 605 irq_spinlock_unlock(&sysinfo_lock, true);605 mutex_unlock(&sysinfo_lock); 606 606 } 607 607 … … 695 695 * are reading it. 696 696 */ 697 irq_spinlock_lock(&sysinfo_lock, true);697 mutex_lock(&sysinfo_lock); 698 698 ret = sysinfo_get_item(path, NULL, dry_run); 699 irq_spinlock_unlock(&sysinfo_lock, true);699 mutex_unlock(&sysinfo_lock); 700 700 } 701 701 … … 806 806 * are reading it. 807 807 */ 808 irq_spinlock_lock(&sysinfo_lock, true);808 mutex_lock(&sysinfo_lock); 809 809 ret = sysinfo_get_keys(path, NULL, dry_run); 810 irq_spinlock_unlock(&sysinfo_lock, true);810 mutex_unlock(&sysinfo_lock); 811 811 } 812 812
Note:
See TracChangeset
for help on using the changeset viewer.