* [PATCH] Add aarch64 support.
@ 2014-06-06 22:29 Doug Kwan
2014-06-09 3:17 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Doug Kwan @ 2014-06-06 22:29 UTC (permalink / raw)
To: fio; +Cc: Doug Kwan
This patch adds support for aarch64 for fio. This is tested by building
FIO on an aarch64 Ubuntu system and running some samepls.
Signed-off-by: Doug Kwan <dougkwan@google.com>
---
arch/arch-aarch64.h | 35 +++++++++++++++++++++++++++++++++++
arch/arch.h | 3 +++
2 files changed, 38 insertions(+)
create mode 100644 arch/arch-aarch64.h
diff --git a/arch/arch-aarch64.h b/arch/arch-aarch64.h
new file mode 100644
index 0000000..a6cfaf2
--- /dev/null
+++ b/arch/arch-aarch64.h
@@ -0,0 +1,35 @@
+#ifndef ARCH_AARCH64_H
+#define ARCH_AARCH64_H
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#define FIO_ARCH (arch_aarch64)
+
+#ifndef __NR_ioprio_set
+#define __NR_ioprio_set 30
+#define __NR_ioprio_get 31
+#endif
+
+#define nop do { __asm__ __volatile__ ("yield"); } while (0)
+#define read_barrier() do { __sync_synchronize(); } while (0)
+#define write_barrier() do { __sync_synchronize(); } while (0)
+
+static inline int arch_ffz(unsigned long bitmask)
+{
+ unsigned long count, reversed_bits;
+ if (~bitmask == 0) /* ffz() in lib/ffz.h does this. */
+ return 63;
+
+ __asm__ __volatile__ ("rbit %1, %2\n"
+ "clz %0, %1\n" :
+ "=r"(count), "=&r"(reversed_bits) :
+ "r"(~bitmask));
+ return count;
+}
+
+#define ARCH_HAVE_FFZ
+
+#endif
diff --git a/arch/arch.h b/arch/arch.h
index 31d96d4..0075f73 100644
--- a/arch/arch.h
+++ b/arch/arch.h
@@ -14,6 +14,7 @@ enum {
arch_sh,
arch_hppa,
arch_mips,
+ arch_aarch64,
arch_generic,
@@ -53,6 +54,8 @@ extern unsigned long arch_flags;
#include "arch-sh.h"
#elif defined(__hppa__)
#include "arch-hppa.h"
+#elif defined(__aarch64__)
+#include "arch-aarch64.h"
#else
#warning "Unknown architecture, attempting to use generic model."
#include "arch-generic.h"
--
2.0.0.526.g5318336
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-06-09 3:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-06 22:29 [PATCH] Add aarch64 support Doug Kwan
2014-06-09 3:17 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox