Subversion Repositories HelenOS

Rev

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

Rev 3059 Rev 4132
Line 40... Line 40...
40
#include <arch/barrier.h>
40
#include <arch/barrier.h>
41
#include <arch.h>
41
#include <arch.h>
42
#include <preemption.h>
42
#include <preemption.h>
43
#include <print.h>
43
#include <print.h>
44
#include <debug.h>
44
#include <debug.h>
-
 
45
 
-
 
46
#ifdef CONFIG_SYMTAB
45
#include <symtab.h>
47
#include <symtab.h>
-
 
48
#endif
46
 
49
 
47
#ifdef CONFIG_FB
50
#ifdef CONFIG_FB
48
#include <genarch/fb/fb.h>
51
#include <genarch/fb/fb.h>
49
#endif
52
#endif
50
 
53
 
Line 74... Line 77...
74
 */
77
 */
75
#ifdef CONFIG_DEBUG_SPINLOCK
78
#ifdef CONFIG_DEBUG_SPINLOCK
76
void spinlock_lock_debug(spinlock_t *sl)
79
void spinlock_lock_debug(spinlock_t *sl)
77
{
80
{
78
    count_t i = 0;
81
    count_t i = 0;
79
    char *symbol;
-
 
80
    bool deadlock_reported = false;
82
    bool deadlock_reported = false;
-
 
83
#ifdef CONFIG_SYMTAB
-
 
84
    char *symbol;
-
 
85
#endif
81
 
86
 
82
    preemption_disable();
87
    preemption_disable();
83
    while (test_and_set(&sl->val)) {
88
    while (test_and_set(&sl->val)) {
84
 
89
 
85
        /*
90
        /*
Line 106... Line 111...
106
            continue;
111
            continue;
107
#endif
112
#endif
108
        if (i++ > DEADLOCK_THRESHOLD) {
113
        if (i++ > DEADLOCK_THRESHOLD) {
109
            printf("cpu%u: looping on spinlock %" PRIp ":%s, caller=%" PRIp,
114
            printf("cpu%u: looping on spinlock %" PRIp ":%s, caller=%" PRIp,
110
                CPU->id, sl, sl->name, CALLER);
115
                CPU->id, sl, sl->name, CALLER);
-
 
116
#ifdef CONFIG_SYMTAB
111
            symbol = get_symtab_entry(CALLER);
117
            symbol = get_symtab_entry(CALLER);
112
            if (symbol)
118
            if (symbol)
113
                printf("(%s)", symbol);
119
                printf("(%s)", symbol);
-
 
120
#endif
114
            printf("\n");
121
            printf("\n");
115
            i = 0;
122
            i = 0;
116
            deadlock_reported = true;
123
            deadlock_reported = true;
117
        }
124
        }
118
    }
125
    }