linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Linus <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org, schwidefsky@de.ibm.com
Subject: [PATCH][COMPAT] compat_sys_fcntl{,64} 6/9 s390x part
Date: Tue, 4 Mar 2003 17:12:30 +1100	[thread overview]
Message-ID: <20030304171230.0312601d.sfr@canb.auug.org.au> (raw)
In-Reply-To: <20030304165812.7141f7c0.sfr@canb.auug.org.au>

Hi Linus,

Here is the s390x part with Martin's blessing (hopefully).
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.63-32bit.1/arch/s390x/kernel/entry.S 2.5.63-32bit.2/arch/s390x/kernel/entry.S
--- 2.5.63-32bit.1/arch/s390x/kernel/entry.S	2003-02-25 12:59:29.000000000 +1100
+++ 2.5.63-32bit.2/arch/s390x/kernel/entry.S	2003-02-25 14:35:59.000000000 +1100
@@ -452,7 +452,7 @@
         .long  SYSCALL(sys_umount,sys32_umount_wrapper)
         .long  SYSCALL(sys_ni_syscall,sys_ni_syscall) /* old lock syscall */
         .long  SYSCALL(sys_ioctl,sys32_ioctl_wrapper)
-        .long  SYSCALL(sys_fcntl,sys32_fcntl_wrapper)   /* 55 */
+        .long  SYSCALL(sys_fcntl,compat_sys_fcntl_wrapper)   /* 55 */
         .long  SYSCALL(sys_ni_syscall,sys_ni_syscall) /* intel mpx syscall */
         .long  SYSCALL(sys_setpgid,sys32_setpgid_wrapper)
         .long  SYSCALL(sys_ni_syscall,sys_ni_syscall) /* old ulimit syscall */
@@ -618,7 +618,7 @@
         .long  SYSCALL(sys_mincore,sys32_mincore_wrapper)
         .long  SYSCALL(sys_madvise,sys32_madvise_wrapper)
 	.long  SYSCALL(sys_getdents64,sys32_getdents64_wrapper)/* 220 */
-	.long  SYSCALL(sys_ni_syscall,sys32_fcntl64_wrapper)
+	.long  SYSCALL(sys_ni_syscall,compat_sys_fcntl64_wrapper)
 	.long  SYSCALL(sys_readahead,sys32_readahead)
 	.long  SYSCALL(sys_ni_syscall,sys32_sendfile64)
 	.long  SYSCALL(sys_setxattr,sys32_setxattr_wrapper)
diff -ruN 2.5.63-32bit.1/arch/s390x/kernel/linux32.c 2.5.63-32bit.2/arch/s390x/kernel/linux32.c
--- 2.5.63-32bit.1/arch/s390x/kernel/linux32.c	2003-02-25 12:59:30.000000000 +1100
+++ 2.5.63-32bit.2/arch/s390x/kernel/linux32.c	2003-02-25 14:35:59.000000000 +1100
@@ -834,57 +834,6 @@
 	return err;
 }
 
-extern asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg);
-
-asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	switch (cmd) {
-	case F_GETLK:
-		{
-			struct flock f;
-			mm_segment_t old_fs;
-			long ret;
-			
-			if(get_compat_flock(&f, (struct compat_flock *)A(arg)))
-				return -EFAULT;
-			old_fs = get_fs(); set_fs (KERNEL_DS);
-			ret = sys_fcntl(fd, cmd, (unsigned long)&f);
-			set_fs (old_fs);
-			if (ret) return ret;
-			if (f.l_start >= 0x7fffffffUL ||
-			    f.l_start + f.l_len >= 0x7fffffffUL)
-				return -EOVERFLOW;
-			if(put_compat_flock(&f, (struct compat_flock *)A(arg)))
-				return -EFAULT;
-			return 0;
-		}
-	case F_SETLK:
-	case F_SETLKW:
-		{
-			struct flock f;
-			mm_segment_t old_fs;
-			long ret;
-			
-			if(get_compat_flock(&f, (struct compat_flock *)A(arg)))
-				return -EFAULT;
-			old_fs = get_fs(); set_fs (KERNEL_DS);
-			ret = sys_fcntl(fd, cmd, (unsigned long)&f);
-			set_fs (old_fs);
-			if (ret) return ret;
-			return 0;
-		}
-	default:
-		return sys_fcntl(fd, cmd, (unsigned long)arg);
-	}
-}
-
-asmlinkage long sys32_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	if (cmd >= F_GETLK64 && cmd <= F_SETLKW64)
-		return sys_fcntl(fd, cmd + F_GETLK - F_GETLK64, arg);
-	return sys32_fcntl(fd, cmd, arg);
-}
-
 extern asmlinkage long sys_truncate(const char * path, unsigned long length);
 extern asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);
 
diff -ruN 2.5.63-32bit.1/arch/s390x/kernel/linux32.h 2.5.63-32bit.2/arch/s390x/kernel/linux32.h
--- 2.5.63-32bit.1/arch/s390x/kernel/linux32.h	2003-01-17 14:01:01.000000000 +1100
+++ 2.5.63-32bit.2/arch/s390x/kernel/linux32.h	2003-02-25 14:35:59.000000000 +1100
@@ -21,10 +21,6 @@
         __s32   msgtyp;
 };
 
