mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.
The naming convention is goofy and it causes a massive merge problem. Something
like this _must_ be presented on the list first so people can provide input
and cope with it.
This reverts commit 99a0949b72
.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
99a0949b72
commit
c227f0995e
316 changed files with 3332 additions and 3325 deletions
24
qemu-lock.h
24
qemu-lock.h
|
@ -28,29 +28,29 @@
|
|||
#include <pthread.h>
|
||||
#define spin_lock pthread_mutex_lock
|
||||
#define spin_unlock pthread_mutex_unlock
|
||||
#define a_spinlock pthread_mutex_t
|
||||
#define spinlock_t pthread_mutex_t
|
||||
#define SPIN_LOCK_UNLOCKED PTHREAD_MUTEX_INITIALIZER
|
||||
|
||||
#else
|
||||
|
||||
#if defined(__hppa__)
|
||||
|
||||
typedef int a_spinlock[4];
|
||||
typedef int spinlock_t[4];
|
||||
|
||||
#define SPIN_LOCK_UNLOCKED { 1, 1, 1, 1 }
|
||||
|
||||
static inline void resetlock (a_spinlock *p)
|
||||
static inline void resetlock (spinlock_t *p)
|
||||
{
|
||||
(*p)[0] = (*p)[1] = (*p)[2] = (*p)[3] = 1;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
typedef int a_spinlock;
|
||||
typedef int spinlock_t;
|
||||
|
||||
#define SPIN_LOCK_UNLOCKED 0
|
||||
|
||||
static inline void resetlock (a_spinlock *p)
|
||||
static inline void resetlock (spinlock_t *p)
|
||||
{
|
||||
*p = SPIN_LOCK_UNLOCKED;
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ static inline void *ldcw_align (void *p) {
|
|||
return (void *)a;
|
||||
}
|
||||
|
||||
static inline int testandset (a_spinlock *p)
|
||||
static inline int testandset (spinlock_t *p)
|
||||
{
|
||||
unsigned int ret;
|
||||
p = ldcw_align(p);
|
||||
|
@ -215,30 +215,30 @@ static inline int testandset (int *p)
|
|||
#endif
|
||||
|
||||
#if defined(CONFIG_USER_ONLY)
|
||||
static inline void spin_lock(a_spinlock *lock)
|
||||
static inline void spin_lock(spinlock_t *lock)
|
||||
{
|
||||
while (testandset(lock));
|
||||
}
|
||||
|
||||
static inline void spin_unlock(a_spinlock *lock)
|
||||
static inline void spin_unlock(spinlock_t *lock)
|
||||
{
|
||||
resetlock(lock);
|
||||
}
|
||||
|
||||
static inline int spin_trylock(a_spinlock *lock)
|
||||
static inline int spin_trylock(spinlock_t *lock)
|
||||
{
|
||||
return !testandset(lock);
|
||||
}
|
||||
#else
|
||||
static inline void spin_lock(a_spinlock *lock)
|
||||
static inline void spin_lock(spinlock_t *lock)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void spin_unlock(a_spinlock *lock)
|
||||
static inline void spin_unlock(spinlock_t *lock)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int spin_trylock(a_spinlock *lock)
|
||||
static inline int spin_trylock(spinlock_t *lock)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue