File:  [DVB] / dietlibc / sparc / clone.S
Revision 1.6: download - view: text, annotated - select for diffs
Thu May 15 15:17:10 2003 UTC (21 years ago) by sanjiyan
Branches: MAIN
CVS tags: HEAD
- removing "<arch>/mmap.*" where no arch-specific impementation is needed.
  (added "syscalls.s/mmap.S")

- fixing the vsyscall in the dynamic library... (self made problem)

- removing warning in "res_query.c"

- changing type of stream-mutex to recursive

- sparc/sparc64: shrink of the unified syscall and the special syscalls
  (fork/pipe) to use the "unified_syscall_error_handler"

#include <errno.h>
#include "syscalls.h"

.text
.align 4
.weak clone
clone:
.type __clone,#function
.global __clone
__clone:
	save	%sp, -96, %sp

	tst	%i0		/* check for function pointer */
	be	.Lerror
	tst	%i1		/* check for stack pointer */
	be	.Lerror
	nop

	mov	%i1, %o1	/* child-stack */
	mov	%i2, %o0	/* clone-flags */
	mov	__NR_clone, %g1
	ta	0x10		/* syscall: clone */
	bcs	.Lerror

	tst	%o1
	bne	.Lstart		/* we are the child :) */
	nop
	ret
	restore %o0, %g0, %o0	/* return child pid */

.Lerror:
	call	__errno_location
	mov	EINVAL, %l0
	st	%l0, [%o0]
	ret
	restore	%g0, -1, %o0

.Lstart:
	call	%i0		/* call child-function */
	mov	%i3, %o0	/* put arg in the right place for the child */

	call	_exit		/* child returned */
	nop


LinuxTV legacy CVS <linuxtv.org/cvs>