Re: [patch 08/14] syslets: x86, add create_async_thread() method

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 15, 2007 at 05:52:39PM +0100, Ingo Molnar ([email protected]) wrote:
> +/*
> + * Create an async thread
> + */
> +int create_async_thread(int (*fn)(void *), void * arg, unsigned long flags)
> +{
> +	struct pt_regs regs;
> +
> +	memset(&regs, 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, &regs, 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux