sys_move_pages() support for 32bit (i386 and x86_64 compat) Add support for move_pages(0 for i386 and also add the compat functions necessary to run 32 bit binaries on x86_64. Signed-off-by: Christoph Lameter Index: linux-2.6.17-rc4-mm2/arch/i386/kernel/syscall_table.S =================================================================== --- linux-2.6.17-rc4-mm2.orig/arch/i386/kernel/syscall_table.S 2006-05-20 20:23:11.000000000 -0700 +++ linux-2.6.17-rc4-mm2/arch/i386/kernel/syscall_table.S 2006-05-20 21:20:20.000000000 -0700 @@ -315,3 +315,5 @@ .long sys_splice .long sys_sync_file_range .long sys_tee /* 315 */ + .long sys_ni_syscall /* vmsplice */ + .long sys_move_pages Index: linux-2.6.17-rc4-mm2/arch/x86_64/ia32/ia32entry.S =================================================================== --- linux-2.6.17-rc4-mm2.orig/arch/x86_64/ia32/ia32entry.S 2006-05-20 20:23:11.000000000 -0700 +++ linux-2.6.17-rc4-mm2/arch/x86_64/ia32/ia32entry.S 2006-05-20 21:20:20.000000000 -0700 @@ -699,4 +699,5 @@ .quad sys_sync_file_range .quad sys_tee .quad compat_sys_vmsplice + .quad compat_sys_move_pages ia32_syscall_end: Index: linux-2.6.17-rc4-mm2/fs/compat.c =================================================================== --- linux-2.6.17-rc4-mm2.orig/fs/compat.c 2006-05-20 20:23:11.000000000 -0700 +++ linux-2.6.17-rc4-mm2/fs/compat.c 2006-05-21 15:35:01.000000000 -0700 @@ -1329,6 +1329,26 @@ return sys_vmsplice(fd, iov, nr_segs, flags); } +asmlinkage long +compat_sys_move_pages(int pid, unsigned long nr_pages, + const compat_ulong_t __user *pages32, + const int __user *nodes, + int __user *status, + unsigned int flags) +{ + void **pages; + int i; + + pages = compat_alloc_user_space(nr_pages * sizeof(unsigned long)); + for (i = 0; i < nr_pages; i++) { + void __user *p; + if (get_user(p, pages32 + i) || + put_user(compat_ptr(p), pages + i)) + return -EFAULT; + } + return sys_move_pages(pid, nr_pages, pages, nodes, status, flags); +} + /* * Exactly like fs/open.c:sys_open(), except that it doesn't set the * O_LARGEFILE flag. Index: linux-2.6.17-rc4-mm2/include/asm-i386/unistd.h =================================================================== --- linux-2.6.17-rc4-mm2.orig/include/asm-i386/unistd.h 2006-05-20 20:23:11.000000000 -0700 +++ linux-2.6.17-rc4-mm2/include/asm-i386/unistd.h 2006-05-20 21:20:20.000000000 -0700 @@ -322,10 +322,11 @@ #define __NR_sync_file_range 314 #define __NR_tee 315 #define __NR_vmsplice 316 +#define __NR_move_pages 317 #ifdef __KERNEL__ -#define NR_syscalls 317 +#define NR_syscalls 318 /* * user-visible error numbers are in the range -1 - -128: see