Subversion Repositories HelenOS

Rev

Rev 3386 | Rev 4263 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3386 Rev 4153
Line 74... Line 74...
74
 */
74
 */
75
#ifdef CONFIG_DEBUG_SPINLOCK
75
#ifdef CONFIG_DEBUG_SPINLOCK
76
void spinlock_lock_debug(spinlock_t *sl)
76
void spinlock_lock_debug(spinlock_t *sl)
77
{
77
{
78
    count_t i = 0;
78
    count_t i = 0;
79
    char *symbol;
-
 
80
    bool deadlock_reported = false;
79
    bool deadlock_reported = false;
81
 
80
 
82
    preemption_disable();
81
    preemption_disable();
83
    while (test_and_set(&sl->val)) {
82
    while (test_and_set(&sl->val)) {
84
 
83
 
Line 104... Line 103...
104
#ifdef CONFIG_FB
103
#ifdef CONFIG_FB
105
        if (sl == &fb_lock)
104
        if (sl == &fb_lock)
106
            continue;
105
            continue;
107
#endif
106
#endif
108
        if (i++ > DEADLOCK_THRESHOLD) {
107
        if (i++ > DEADLOCK_THRESHOLD) {
109
            printf("cpu%u: looping on spinlock %" PRIp ":%s, caller=%" PRIp,
108
            printf("cpu%u: looping on spinlock %" PRIp ":%s, "
110
                CPU->id, sl, sl->name, CALLER);
109
                "caller=%" PRIp "(%s)", CPU->id, sl, sl->name,
111
            symbol = get_symtab_entry(CALLER);
110
                CALLER, symtab_fmt_name_lookup(CALLER));
112
            if (symbol)
111
 
113
                printf("(%s)", symbol);
-
 
114
            printf("\n");
-
 
115
            i = 0;
112
            i = 0;
116
            deadlock_reported = true;
113
            deadlock_reported = true;
117
        }
114
        }
118
    }
115
    }
119
 
116