[klibc] [PATCH] vfork() for parisc

H. Peter Anvin hpa at zytor.com
Tue Jul 25 14:58:02 PDT 2006


Kyle McMartin wrote:
> Implement "pid_t vfork(void)" for parisc.
> 

> --- /dev/null
> +++ b/usr/klibc/arch/parisc/vfork.S
> @@ -0,0 +1,31 @@
> +/*
> + * arch/parisc/vfork.S, "vfork() me harder. ugh." -- kyle
> + *
> + * %r20 contains the system call number, %rp contains whence we came,
> + * %rp is saved and restored across the syscall, thankfully.
> + *
> + */

Dumb question... where does %r20 get set?  This isn't invoked by a 
system call stub; it's the entire function.

> +
> +	.text
> +	.align 64				; cache-width aligned
> +	.globl	vfork
> +	.type	vfork, at function
> +vfork:
> +	/* pid_t vfork(void) */
> +	ble		0x100(%sr2, %r0)	; jump to gateway page
> +	nop
> +
> +	ldi		-0x1000,%r19		; %r19 = -4096
> +	sub		%r0,%ret0,%r22		; %r22 = -%ret0
> +	cmpb,>>=,n	%r19,%ret0,1f		; if %ret0 >= -4096UL
> +	ldi		-1,%ret0		; nullified on taken forward
> +
> +	/* store %r22 to errno... */
> +	ldil		L%errno,%r1
> +	ldo		R%errno(%r1),%r1
> +	stw		%r22,0(%r1)
> +1:
> +	bv		%r0(%rp)		; jump back
> +	nop
> +
> +	.size vfork,.-vfork
> 
> _______________________________________________
> klibc mailing list
> klibc at zytor.com
> http://www.zytor.com/mailman/listinfo/klibc



More information about the klibc mailing list