1 #ifndef _KERN_SPINLOCK_H
2 #define _KERN_SPINLOCK_H
4 #include <kern/kernel.h>
5 #include <lowlevel/misc.h>
11 #if CONF_DEBUG_SPINLOCKS
12 unsigned long held_at;
22 // Nothing on UP. Call arch on SMP.
24 #if CONF_DEBUG_SPINLOCKS
31 // Nothing on UP. Call arch on SMP.
33 #if CONF_DEBUG_SPINLOCKS
35 if (!in_fault && held_at) {
37 printf("Spinlock deadlock, lock %p previously held at 0x%lx\n",
44 held_at = (ulong)__builtin_return_address(0);
50 #if CONF_DEBUG_SPINLOCKS
54 // Nothing on UP. Call arch on SMP.
71 unsigned long ret = ll_ints_save_and_off();
76 void unlock_recirq(ulong savedirq)
79 ll_ints_restore(savedirq);