Changeset 2d93f1f9 in mainline for generic/src/synch/spinlock.c
- Timestamp:
- 2005-12-06T21:58:18Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a80d406
- Parents:
- 36e7b6c3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/synch/spinlock.c
r36e7b6c3 r2d93f1f9 34 34 #include <print.h> 35 35 #include <debug.h> 36 #include <symtab.h> 36 37 37 38 #ifdef CONFIG_SMP … … 43 44 * @param sl Pointer to spinlock_t structure. 44 45 */ 45 void spinlock_initialize(spinlock_t *sl )46 void spinlock_initialize(spinlock_t *sl, char *name) 46 47 { 47 48 sl->val = 0; 49 #ifdef CONFIG_DEBUG_SPINLOCK 50 sl->name = name; 51 #endif 48 52 } 49 53 … … 60 64 { 61 65 int i = 0; 62 __address caller = ((__u32 *) &sl)[-1]; 66 __address caller = ((__address *) &sl)[-1]; 67 char *symbol; 63 68 64 69 preemption_disable(); 65 70 while (test_and_set(&sl->val)) { 66 71 if (i++ > 300000) { 67 printf("cpu%d: looping on spinlock %X, caller=%X\n", CPU->id, sl, caller); 72 printf("cpu%d: looping on spinlock %p:%s, caller=%p", 73 CPU->id, sl, sl->name, caller); 74 symbol = get_symtab_entry(caller); 75 if (symbol) 76 printf("(%s)", symbol); 77 printf("\n"); 68 78 i = 0; 69 79 }
Note:
See TracChangeset
for help on using the changeset viewer.