-#define F_GETLK64       12
-#define F_SETLK64       13
-#define F_SETLKW64      14    
-
 struct old_sigaction32 {
        __u32			sa_handler;	/* Really a pointer, but need to deal with 32 bits */
        compat_old_sigset_t	sa_mask;	/* A 32 bit mask */
diff -ruN 2.5.63-32bit.1/arch/s390x/kernel/wrapper32.S 2.5.63-32bit.2/arch/s390x/kernel/wrapper32.S
--- 2.5.63-32bit.1/arch/s390x/kernel/wrapper32.S	2003-02-25 12:59:30.000000000 +1100
+++ 2.5.63-32bit.2/arch/s390x/kernel/wrapper32.S	2003-02-25 14:35:59.000000000 +1100
@@ -227,12 +227,12 @@
 	llgfr	%r4,%r4			# unsigned int
 	jg	sys32_ioctl		# branch to system call
 
-	.globl  sys32_fcntl_wrapper 
-sys32_fcntl_wrapper:
+	.globl  compat_sys_fcntl_wrapper 
+compat_sys_fcntl_wrapper:
 	llgfr	%r2,%r2			# unsigned int
 	llgfr	%r3,%r3			# unsigned int 
 	llgfr	%r4,%r4			# unsigned long
-	jg	sys32_fcntl		# branch to system call
+	jg	compat_sys_fcntl	# branch to system call
 
 	.globl  sys32_setpgid_wrapper 
 sys32_setpgid_wrapper:
@@ -1050,12 +1050,12 @@
 	llgfr	%r4,%r4			# unsigned int
 	jg	sys_getdents64		# branch to system call
 
-	.globl  sys32_fcntl64_wrapper 
-sys32_fcntl64_wrapper:
+	.globl  compat_sys_fcntl64_wrapper 
+compat_sys_fcntl64_wrapper:
 	llgfr	%r2,%r2			# unsigned int
 	llgfr	%r3,%r3			# unsigned int 
 	llgfr	%r4,%r4			# unsigned long
-	jg	sys32_fcntl64		# branch to system call
+	jg	compat_sys_fcntl64	# branch to system call
 
 	.globl	sys32_stat64_wrapper
 sys32_stat64_wrapper:
diff -ruN 2.5.63-32bit.1/include/asm-s390x/compat.h 2.5.63-32bit.2/include/asm-s390x/compat.h
--- 2.5.63-32bit.1/include/asm-s390x/compat.h	2003-02-25 12:59:57.000000000 +1100
+++ 2.5.63-32bit.2/include/asm-s390x/compat.h	2003-02-25 14:35:59.000000000 +1100
@@ -64,7 +64,18 @@
 	compat_off_t	l_start;
 	compat_off_t	l_len;
 	compat_pid_t	l_pid;
-	short		__unused;
+};
+
+#define F_GETLK64       12
+#define F_SETLK64       13
+#define F_SETLKW64      14    
+
+struct compat_flock64 {
+	short		l_type;
+	short		l_whence;
+	compat_loff_t	l_start;
+	compat_loff_t	l_len;
+	compat_pid_t	l_pid;
 };
 
 struct compat_statfs {
@@ -87,4 +98,7 @@
 
 typedef u32		compat_sigset_word;
 
+#define COMPAT_OFF_T_MAX	0x7fffffff
+#define COMPAT_LOFF_T_MAX	0x7fffffffffffffffL
+
 #endif /* _ASM_S390X_COMPAT_H */
diff -ruN 2.5.63-32bit.1/include/asm-s390x/fcntl.h 2.5.63-32bit.2/include/asm-s390x/fcntl.h
--- 2.5.63-32bit.1/include/asm-s390x/fcntl.h	2001-11-10 09:11:15.000000000 +1100
+++ 2.5.63-32bit.2/include/asm-s390x/fcntl.h	2003-02-25 14:35:59.000000000 +1100
@@ -80,6 +80,4 @@
 
 #define F_LINUX_SPECIFIC_BASE  1024
 
-#define flock64   flock
-
 #endif

  parent reply	other threads:[~2003-03-04  6:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-04  5:58 [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part Stephen Rothwell
2003-03-04  6:00 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 2/9 PPC64 part Stephen Rothwell
2003-03-04  6:02 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 3/9 SPARC64 part Stephen Rothwell
2003-03-04  6:06 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 4/9 x86_64 part Stephen Rothwell
2003-03-04  6:10 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 5/9 ia64 part Stephen Rothwell
2003-03-04  6:12 ` Stephen Rothwell [this message]
2003-03-04  6:15 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 7/9 MIPS64 part Stephen Rothwell
2003-03-04  6:17 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 8/9 PARISC part Stephen Rothwell
2003-03-04  6:20 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 9/9 Alpha part Stephen Rothwell
2003-03-11  0:41 [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part Stephen Rothwell
2003-03-11  0:57 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 6/9 s390x part Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030304171230.0312601d.sfr@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).