android_kernel_xiaomi_sdm845/arch/um/kernel
Jeff Dike 3c91735099 [PATCH] uml: thread creation tidying
fork on UML has always somewhat subtle.  The underlying cause has been the
need to initialize a stack for the new process.  The only portable way to
initialize a new stack is to set it as the alternate signal stack and take a
signal.  The signal handler does whatever initialization is needed and jumps
back to the original stack, where the fork processing is finished.  The basic
context switching mechanism is a jmp_buf for each process.  You switch to a
new process by longjmping to its jmp_buf.

Now that UML has its own implementation of setjmp and longjmp, and I can poke
around inside a jmp_buf without fear that libc will change the structure, a
much simpler mechanism is possible.  The jmpbuf can simply be initialized by
hand.

This eliminates -
	the need to set up and remove the alternate signal stack
	sending and handling a signal
	the signal blocking needed around the stack switching, since
there is no stack switching
	setting up the jmp_buf needed to jump back to the original
stack after the new one is set up

In addition, since jmp_buf is now defined by UML, and not by libc, it can be
embedded in the thread struct.  This makes it unnecessary to have it exist on
the stack, where it used to be.  It also simplifies interfaces, since the
switch jmp_buf used to be a void * inside the thread struct, and functions
which took it as an argument needed to define a jmp_buf variable and assign it
from the void *.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-27 08:26:16 -07:00
..
skas [PATCH] uml: thread creation tidying 2006-09-27 08:26:16 -07:00
tt [PATCH] uml: remove syscall debugging 2006-07-10 13:24:24 -07:00
asm-offsets.c [PATCH] uml: fix missing KBUILD_BASENAME 2006-01-11 18:42:09 -08:00
config.c.in Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
dyn.lds.S [PATCH] vDSO hash-style fix 2006-07-31 13:28:43 -07:00
exec.c [PATCH] UML: tty locking 2006-09-26 08:49:09 -07:00
exitcode.c [PATCH] uml: Clean up prink calls 2005-07-28 21:46:05 -07:00
gmon_syms.c [PATCH] uml: fix gcov support 2006-09-27 08:26:16 -07:00
gprof_syms.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
init_task.c [PATCH] uml: move libc code out of mem_user.c and tempfile.c 2005-09-17 11:50:00 -07:00
initrd.c [PATCH] uml: initrd cleanup 2005-05-20 15:48:18 -07:00
irq.c [PATCH] uml: SIGIO cleanups 2006-09-26 08:49:07 -07:00
ksyms.c [PATCH] uml: mark some tt-mode code 2006-09-27 08:26:16 -07:00
Makefile [PATCH] uml: move _kern.c files 2006-07-10 13:24:24 -07:00
mem.c [PATCH] uml: get rid of ZONE_DMA use 2006-09-27 08:26:15 -07:00
physmem.c [PATCH] uml: fix static binary segfault 2006-07-10 13:24:23 -07:00
process_kern.c [PATCH] uml: Fix stack alignment 2006-09-26 08:49:05 -07:00
ptrace.c [PATCH] drop task argument of audit_syscall_{entry,exit} 2006-05-01 06:06:18 -04:00
reboot.c [PATCH] uml: Use ARRAY_SIZE more assiduously 2006-09-26 08:49:05 -07:00
resource.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sigio.c [PATCH] uml: move _kern.c files 2006-07-10 13:24:24 -07:00
signal.c [PATCH] uml: move _kern.c files 2006-07-10 13:24:24 -07:00
smp.c [PATCH] pidhash: don't count idle threads 2006-03-28 18:36:41 -08:00
syscall.c [PATCH] UML - fix utsname build breakage 2006-07-15 14:42:24 -07:00
sysrq.c [PATCH] uml: Fix sysrq-r support for skas mode 2005-10-04 13:22:01 -07:00
time.c [PATCH] uml: Remove unused variable 2006-09-26 08:49:08 -07:00
tlb.c [PATCH] uml: Whitespace fixes 2006-09-26 08:49:06 -07:00
trap.c [PATCH] uml: use correct SIGBUS handler 2006-09-27 08:26:16 -07:00
uaccess.c [PATCH] uml: separate libc-dependent uaccess code 2005-11-07 07:53:31 -08:00
um_arch.c [PATCH] uml: const more data 2006-09-27 08:26:15 -07:00
umid.c [PATCH] uml: umid cleanup 2006-01-06 08:33:47 -08:00
uml.lds.S [PATCH] uml: fix static binary segfault 2006-07-10 13:24:23 -07:00
vmlinux.lds.S [PATCH] uml: tidy biarch gcc support 2006-07-14 21:53:52 -07:00