[PATCH] [POWERPC] Wire up sys_sync_file_range

Stephen Rothwell sfr at canb.auug.org.au
Fri Mar 9 15:22:01 EST 2007


This requires an architecture specific compat routine as u64s are passed
in odd/even (high/low) register pairs on ppc32.

Signed-off-by: Stephen Rothwell <sfr at canb.auug.org.au>
---
 arch/powerpc/kernel/sys_ppc32.c |    9 +++++++++
 include/asm-powerpc/systbl.h    |    1 +
 include/asm-powerpc/unistd.h    |    3 ++-
 3 files changed, 12 insertions(+), 1 deletions(-)

David, the other two missing syscalls were wired up in the previous patch
set I sent today.  Thanks for your patch to push us along.

-- 
Cheers,
Stephen Rothwell                    sfr at canb.auug.org.au

diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index 673e8d9..b282035 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -814,3 +814,12 @@ asmlinkage long compat_sys_request_key(const char __user *_type,
 	return sys_request_key(_type, _description, _callout_info, destringid);
 }
 
+asmlinkage long compat_sys_sync_file_range(int fd, u32 unused,
+		u32 offset_high, u32 offset_low,
+		u32 nbytes_high, u32 nbytes_low,
+		compat_uint_t flags)
+{
+	return sys_sync_file_range(fd, (loff_t)offset_high << 32 | offset_low,
+			(loff_t)nbytes_high << 32 | nbytes_low,
+			(unsigned int)flags);
+}
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h
index 8d853c5..3676a20 100644
--- a/include/asm-powerpc/systbl.h
+++ b/include/asm-powerpc/systbl.h
@@ -307,3 +307,4 @@ COMPAT_SYS_SPU(set_robust_list)
 COMPAT_SYS_SPU(move_pages)
 SYSCALL_SPU(getcpu)
 COMPAT_SYS(epoll_pwait)
+COMPAT_SYS_SPU(sync_file_range)
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index 2baedbe..17c2b96 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -326,10 +326,11 @@
 #define __NR_move_pages		301
 #define __NR_getcpu		302
 #define __NR_epoll_pwait	303
+#define __NR_sync_file_range	304
 
 #ifdef __KERNEL__
 
-#define __NR_syscalls		304
+#define __NR_syscalls		305
 
 #define __NR__exit __NR_exit
 #define NR_syscalls	__NR_syscalls
-- 
1.5.0.3




More information about the Linuxppc-dev mailing list