[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20070217114418.GA6725@2ka.mipt.ru>
Date: Sat, 17 Feb 2007 14:44:18 +0300
From: Evgeniy Polyakov <johnpol@....mipt.ru>
To: Ingo Molnar <mingo@...e.hu>
Cc: linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Arjan van de Ven <arjan@...radead.org>,
Christoph Hellwig <hch@...radead.org>,
Andrew Morton <akpm@....com.au>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Ulrich Drepper <drepper@...hat.com>,
Zach Brown <zach.brown@...cle.com>,
"David S. Miller" <davem@...emloft.net>,
Suparna Bhattacharya <suparna@...ibm.com>,
Davide Libenzi <davidel@...ilserver.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [patch 08/14] syslets: x86, add create_async_thread() method
On Thu, Feb 15, 2007 at 05:52:39PM +0100, Ingo Molnar (mingo@...e.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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists