|
|
371d15 |
diff -up libaio-0.3.109/src/libaio.h.orig libaio-0.3.109/src/libaio.h
|
|
|
371d15 |
--- libaio-0.3.109/src/libaio.h.orig 2009-10-09 14:17:02.000000000 -0400
|
|
|
371d15 |
+++ libaio-0.3.109/src/libaio.h 2014-03-13 10:22:47.062638753 -0400
|
|
|
371d15 |
@@ -83,6 +83,16 @@ typedef enum io_iocb_cmd {
|
|
|
371d15 |
#define PADDEDptr(x, y) x; unsigned y
|
|
|
371d15 |
#define PADDEDul(x, y) unsigned long x; unsigned y
|
|
|
371d15 |
# endif
|
|
|
371d15 |
+#elif defined(__aarch64__)
|
|
|
371d15 |
+# if defined (__AARCH64EB__) /* big endian, 64 bits */
|
|
|
371d15 |
+#define PADDED(x, y) unsigned y; x
|
|
|
371d15 |
+#define PADDEDptr(x,y) x
|
|
|
371d15 |
+#define PADDEDul(x, y) unsigned long x
|
|
|
371d15 |
+# elif defined(__AARCH64EL__) /* little endian, 64 bits */
|
|
|
371d15 |
+#define PADDED(x, y) x, y
|
|
|
371d15 |
+#define PADDEDptr(x, y) x
|
|
|
371d15 |
+#define PADDEDul(x, y) unsigned long x
|
|
|
371d15 |
+# endif
|
|
|
371d15 |
#else
|
|
|
371d15 |
#error endian?
|
|
|
371d15 |
#endif
|
|
|
371d15 |
diff -up libaio-0.3.109/src/syscall-arm64.h.orig libaio-0.3.109/src/syscall-arm64.h
|
|
|
371d15 |
--- libaio-0.3.109/src/syscall-arm64.h.orig 2014-03-13 10:21:16.090895733 -0400
|
|
|
371d15 |
+++ libaio-0.3.109/src/syscall-arm64.h 2014-03-13 10:21:16.090895733 -0400
|
|
|
371d15 |
@@ -0,0 +1,101 @@
|
|
|
371d15 |
+/*
|
|
|
371d15 |
+ * linux/include/asm-arm/unistd.h
|
|
|
371d15 |
+ *
|
|
|
371d15 |
+ * Copyright (C) 2001-2005 Russell King
|
|
|
371d15 |
+ *
|
|
|
371d15 |
+ * This program is free software; you can redistribute it and/or modify
|
|
|
371d15 |
+ * it under the terms of the GNU General Public License version 2 as
|
|
|
371d15 |
+ * published by the Free Software Foundation.
|
|
|
371d15 |
+ *
|
|
|
371d15 |
+ * Please forward _all_ changes to this file to rmk@arm.linux.org.uk,
|
|
|
371d15 |
+ * no matter what the change is. Thanks!
|
|
|
371d15 |
+ */
|
|
|
371d15 |
+
|
|
|
371d15 |
+#define __NR_io_setup 0
|
|
|
371d15 |
+#define __NR_io_destroy 1
|
|
|
371d15 |
+#define __NR_io_submit 2
|
|
|
371d15 |
+#define __NR_io_cancel 3
|
|
|
371d15 |
+#define __NR_io_getevents 4
|
|
|
371d15 |
+
|
|
|
371d15 |
+#define __sys2(x) #x
|
|
|
371d15 |
+#define __sys1(x) __sys2(x)
|
|
|
371d15 |
+
|
|
|
371d15 |
+#define __SYS_REG(name) register long __sysreg __asm__("w8") = __NR_##name;
|
|
|
371d15 |
+#define __SYS_REG_LIST(regs...) "r" (__sysreg) , ##regs
|
|
|
371d15 |
+#define __syscall(name) "svc\t#0"
|
|
|
371d15 |
+
|
|
|
371d15 |
+#define io_syscall1(type,fname,sname,type1,arg1) \
|
|
|
371d15 |
+type fname(type1 arg1) { \
|
|
|
371d15 |
+ __SYS_REG(sname) \
|
|
|
371d15 |
+ register long __x0 __asm__("x0") = (long)arg1; \
|
|
|
371d15 |
+ register long __res_x0 __asm__("x0"); \
|
|
|
371d15 |
+ __asm__ __volatile__ ( \
|
|
|
371d15 |
+ __syscall(sname) \
|
|
|
371d15 |
+ : "=r" (__res_x0) \
|
|
|
371d15 |
+ : __SYS_REG_LIST( "0" (__x0) ) \
|
|
|
371d15 |
+ : "memory" ); \
|
|
|
371d15 |
+ return (type) __res_x0; \
|
|
|
371d15 |
+}
|
|
|
371d15 |
+
|
|
|
371d15 |
+#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
|
|
|
371d15 |
+type fname(type1 arg1,type2 arg2) { \
|
|
|
371d15 |
+ __SYS_REG(sname) \
|
|
|
371d15 |
+ register long __x0 __asm__("x0") = (long)arg1; \
|
|
|
371d15 |
+ register long __x1 __asm__("x1") = (long)arg2; \
|
|
|
371d15 |
+ register long __res_x0 __asm__("x0"); \
|
|
|
371d15 |
+ __asm__ __volatile__ ( \
|
|
|
371d15 |
+ __syscall(sname) \
|
|
|
371d15 |
+ : "=r" (__res_x0) \
|
|
|
371d15 |
+ : __SYS_REG_LIST( "0" (__x0), "r" (__x1) ) \
|
|
|
371d15 |
+ : "memory" ); \
|
|
|
371d15 |
+ return (type) __res_x0; \
|
|
|
371d15 |
+}
|
|
|
371d15 |
+
|
|
|
371d15 |
+#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
|
|
|
371d15 |
+type fname(type1 arg1,type2 arg2,type3 arg3) { \
|
|
|
371d15 |
+ __SYS_REG(sname) \
|
|
|
371d15 |
+ register long __x0 __asm__("x0") = (long)arg1; \
|
|
|
371d15 |
+ register long __x1 __asm__("x1") = (long)arg2; \
|
|
|
371d15 |
+ register long __x2 __asm__("x2") = (long)arg3; \
|
|
|
371d15 |
+ register long __res_x0 __asm__("x0"); \
|
|
|
371d15 |
+ __asm__ __volatile__ ( \
|
|
|
371d15 |
+ __syscall(sname) \
|
|
|
371d15 |
+ : "=r" (__res_x0) \
|
|
|
371d15 |
+ : __SYS_REG_LIST( "0" (__x0), "r" (__x1), "r" (__x2) ) \
|
|
|
371d15 |
+ : "memory" ); \
|
|
|
371d15 |
+ return (type) __res_x0; \
|
|
|
371d15 |
+}
|
|
|
371d15 |
+
|
|
|
371d15 |
+#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4)\
|
|
|
371d15 |
+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
|
|
|
371d15 |
+ __SYS_REG(sname) \
|
|
|
371d15 |
+ register long __x0 __asm__("x0") = (long)arg1; \
|
|
|
371d15 |
+ register long __x1 __asm__("x1") = (long)arg2; \
|
|
|
371d15 |
+ register long __x2 __asm__("x2") = (long)arg3; \
|
|
|
371d15 |
+ register long __x3 __asm__("x3") = (long)arg4; \
|
|
|
371d15 |
+ register long __res_x0 __asm__("x0"); \
|
|
|
371d15 |
+ __asm__ __volatile__ ( \
|
|
|
371d15 |
+ __syscall(sname) \
|
|
|
371d15 |
+ : "=r" (__res_x0) \
|
|
|
371d15 |
+ : __SYS_REG_LIST( "0" (__x0), "r" (__x1), "r" (__x2), "r" (__x3) ) \
|
|
|
371d15 |
+ : "memory" ); \
|
|
|
371d15 |
+ return (type) __res_x0; \
|
|
|
371d15 |
+}
|
|
|
371d15 |
+
|
|
|
371d15 |
+#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
|
|
|
371d15 |
+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) {\
|
|
|
371d15 |
+ __SYS_REG(sname) \
|
|
|
371d15 |
+ register long __x0 __asm__("x0") = (long)arg1; \
|
|
|
371d15 |
+ register long __x1 __asm__("x1") = (long)arg2; \
|
|
|
371d15 |
+ register long __x2 __asm__("x2") = (long)arg3; \
|
|
|
371d15 |
+ register long __x3 __asm__("x3") = (long)arg4; \
|
|
|
371d15 |
+ register long __x4 __asm__("x4") = (long)arg5; \
|
|
|
371d15 |
+ register long __res_x0 __asm__("x0"); \
|
|
|
371d15 |
+ __asm__ __volatile__ ( \
|
|
|
371d15 |
+ __syscall(sname) \
|
|
|
371d15 |
+ : "=r" (__res_x0) \
|
|
|
371d15 |
+ : __SYS_REG_LIST( "0" (__x0), "r" (__x1), "r" (__x2), \
|
|
|
371d15 |
+ "r" (__x3), "r" (__x4) ) \
|
|
|
371d15 |
+ : "memory" ); \
|
|
|
371d15 |
+ return (type) __res_x0; \
|
|
|
371d15 |
+}
|
|
|
371d15 |
diff -up libaio-0.3.109/src/syscall.h.orig libaio-0.3.109/src/syscall.h
|
|
|
371d15 |
--- libaio-0.3.109/src/syscall.h.orig 2009-10-09 14:17:02.000000000 -0400
|
|
|
371d15 |
+++ libaio-0.3.109/src/syscall.h 2014-03-13 10:23:14.039452006 -0400
|
|
|
371d15 |
@@ -24,6 +24,8 @@
|
|
|
371d15 |
#include "syscall-alpha.h"
|
|
|
371d15 |
#elif defined(__arm__)
|
|
|
371d15 |
#include "syscall-arm.h"
|
|
|
371d15 |
+#elif defined(__aarch64__)
|
|
|
371d15 |
+#include "syscall-arm64.h"
|
|
|
371d15 |
#else
|
|
|
371d15 |
#error "add syscall-arch.h"
|
|
|
371d15 |
#endif
|