From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Arjan van de Ven <arjan@infradead.org>,
Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@zip.com.au>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Ulrich Drepper <drepper@redhat.com>,
Zach Brown <zach.brown@oracle.com>,
"David S. Miller" <davem@davemloft.net>,
Suparna Bhattacharya <suparna@in.ibm.com>,
Davide Libenzi <davidel@xmailserver.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [patch 08/14] syslets: x86, add create_async_thread() method
Date: Sat, 17 Feb 2007 14:44:18 +0300 [thread overview]
Message-ID: <20070217114418.GA6725@2ka.mipt.ru> (raw)
In-Reply-To: <20070215165239.GI4285@elte.hu>
On Thu, Feb 15, 2007 at 05:52:39PM +0100, Ingo Molnar (mingo@elte.hu) wrote:
> +/*
> + * Create an async thread
> + */
> +int create_async_thread(int (*fn)(void *), void * arg, unsigned long flags)
> +{
> + struct pt_regs regs;
> +
> + memset(®s, 0, sizeof(regs));
> +
> + regs.ebx = (unsigned long) fn;
> + regs.edx = (unsigned long) arg;
> +
> + regs.xds = __USER_DS;
> + regs.xes = __USER_DS;
> + regs.xgs = __KERNEL_PDA;
> + regs.orig_eax = -1;
> + regs.eip = (unsigned long) async_thread_helper;
> + regs.xcs = __KERNEL_CS | get_kernel_rpl();
> + regs.eflags = X86_EFLAGS_IF | X86_EFLAGS_SF | X86_EFLAGS_PF | 0x2;
> +
> + /* Ok, create the new task.. */
> + return do_fork(flags, 0, ®s, 0, NULL, NULL);
> +}
What about complete disabling of signals and only enabling them in the
thread which returns to userspace?
--
Evgeniy Polyakov
prev parent reply other threads:[~2007-02-17 11:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-15 16:52 Ingo Molnar
2007-02-15 19:14 ` Davide Libenzi
2007-02-17 11:44 ` Evgeniy Polyakov [this message]
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=20070217114418.GA6725@2ka.mipt.ru \
--to=johnpol@2ka.mipt.ru \
--cc=akpm@zip.com.au \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arjan@infradead.org \
--cc=davem@davemloft.net \
--cc=davidel@xmailserver.org \
--cc=drepper@redhat.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=suparna@in.ibm.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=zach.brown@oracle.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®