Subversion Repositories HelenOS

Rev

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

Rev 3022 Rev 4055
Line 34... Line 34...
34
 
34
 
35
#ifndef KERN_SPINLOCK_H_
35
#ifndef KERN_SPINLOCK_H_
36
#define KERN_SPINLOCK_H_
36
#define KERN_SPINLOCK_H_
37
 
37
 
38
#include <arch/types.h>
38
#include <arch/types.h>
-
 
39
#include <arch/barrier.h>
39
#include <preemption.h>
40
#include <preemption.h>
40
#include <atomic.h>
41
#include <atomic.h>
41
#include <debug.h>
42
#include <debug.h>
42
 
43
 
43
#ifdef CONFIG_SMP
44
#ifdef CONFIG_SMP
Line 108... Line 109...
108
#define DEADLOCK_THRESHOLD      100000000
109
#define DEADLOCK_THRESHOLD      100000000
109
#define DEADLOCK_PROBE_INIT(pname)  count_t pname = 0
110
#define DEADLOCK_PROBE_INIT(pname)  count_t pname = 0
110
#define DEADLOCK_PROBE(pname, value)                    \
111
#define DEADLOCK_PROBE(pname, value)                    \
111
    if ((pname)++ > (value)) {                  \
112
    if ((pname)++ > (value)) {                  \
112
        (pname) = 0;                        \
113
        (pname) = 0;                        \
113
        printf("Deadlock probe %s: exceeded threshold %d\n",    \
114
        printf("Deadlock probe %s: exceeded threshold %u\n",    \
114
            "cpu%d: function=%s, line=%d\n",            \
115
            "cpu%u: function=%s, line=%u\n",            \
115
            #pname, (value), CPU->id, __func__, __LINE__);  \
116
            #pname, (value), CPU->id, __func__, __LINE__);  \
116
    }
117
    }
117
#else
118
#else
118
#define DEADLOCK_PROBE_INIT(pname)
119
#define DEADLOCK_PROBE_INIT(pname)
119
#define DEADLOCK_PROBE(pname, value)
120
#define DEADLOCK_PROBE(pname, value)