3 * Copyright (C) Igor Sysoev
7 #include <sys/syscall.h>
8 #include <machine/asm.h>
11 * rfork_thread(3) - rfork_thread(flags, stack, func, arg);
14 #define KERNCALL int $0x80
21 mov 12(%ebp), %esi # the thread stack address
24 mov 20(%ebp), %eax # the thread argument
28 mov 16(%ebp), %eax # the thread start address
31 push 8(%ebp) # rfork(2) flags
49 call *%eax # call a thread start address ...
54 mov $SYS_exit, %eax # ... and exit(2) after a thread would return
63 /* libc's cerror: jmp PIC_PLT(HIDENAME(cerror)) */
66 call PIC_PLT(CNAME(__error))