Ignore:
Timestamp:
2010-05-25T22:15:03Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e805e2f
Parents:
d7da4284
Message:

Add interfaces for testing the status of plain spinlocks and the IRQ spinlocks.

Note that because of the non-SMP version of spinlocks, the status must be
checked only in the affirmative manner. Instead of:

ASSERT(!spinlock_locked(…));


one needs to do:

ASSERT(spinlock_unlocked(…));

Otherwise the assertion will be hit on debug non-SMP kernels.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/synch/spinlock.h

    rd7da4284 rffe4a87  
    115115extern void spinlock_lock_debug(spinlock_t *);
    116116extern void spinlock_unlock_debug(spinlock_t *);
     117extern bool spinlock_locked(spinlock_t *);
     118extern bool spinlock_unlocked(spinlock_t *);
    117119
    118120/** Unlock spinlock
     
    177179#define spinlock_trylock(lock)  (preemption_disable(), 1)
    178180#define spinlock_unlock(lock)   preemption_enable()
     181#define spinlock_locked(lock)   1
     182#define spinlock_unlocked(lock) 1
    179183
    180184#define DEADLOCK_PROBE_INIT(pname)
     
    283287extern void irq_spinlock_pass(irq_spinlock_t *, irq_spinlock_t *);
    284288extern void irq_spinlock_exchange(irq_spinlock_t *, irq_spinlock_t *);
     289extern bool irq_spinlock_locked(irq_spinlock_t *);
     290extern bool irq_spinlock_unlocked(irq_spinlock_t *);
    285291
    286292#endif
Note: See TracChangeset for help on using the changeset viewer.