Rev 1323 | Rev 1702 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1323 | Rev 1667 | ||
|---|---|---|---|
| Line 67... | Line 67... | ||
| 67 | * possible occurence of deadlock. |
67 | * possible occurence of deadlock. |
| 68 | * |
68 | * |
| 69 | * @param sl Pointer to spinlock_t structure. |
69 | * @param sl Pointer to spinlock_t structure. |
| 70 | */ |
70 | */ |
| 71 | #ifdef CONFIG_DEBUG_SPINLOCK |
71 | #ifdef CONFIG_DEBUG_SPINLOCK |
| - | 72 | #define DEADLOCK_THRESHOLD 100000000 |
|
| 72 | void spinlock_lock_debug(spinlock_t *sl) |
73 | void spinlock_lock_debug(spinlock_t *sl) |
| 73 | { |
74 | { |
| 74 | count_t i = 0; |
75 | count_t i = 0; |
| 75 | char *symbol; |
76 | char *symbol; |
| 76 | bool deadlock_reported = false; |
77 | bool deadlock_reported = false; |
| Line 99... | Line 100... | ||
| 99 | continue; |
100 | continue; |
| 100 | #ifdef CONFIG_FB |
101 | #ifdef CONFIG_FB |
| 101 | if (sl == &fb_lock) |
102 | if (sl == &fb_lock) |
| 102 | continue; |
103 | continue; |
| 103 | #endif |
104 | #endif |
| 104 | if (i++ > 10000000) { |
105 | if (i++ > DEADLOCK_THRESHOLD) { |
| 105 | printf("cpu%d: looping on spinlock %.*p:%s, caller=%.*p", |
106 | printf("cpu%d: looping on spinlock %.*p:%s, caller=%.*p", |
| 106 | CPU->id, sizeof(__address) * 2, sl, sl->name, sizeof(__address) * 2, CALLER); |
107 | CPU->id, sizeof(__address) * 2, sl, sl->name, sizeof(__address) * 2, CALLER); |
| 107 | symbol = get_symtab_entry(CALLER); |
108 | symbol = get_symtab_entry(CALLER); |
| 108 | if (symbol) |
109 | if (symbol) |
| 109 | printf("(%s)", symbol); |
110 | printf("(%s)", symbol); |