3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Nginx, Inc.
8 #include <sys/syscall.h>
9 #include <machine/asm.h>
12 * rfork_thread(3) - rfork_thread(flags, stack, func, arg);
15 #define KERNCALL int $0x80
22 mov 12(%ebp), %esi # the thread stack address
25 mov 20(%ebp), %eax # the thread argument
29 mov 16(%ebp), %eax # the thread start address
32 push 8(%ebp) # rfork(2) flags
50 call *%eax # call a thread start address ...
55 mov $SYS_exit, %eax # ... and exit(2) after a thread would return
64 /* libc's cerror: jmp PIC_PLT(HIDENAME(cerror)) */
67 call PIC_PLT(CNAME(__error))