Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 543662b in mainline


Ignore:
Timestamp:
2018-11-20T18:57:09Z (20 months ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
0705fc5
Parents:
a615be0
Message:

Fix non-debug build

File:
1 edited

Legend:

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

    ra615be0 r543662b  
    9999        assert(expr)
    100100
    101 #define spinlock_lock(lock)    atomic_lock_arch(&(lock)->val)
    102 #define spinlock_unlock(lock)  spinlock_unlock_nondebug((lock))
     101/** Acquire spinlock
     102 *
     103 * @param lock  Pointer to spinlock_t structure.
     104 */
     105NO_TRACE static inline void spinlock_lock(spinlock_t *lock)
     106{
     107        preemption_disable();
     108        while (atomic_flag_test_and_set_explicit(&lock->flag,
     109            memory_order_acquire))
     110                ;
     111}
     112
     113/** Release spinlock
     114 *
     115 * @param lock  Pointer to spinlock_t structure.
     116 */
     117NO_TRACE static inline void spinlock_unlock(spinlock_t *lock)
     118{
     119        atomic_flag_clear_explicit(&lock->flag, memory_order_release);
     120        preemption_enable();
     121}
    103122
    104123#endif /* CONFIG_DEBUG_SPINLOCK */
     
    115134extern void spinlock_unlock_debug(spinlock_t *);
    116135extern bool spinlock_locked(spinlock_t *);
    117 
    118 /** Unlock spinlock
    119  *
    120  * Unlock spinlock for non-debug kernels.
    121  *
    122  * @param sl Pointer to spinlock_t structure.
    123  *
    124  */
    125 NO_TRACE static inline void spinlock_unlock_nondebug(spinlock_t *lock)
    126 {
    127         atomic_flag_clear_explicit(&lock->flag, memory_order_release);
    128         preemption_enable();
    129 }
    130136
    131137#ifdef CONFIG_DEBUG_SPINLOCK
Note: See TracChangeset for help on using the changeset viewer.