aboutsummaryrefslogtreecommitdiff
path: root/arch/s390/kernel/sys_s390.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-28 19:33:23 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-28 19:33:23 -0700
commit9873aed5a90aefb1642a85070c35088cca8b6a92 (patch)
treebe7d6cf2a3e0c71faa861e0c5d0c9bc4c5f40a10 /arch/s390/kernel/sys_s390.c
parent7b5573769f26a23518b33a64ec129d2833564877 (diff)
parent5aaaf9f0ed11882fe7c6bc4202f78da1baa8caba (diff)
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: [S390] Fix sclp_vt220 error handling. [S390] cio: Reorganize initialization. [S390] cio: Make CIO_* macros safe if dbfs are not available. [S390] cio: Clean up messages. [S390] Fix IRQ tracing. [S390] vmur: fix diag14_read. [S390] Wire up sys_fallocate. [S390] add types.h include to s390_ext.h [S390] cio: Remove deprecated rdc/rcd. [S390] Get rid of new section mismatch warnings. [S390] sclp: kill unused SCLP config option. [S390] cio: Remove remains of _ccw_device_get_device_number(). [S390] cio: css_sch_device_register() can be made static. [S390] Improve __smp_call_function_map. [S390] Convert to smp_call_function_single.
Diffstat (limited to 'arch/s390/kernel/sys_s390.c')
-rw-r--r--arch/s390/kernel/sys_s390.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c
index 1c90c7e9997..13e27bdb96e 100644
--- a/arch/s390/kernel/sys_s390.c
+++ b/arch/s390/kernel/sys_s390.c
@@ -265,3 +265,23 @@ s390_fadvise64_64(struct fadvise64_64_args __user *args)
return -EFAULT;
return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice);
}
+
+#ifndef CONFIG_64BIT
+/*
+ * This is a wrapper to call sys_fallocate(). For 31 bit s390 the last
+ * 64 bit argument "len" is split into the upper and lower 32 bits. The
+ * system call wrapper in the user space loads the value to %r6/%r7.
+ * The code in entry.S keeps the values in %r2 - %r6 where they are and
+ * stores %r7 to 96(%r15). But the standard C linkage requires that
+ * the whole 64 bit value for len is stored on the stack and doesn't
+ * use %r6 at all. So s390_fallocate has to convert the arguments from
+ * %r2: fd, %r3: mode, %r4/%r5: offset, %r6/96(%r15)-99(%r15): len
+ * to
+ * %r2: fd, %r3: mode, %r4/%r5: offset, 96(%r15)-103(%r15): len
+ */
+asmlinkage long s390_fallocate(int fd, int mode, loff_t offset,
+ u32 len_high, u32 len_low)
+{
+ return sys_fallocate(fd, mode, offset, ((u64)len_high << 32) | len_low);
+}
+#endif