Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ Upstream commit a24ce06 ] We use a spinlock now so add a stub. Ignore bogus uninitialized variable warnings. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
- Loading branch information
Showing
3 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#ifndef SPINLOCK_H_STUB | ||
#define SPINLOCK_H_STUB | ||
|
||
#include <pthread.h> | ||
|
||
typedef pthread_spinlock_t spinlock_t; | ||
|
||
static inline void spin_lock_init(spinlock_t *lock) | ||
{ | ||
int r = pthread_spin_init(lock, 0); | ||
assert(!r); | ||
} | ||
|
||
static inline void spin_lock(spinlock_t *lock) | ||
{ | ||
int ret = pthread_spin_lock(lock); | ||
assert(!ret); | ||
} | ||
|
||
static inline void spin_unlock(spinlock_t *lock) | ||
{ | ||
int ret = pthread_spin_unlock(lock); | ||
assert(!ret); | ||
} | ||
|
||
static inline void spin_lock_bh(spinlock_t *lock) | ||
{ | ||
spin_lock(lock); | ||
} | ||
|
||
static inline void spin_unlock_bh(spinlock_t *lock) | ||
{ | ||
spin_unlock(lock); | ||
} | ||
|
||
static inline void spin_lock_irq(spinlock_t *lock) | ||
{ | ||
spin_lock(lock); | ||
} | ||
|
||
static inline void spin_unlock_irq(spinlock_t *lock) | ||
{ | ||
spin_unlock(lock); | ||
} | ||
|
||
static inline void spin_lock_irqsave(spinlock_t *lock, unsigned long f) | ||
{ | ||
spin_lock(lock); | ||
} | ||
|
||
static inline void spin_unlock_irqrestore(spinlock_t *lock, unsigned long f) | ||
{ | ||
spin_unlock(lock); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters