Subversion Repositories HelenOS

Rev

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

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