diff options
author | Ben LaHaise <bcrl@kvack.org> | 2002-09-13 23:07:20 +0000 |
---|---|---|
committer | Ben LaHaise <bcrl@kvack.org> | 2002-09-13 23:07:20 +0000 |
commit | d4e8b63c8717a8472da2906a8b474ed4471dd4a2 (patch) | |
tree | 567f32b4d176368c5f21af8571af2bffc9db0076 | |
parent | adb794a9afd5de190e80c91e4168bb4271c2a02b (diff) | |
download | libaio-d4e8b63c8717a8472da2906a8b474ed4471dd4a2.tar.gz |
add syscall stubs for x86-64
-rw-r--r-- | libaio.spec | 6 | ||||
-rw-r--r-- | src/libaio.h | 2 | ||||
-rw-r--r-- | src/syscall-x86_64.h | 57 | ||||
-rw-r--r-- | src/syscall.h | 2 |
4 files changed, 65 insertions, 2 deletions
diff --git a/libaio.spec b/libaio.spec index 1462298..78acd21 100644 --- a/libaio.spec +++ b/libaio.spec @@ -7,7 +7,7 @@ Group: System Environment/Libraries Source: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-root # Fix ExclusiveArch as we implement this functionality on more architectures -ExclusiveArch: i386 ia64 +ExclusiveArch: i386 x86_64 ia64 %description The Linux-native asynchronous I/O facility ("async I/O", or "aio") has a @@ -56,6 +56,10 @@ make install prefix=$RPM_BUILD_ROOT/usr root=$RPM_BUILD_ROOT %attr(0644,root,root) /usr/lib/libaio.a %changelog +* Fri Sep 12 2002 Benjamin LaHaise <bcrl@redhat.com> +- libaio 0.3.92 test release +- build on x86-64 + * Thu Sep 12 2002 Benjamin LaHaise <bcrl@redhat.com> - libaio 0.3.91 test release - build on ia64 diff --git a/src/libaio.h b/src/libaio.h index e4f4190..ac09231 100644 --- a/src/libaio.h +++ b/src/libaio.h @@ -47,7 +47,7 @@ typedef enum io_iocb_cmd { #define PADDED(x, y) x; unsigned y #define PADDEDptr(x, y) x; unsigned y #define PADDEDul(x, y) unsigned long x; unsigned y -#elif defined(__ia64__) +#elif defined(__ia64__) || defined(__x86_64__) #define PADDED(x, y) x, y #define PADDEDptr(x, y) x #define PADDEDul(x, y) unsigned long x diff --git a/src/syscall-x86_64.h b/src/syscall-x86_64.h new file mode 100644 index 0000000..b0269e6 --- /dev/null +++ b/src/syscall-x86_64.h @@ -0,0 +1,57 @@ +#define __NR_io_setup 245 +#define __NR_io_destroy 246 +#define __NR_io_getevents 247 +#define __NR_io_submit 248 +#define __NR_io_cancel 249 + +#define io_syscall1(type, name, type1, arg1) \ + type name(type1 arg1) \ + { \ + long __ret; \ + __asm__ __volatile__("syscall" : "=a" (__ret) : \ + "0" (__NR_##name), "D" (arg1)); \ + return __ret; \ + } + +#define io_syscall2(type, name, type1, arg1, type2, arg2) \ + type name(type1 arg1, type2 arg2) \ + { \ + long __ret; \ + __asm__ __volatile__("syscall" : "=a" (__ret) : \ + "0" (__NR_##name), "D" (arg1), "S" (arg2)); \ + return __ret; \ + } + +#define io_syscall3(type, name, type1, arg1, type2, arg2, type3, arg3) \ + type name(type1 arg1, type2 arg2, type3 arg3) \ + { \ + long __ret; \ + __asm__ __volatile__("syscall" : "=a" (__ret) : \ + "0" (__NR_##name), "D" (arg1), "S" (arg2), \ + "d" (arg3) \ + ); \ + return __ret; \ + } + +#define io_syscall4(type, name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) \ + type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ + { \ + long __ret; \ + __asm__ __volatile__("movq %5,%%r10 ; syscall" : "=a" (__ret) : \ + "0" (__NR_##name), "D" (arg1), "S" (arg2), \ + "d" (arg3), "g" (arg4) \ + ); \ + return __ret; \ + } + +#define io_syscall5(type, name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5) \ + type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ + { \ + long __ret; \ + __asm__ __volatile__("movq %5,%%r10 ; movq %6,%%r8 ; syscall" : "=a" (__ret) : \ + "0" (__NR_##name), "D" (arg1), "S" (arg2), \ + "d" (arg3), "g" (arg4), "g" (arg5) \ + ); \ + return __ret; \ + } + diff --git a/src/syscall.h b/src/syscall.h index 993b6b2..abbd443 100644 --- a/src/syscall.h +++ b/src/syscall.h @@ -6,6 +6,8 @@ #if defined(__i386__) #include "syscall-i386.h" +#elif defined(__x86_64__) +#include "syscall-x86_64.h" #elif defined(__ia64__) #include "syscall-ia64.h" #else |