android_kernel_xiaomi_sm8350/arch/um/include
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
sysdep-i386 [PATCH] uml: thread creation tidying 2006-09-27 08:26:16 -07:00
sysdep-ia64
sysdep-ppc
sysdep-x86_64 [PATCH] uml: thread creation tidying 2006-09-27 08:26:16 -07:00
tt [PATCH] uml: fix static binary segfault 2006-07-10 13:24:23 -07:00
aio.h [PATCH] uml: revert block driver use of host AIO 2005-10-12 08:22:26 -07:00
chan_kern.h [PATCH] uml: const more data 2006-09-27 08:26:15 -07:00
chan_user.h [PATCH] uml: const more data 2006-09-27 08:26:15 -07:00
choose-mode.h [PATCH] uml: better diagnostics for broken configs 2006-01-06 08:33:47 -08:00
common-offsets.h [PATCH] uml makefiles sanitized 2005-09-29 08:46:26 -07:00
elf_user.h
frame_kern.h
init.h [PATCH] uml: fix ((unused)) attribute 2006-02-24 14:31:37 -08:00
initrd.h
irq_kern.h
irq_user.h [PATCH] uml: remove spinlock wrapper functions 2006-07-10 13:24:23 -07:00
kern_util.h [PATCH] uml: const more data 2006-09-27 08:26:15 -07:00
kern.h [PATCH] uml: fix declaration of exit() 2006-03-27 08:44:37 -08:00
line.h [PATCH] uml: const more data 2006-09-27 08:26:15 -07:00
longjmp.h [PATCH] uml: Use klibc setjmp/longjmp 2006-09-26 08:49:05 -07:00
mconsole_kern.h
mconsole.h [PATCH] uml: add mconsole_reply variant with length param 2006-01-06 08:33:47 -08:00
mem_kern.h
mem_user.h [PATCH] UML: Hotplug memory, take 2 2006-03-31 12:18:50 -08:00
mem.h
misc_constants.h [PATCH] uml: move libc-dependent irq code to os-Linux 2006-03-27 08:44:37 -08:00
mode_kern.h [PATCH] uml: move headers to arch/um/include 2006-01-18 19:20:19 -08:00
mode.h
net_kern.h [PATCH] uml: const more data 2006-09-27 08:26:15 -07:00
net_user.h [PATCH] uml: clean our set_ether_mac 2006-09-26 08:49:09 -07:00
os.h [PATCH] uml: thread creation tidying 2006-09-27 08:26:16 -07:00
process.h
ptrace_user.h
registers.h [PATCH] uml: stack usage reduction 2006-09-26 08:49:09 -07:00
sigcontext.h
sigio.h [PATCH] uml: move sigio_user.c to os-Linux/sigio.c 2006-03-27 08:44:38 -08:00
signal_kern.h
skas_ptrace.h
skas_ptregs.h [PATCH] uml makefiles sanitized 2005-09-29 08:46:26 -07:00
syscall.h
sysrq.h
task.h [PATCH] uml makefiles sanitized 2005-09-29 08:46:26 -07:00
tempfile.h
tlb.h [PATCH] mm: uml kill unused 2005-10-29 21:40:42 -07:00
ubd_user.h
um_mmu.h
um_uaccess.h [PATCH] uml: fix compile error for tt 2005-12-12 08:57:43 -08:00
umid.h
uml_uaccess.h [PATCH] uml: separate libc-dependent uaccess code 2005-11-07 07:53:31 -08:00
user_util.h [PATCH] uml: request format warnings to GCC for appropriate functions 2006-04-11 06:18:35 -07:00
user.h [PATCH] uml: request format warnings to GCC for appropriate functions 2006-04-11 06:18:35 -07:00