From: Arnd Bergmann <arnd@arndb.de>
To: liqin.chen@sunplusct.com
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
torvalds@linux-foundation.org
Subject: Re: [PATCH 22/27] score: create kernel files signal.c sys_score.c time.c
Date: Tue, 9 Jun 2009 19:52:47 +0200 [thread overview]
Message-ID: <200906091952.47842.arnd@arndb.de> (raw)
In-Reply-To: <OF32AB4A20.4574C065-ON482575D0.00243CB1-482575D0.0024AD26@sunplusct.com>
On Tuesday 09 June 2009, liqin.chen@sunplusct.com wrote:
> +asmlinkage long sys_mmap(unsigned long addr, size_t len,
> + unsigned long prot, unsigned long flags,
> + unsigned long fd, off_t offset)
> +{
> + int err = -EINVAL;
> +
> + if (offset & ~PAGE_MASK) {
> + printk(KERN_INFO "no pagemask in mmap\r\n");
> + goto out;
> + }
> +
> + err = sys_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
> +out:
> + return err;
> +}
A 32 bit kernel should only need sys_mmap2, not sys_mmap, because it is
trivial to convert in user space.
> +
> +asmlinkage long score_vfork(struct pt_regs *regs)
> +{
> + return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->regs[0],
> + regs, 0, NULL, NULL);
> +}
> +
> +/*
> + * Fork a new task - this creates a new program thread.
> + * This is called indirectly via a small wrapper
> + */
> +asmlinkage int
> +score_fork(struct pt_regs *regs)
> +{
> + return do_fork(SIGCHLD, regs->regs[0], regs, 0, NULL, NULL);
> +}
Similarly, you should not need vfork and fork any more, because they can
be handled in user space through clone().
Arnd <><
next prev parent reply other threads:[~2009-06-09 17:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-09 6:36 [PATCH 22/27] score: create kernel files signal.c sys_score.c time.c liqin.chen
2009-06-09 8:51 ` Thomas Gleixner
2009-06-13 6:26 ` liqin.chen
2009-06-13 6:26 ` liqin.chen
2009-06-09 17:52 ` Arnd Bergmann [this message]
2009-06-09 17:52 ` Arnd Bergmann
2009-06-13 6:43 ` liqin.chen
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=200906091952.47842.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=akpm@linux-foundation.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liqin.chen@sunplusct.com \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox