projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add spinlocks
[fio.git]
/
arch
/
arch.h
diff --git
a/arch/arch.h
b/arch/arch.h
index 745bf3a4d0a6260dffc37b475e3b3479e966ba48..00163570f82c04f9de2825af424fae28b5d43a2d 100644
(file)
--- a/
arch/arch.h
+++ b/
arch/arch.h
@@
-8,19
+8,10
@@
enum {
arch_ia64,
arch_s390,
arch_alpha,
arch_ia64,
arch_s390,
arch_alpha,
+ arch_sparc,
+ arch_sparc64,
};
};
-static inline unsigned long generic_ffz(unsigned long word)
-{
- unsigned int i;
-
- for (i = 0; i < sizeof(word) * 8; i++)
- if ((word & (1UL << i)) == 0)
- return i;
-
- return -1;
-}
-
#if defined(__i386__)
#include "arch-x86.h"
#elif defined(__x86_64__)
#if defined(__i386__)
#include "arch-x86.h"
#elif defined(__x86_64__)
@@
-33,10
+24,23
@@
static inline unsigned long generic_ffz(unsigned long word)
#include "arch-alpha.h"
#elif defined(__s390x__) || defined(__s390__)
#include "arch-s390.h"
#include "arch-alpha.h"
#elif defined(__s390x__) || defined(__s390__)
#include "arch-s390.h"
+#elif defined(__sparc__)
+#include "arch-sparc.h"
+#elif defined(__sparc64__)
+#include "arch-sparc64.h"
#else
#error "Unsupported arch"
#endif
#else
#error "Unsupported arch"
#endif
-#define BITS_PER_LONG (__WORDSIZE)
+#ifdef ARCH_HAVE_FFZ
+#define ffz(bitmask) arch_ffz(bitmask)
+#else
+#include "../lib/ffz.h"
+#endif
+
+static inline void spin_lock_init(spinlock_t *lock)
+{
+ lock->lock = 0;
+}
#endif
#endif