summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch')
-rw-r--r--meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch b/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch
new file mode 100644
index 0000000000..508f5a12f1
--- /dev/null
+++ b/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch
@@ -0,0 +1,61 @@
1Upstream-Status: Pending
2
3Properly load arguments 5 an 6 for x86-64 syscall
4Use asm ("r10") and asm ("r8") to load arguments 5 an 6 for x86-64
5syscall so that it works with both x32 and x86-64.
6
7Received this patch from H.J. Lu <hjl.tools@gmail.com>
8
9Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
102011/12/02
11
12--- libaio-0.3.109/src/syscall-x86_64.h.x32 2009-10-09 11:17:02.000000000 -0700
13+++ libaio-0.3.109/src/syscall-x86_64.h 2011-12-02 09:09:07.537603224 -0800
14@@ -1,8 +1,18 @@
15+#ifndef __NR_io_setup
16 #define __NR_io_setup 206
17+#endif
18+#ifndef __NR_io_destroy
19 #define __NR_io_destroy 207
20+#endif
21+#ifndef __NR_io_getevents
22 #define __NR_io_getevents 208
23+#endif
24+#ifndef __NR_io_submit
25 #define __NR_io_submit 209
26+#endif
27+#ifndef __NR_io_cancel
28 #define __NR_io_cancel 210
29+#endif
30
31 #define __syscall_clobber "r11","rcx","memory"
32 #define __syscall "syscall"
33@@ -42,10 +52,11 @@ return __res; \
34 type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
35 { \
36 long __res; \
37-__asm__ volatile ("movq %5,%%r10 ;" __syscall \
38+register long __a4 asm ("r10") = (long) arg4; \
39+__asm__ volatile (__syscall \
40 : "=a" (__res) \
41 : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \
42- "d" ((long)(arg3)),"g" ((long)(arg4)) : __syscall_clobber,"r10" ); \
43+ "d" ((long)(arg3)),"r" (__a4)); \
44 return __res; \
45 }
46
47@@ -54,10 +65,11 @@ return __res; \
48 type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
49 { \
50 long __res; \
51-__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " __syscall \
52+register long __a4 asm ("r10") = (long) arg4; \
53+register long __a5 asm ("r8") = (long) arg5; \
54+__asm__ volatile ( __syscall \
55 : "=a" (__res) \
56 : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \
57- "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5)) : \
58- __syscall_clobber,"r8","r10" ); \
59+ "d" ((long)(arg3)),"r" (__a4),"r" (__a5)); \
60 return __res; \
61 }