All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carsten Langgaard <carstenl@mips.com>
To: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
Subject: 64-bit kernel patch.
Date: Wed, 02 Oct 2002 15:22:59 +0200	[thread overview]
Message-ID: <3D9AF333.BC304A34@mips.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 550 bytes --]

I have a number of patches for the o32 syscall wrapper/conversion
routines, which is needed when running a 64-bit kernel on an o32
userland.
Here is the first one. Ralf, could you please apply it, so I can send
the next one.

/Carsten




--
_    _ ____  ___   Carsten Langgaard   Mailto:carstenl@mips.com
|\  /|||___)(___   MIPS Denmark        Direct: +45 4486 5527
| \/ |||    ____)  Lautrupvang 4B      Switch: +45 4486 5555
  TECHNOLOGIES     2750 Ballerup       Fax...: +45 4486 5556
                   Denmark             http://www.mips.com



[-- Attachment #2: syscall_wrapper.part1.patch --]
[-- Type: text/plain, Size: 1670 bytes --]

Index: arch/mips64/kernel/linux32.c
===================================================================
RCS file: /home/cvs/linux/arch/mips64/kernel/linux32.c,v
retrieving revision 1.42.2.12
diff -u -r1.42.2.12 linux32.c
--- arch/mips64/kernel/linux32.c	27 Sep 2002 23:29:17 -0000	1.42.2.12
+++ arch/mips64/kernel/linux32.c	2 Oct 2002 13:13:42 -0000
@@ -179,7 +179,32 @@
 	return err;
 }
 
-asmlinkage int sys_mmap2(void) {return 0;}
+asmlinkage unsigned long
+sys32_mmap2(unsigned long addr, size_t len, unsigned long prot,
+         unsigned long flags, unsigned long fd, unsigned long pgoff)
+{
+	struct file * file = NULL;
+	unsigned long error;
+
+	error = -EINVAL;
+	if (!(flags & MAP_ANONYMOUS)) {
+		error = -EBADF;
+		file = fget(fd);
+		if (!file)
+			goto out;
+	}
+	flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
+
+	down_write(&current->mm->mmap_sem);
+	error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
+	up_write(&current->mm->mmap_sem);
+	if (file)
+		fput(file);
+
+out:
+	return error;
+}
+
 
 asmlinkage long sys_truncate(const char * path, unsigned long length);
 
Index: arch/mips64/kernel/scall_o32.S
===================================================================
RCS file: /home/cvs/linux/arch/mips64/kernel/scall_o32.S,v
retrieving revision 1.48.2.15
diff -u -r1.48.2.15 scall_o32.S
--- arch/mips64/kernel/scall_o32.S	11 Sep 2002 13:56:36 -0000	1.48.2.15
+++ arch/mips64/kernel/scall_o32.S	2 Oct 2002 13:13:42 -0000
@@ -522,7 +522,7 @@
 	sys	sys_sendfile	4
 	sys	sys_ni_syscall	0
 	sys	sys_ni_syscall	0
-	sys	sys_mmap2	6			/* 4210 */
+	sys	sys32_mmap2	6			/* 4210 */
 	sys	sys_truncate64	2
 	sys	sys_ftruncate64	2
 	sys	sys_newstat	2

             reply	other threads:[~2002-10-02 13:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-02 13:22 Carsten Langgaard [this message]
2002-10-02 13:40 ` 64-bit kernel patch Maciej W. Rozycki
2002-10-02 13:44   ` Carsten Langgaard
2002-10-02 13:46   ` Ralf Baechle
2002-10-02 14:02     ` Carsten Langgaard
2002-10-02 14:06       ` Ralf Baechle
2002-10-02 14:05   ` Carsten Langgaard
2002-10-02 14:09     ` Ralf Baechle
2002-10-02 14:33       ` Carsten Langgaard
2002-10-03  6:49       ` Carsten Langgaard
2002-10-03 11:39       ` Maciej W. Rozycki
2002-10-04  6:39         ` Carsten Langgaard
2002-10-04 12:43           ` Maciej W. Rozycki
  -- strict thread matches above, loose matches on Subject: below --
2002-10-10 11:26 Carsten Langgaard
2002-10-10 11:41 ` Ralf Baechle
2002-09-09 12:16 Carsten Langgaard
2002-09-09 13:03 ` Carsten Langgaard

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=3D9AF333.BC304A34@mips.com \
    --to=carstenl@mips.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.