vfork.s

来自「klibc精简化的c程序库」· S 代码 · 共 43 行

S
43
字号
/* * ia64 specific vfork syscall * * Written By:	 Martin Hicks <mort@wildopensource.com> * *//* This syscall is a special case of the clone syscall */#include <asm/unistd.h>#include <asm/signal.h>#include <klibc/archsys.h>/* These are redefined here because linux/sched.h isn't safe for * inclusion in asm. */#define CLONE_VM    0x00000100 /* set if VM shared between processes */#define CLONE_VFORK 0x00004000 /* set if parent wants the child to wake it up on exit *//* pid_t vfork(void) *//* Implemented as clone(CLONE_VFORK | CLONE_VM | SIGCHLD, 0) */	.align 32	.proc vfork	.global vforkvfork:	alloc r2=ar.pfs,0,0,2,0	mov	r15=__NR_clone	mov	out0=CLONE_VM|CLONE_VFORK|SIGCHLD	mov     out1=0	;;	break 0x100000      // Do the syscall	;;	addl	r15=0,r1	cmp.eq  p7,p6 = -1,r10	;;	ld8	r14=[r15]	;;(p7)	st4	[r14]=r8	;;(p7)	mov	r8=-1	br.ret.sptk.many b0	.endp vfork

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?