aboutsummaryrefslogtreecommitdiff
path: root/qemu-lock.h
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2009-10-01 16:12:16 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-01 16:12:16 -0500
commitc227f0995e1722a1abccc28cadf0664266bd8043 (patch)
tree39e92c2f818e3e8144978740b914731613af0e40 /qemu-lock.h
parent99a0949b720a0936da2052cb9a46db04ffc6db29 (diff)
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 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-lock.h')
-rw-r--r--qemu-lock.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/qemu-lock.h b/qemu-lock.h
index 45bd2cdd7f..9a3e6acce8 100644
--- a/qemu-lock.h
+++ b/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;
}