arch/riscv: Remove spinlock code from atomic.h
These functions are not used anywhere. Change-Id: Ica1f4650e8774dd796be0aff00054f3698087816 Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Reviewed-on: https://review.coreboot.org/15829 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
parent
a90f41bdd7
commit
0cc02efb23
|
@ -65,33 +65,4 @@ typedef struct { int lock; } spinlock_t;
|
|||
res; })
|
||||
#endif
|
||||
|
||||
static inline void spinlock_lock(spinlock_t* lock)
|
||||
{
|
||||
do
|
||||
{
|
||||
while (atomic_read(&lock->lock))
|
||||
;
|
||||
} while (atomic_swap(&lock->lock, -1));
|
||||
mb();
|
||||
}
|
||||
|
||||
static inline void spinlock_unlock(spinlock_t* lock)
|
||||
{
|
||||
mb();
|
||||
atomic_set(&lock->lock,0);
|
||||
}
|
||||
|
||||
static inline long spinlock_lock_irqsave(spinlock_t* lock)
|
||||
{
|
||||
long flags = disable_irqsave();
|
||||
spinlock_lock(lock);
|
||||
return flags;
|
||||
}
|
||||
|
||||
static inline void spinlock_unlock_irqrestore(spinlock_t* lock, long flags)
|
||||
{
|
||||
spinlock_unlock(lock);
|
||||
enable_irqrestore(flags);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue