From: Stephen Rothwell <sfr@canb.auug.org.au>
To: ralf@gnu.org
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: [PATCH][COMPAT] compat_sys_fcntl{,64} 7/9 mips64 part
Date: Tue, 11 Mar 2003 11:59:34 +1100 [thread overview]
Message-ID: <20030311115934.2726727a.sfr@canb.auug.org.au> (raw)
In-Reply-To: <20030311114113.44abed66.sfr@canb.auug.org.au>
Hi Ralf,
Here is the mips64 part of the patch. Please apply after Linus has applied
the generic part. This patch also depend on the previous compatibility
patch I sent you.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN 2.5.64-2003030918-32bit.1/arch/mips64/kernel/linux32.c 2.5.64-2003030918-32bit.2/arch/mips64/kernel/linux32.c
--- 2.5.64-2003030918-32bit.1/arch/mips64/kernel/linux32.c 2003-03-05 15:59:10.000000000 +1100
+++ 2.5.64-2003030918-32bit.2/arch/mips64/kernel/linux32.c 2003-03-09 20:34:44.000000000 +1100
@@ -1068,50 +1068,6 @@
return sys_setsockopt(fd, level, optname, optval, optlen);
}
-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:
- case F_SETLK:
- case F_SETLKW:
- {
- struct flock f;
- mm_segment_t old_fs;
- long ret;
-
- if (get_compat_flock(&f, (struct compat_flock *)arg))
- return -EFAULT;
- old_fs = get_fs(); set_fs (KERNEL_DS);
- ret = sys_fcntl(fd, cmd, (unsigned long)&f);
- set_fs (old_fs);
- if (put_compat_flock(&f, (struct compat_flock *)arg))
- return -EFAULT;
- return ret;
- }
- default:
- return sys_fcntl(fd, cmd, (unsigned long)arg);
- }
-}
-
-asmlinkage long
-sys32_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
- switch (cmd) {
- case F_GETLK64:
- return sys_fcntl(fd, F_GETLK, arg);
- case F_SETLK64:
- return sys_fcntl(fd, F_SETLK, arg);
- case F_SETLKW64:
- return sys_fcntl(fd, F_SETLKW, arg);
- }
-
- return sys32_fcntl(fd, cmd, arg);
-}
-
struct msgbuf32 { s32 mtype; char mtext[1]; };
struct ipc_perm32
diff -ruN 2.5.64-2003030918-32bit.1/arch/mips64/kernel/scall_o32.S 2.5.64-2003030918-32bit.2/arch/mips64/kernel/scall_o32.S
--- 2.5.64-2003030918-32bit.1/arch/mips64/kernel/scall_o32.S 2003-03-05 15:59:10.000000000 +1100
+++ 2.5.64-2003030918-32bit.2/arch/mips64/kernel/scall_o32.S 2003-03-09 20:34:44.000000000 +1100
@@ -288,7 +288,7 @@
sys sys_umount 2
sys sys_ni_syscall 0
sys sys32_ioctl 3
- sys sys32_fcntl 3 /* 4055 */
+ sys compat_sys_fcntl 3 /* 4055 */
sys sys_ni_syscall 2
sys sys_setpgid 2
sys sys_ni_syscall, 0
@@ -453,7 +453,7 @@
sys sys_mincore 3
sys sys_madvise 3
sys sys_getdents64 3
- sys sys32_fcntl64 3 /* 4220 */
+ sys compat_sys_fcntl64 3 /* 4220 */
sys sys32_gettid 0
sys sys32_tkill 2
.endm
diff -ruN 2.5.64-2003030918-32bit.1/include/asm-mips64/compat.h 2.5.64-2003030918-32bit.2/include/asm-mips64/compat.h
--- 2.5.64-2003030918-32bit.1/include/asm-mips64/compat.h 2003-03-05 15:59:10.000000000 +1100
+++ 2.5.64-2003030918-32bit.2/include/asm-mips64/compat.h 2003-03-09 20:34:45.000000000 +1100
@@ -62,8 +62,21 @@
short l_whence;
compat_off_t l_start;
compat_off_t l_len;
+ s32 l_sysid; /* ABI junk, unused on Linux */
+ compat_pid_t l_pid;
+ s32 pad[4]; /* ABI junk, unused on Linux */
+};
+
+#define F_GETLK64 33 /* using 'struct flock64' */
+#define F_SETLK64 34
+#define F_SETLKW64 35
+
+struct compat_flock64 {
+ short l_type;
+ short l_whence;
+ compat_loff_t l_start;
+ compat_loff_t l_len;
compat_pid_t l_pid;
- short __unused;
};
struct compat_statfs {
@@ -87,4 +100,7 @@
typedef u32 compat_sigset_word;
+#define COMPAT_OFF_T_MAX 0x7fffffff
+#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
+
#endif /* _ASM_MIPS64_COMPAT_H */
diff -ruN 2.5.64-2003030918-32bit.1/include/asm-mips64/fcntl.h 2.5.64-2003030918-32bit.2/include/asm-mips64/fcntl.h
--- 2.5.64-2003030918-32bit.1/include/asm-mips64/fcntl.h 2001-09-10 03:43:02.000000000 +1000
+++ 2.5.64-2003030918-32bit.2/include/asm-mips64/fcntl.h 2003-03-09 20:34:45.000000000 +1100
@@ -43,12 +43,6 @@
#define F_SETSIG 10 /* for sockets. */
#define F_GETSIG 11 /* for sockets. */
-#ifdef __KERNEL__
-#define F_GETLK64 33 /* using 'struct flock64' */
-#define F_SETLK64 34
-#define F_SETLKW64 35
-#endif
-
/* for F_[GET|SET]FL */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
@@ -86,10 +80,6 @@
long pad[4]; /* ZZZZZZZZZZZZZZZZZZZZZZZZZZ */
} flock_t;
-#ifdef __KERNEL__
-#define flock64 flock
-#endif
-
#define F_LINUX_SPECIFIC_BASE 1024
#endif /* _ASM_FCNTL_H */
next prev parent reply other threads:[~2003-03-11 0:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-11 0:41 [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part Stephen Rothwell
2003-03-11 0:47 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 2/9 ppc64 part Stephen Rothwell
2003-03-11 0:50 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 3/9 sparc64 part Stephen Rothwell
2003-03-11 23:42 ` David S. Miller
2003-03-12 4:51 ` Anton Blanchard
2003-03-11 0:52 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 4/9 x86_64 part Stephen Rothwell
2003-03-11 0:54 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 5/9 ia64 part Stephen Rothwell
2003-03-11 0:57 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 6/9 s390x part Stephen Rothwell
2003-03-11 0:59 ` Stephen Rothwell [this message]
2003-03-11 1:01 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 8/9 parisc part Stephen Rothwell
2003-03-11 1:08 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 9/9 Aalpha part Stephen Rothwell
-- strict thread matches above, loose matches on Subject: below --
2003-03-04 5:58 [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part Stephen Rothwell
2003-03-04 6:15 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 7/9 MIPS64 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=20030311115934.2726727a.sfr@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=ralf@gnu.org \
--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
all inboxes | Powered by JetHome®