Re: [patch 08/14] syslets: x86, add create_async_thread() method
- From: Evgeniy Polyakov <johnpol@xxxxxxxxxxx>
- Date: Sat, 17 Feb 2007 14:44:18 +0300
On Thu, Feb 15, 2007 at 05:52:39PM +0100, Ingo Molnar (mingo@xxxxxxx) 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- References:
- [patch 08/14] syslets: x86, add create_async_thread() method
- From: Ingo Molnar
- [patch 08/14] syslets: x86, add create_async_thread() method
- Prev by Date: Re: [RFC][PATCH] Documentation: Ask driver writers to provide suspend/resume support
- Next by Date: Re: Subject: [PATCH 2.6.20 004/005] dmfe: Add support for suspend/resume
- Previous by thread: Re: [patch 08/14] syslets: x86, add create_async_thread() method
- Next by thread: [patch 00/14] Syslets, generic asynchronous system call support, v2
- Index(es):