mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
2001-02-18 Mark Kettenis <kettenis@gnu.org> * malloc/mtrace.c [USE_IN_LIBIO]: Define fopen as _IO_fopen64. (mtrace): Revert 2001-02-13 patch: use fopen instead of fopen64. 2001-02-17 H.J. Lu <hjl@gnu.org> * sysdeps/unix/sysv/linux/ia64/clone2.S: Use clone2 and don't use scratch registers across the system call.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
@ -24,7 +24,8 @@
|
||||
/* size_t child_stack_size, int flags, void *arg) */
|
||||
|
||||
ENTRY(__clone2)
|
||||
cmp.eq p6,p0=0,r32
|
||||
alloc r2=ar.pfs,5,2,3,0
|
||||
cmp.eq p6,p0=0,in0
|
||||
mov r8=EINVAL
|
||||
(p6) br.cond.spnt.few __syscall_error
|
||||
;;
|
||||
@ -34,28 +35,12 @@ ENTRY(__clone2)
|
||||
/* instructions. We need to ensure */
|
||||
/* that it will not read or write the */
|
||||
/* backing store. */
|
||||
mov r17=ar.rsc /* save ar.rsc */
|
||||
mov r14=r32 /* save fn */
|
||||
mov r18=r33 /* save child_stack_base */
|
||||
/* Note that r15 is used to pass */
|
||||
/* syscall # to kernel & not preserved. */
|
||||
mov r16=r36 /* save arg */
|
||||
;;
|
||||
dep r36=0,r17,0,2 /* set to enforced lazy mode. */
|
||||
;;
|
||||
mov ar.rsc=r36
|
||||
cmp.ne p7,p0=0,r33 /* stack_base 0? */
|
||||
;;
|
||||
(p7) add r33=r33,r34 /* Stack base arg to syscall is */
|
||||
/* 0 if child_stack_base is 0, */
|
||||
/* child_stack_base + child_stack_size */
|
||||
/* otherwise. */
|
||||
/* The system call interface seems */
|
||||
/* quite contrived at this point. If */
|
||||
/* we don't pass the backing store */
|
||||
/* pointer, why do we pass the sp? */
|
||||
mov r32=r35 /* Flags are first syscall argument. */
|
||||
DO_CALL (SYS_ify (clone))
|
||||
mov loc0=in0 /* save fn */
|
||||
mov loc1=in4 /* save arg */
|
||||
mov out0=in3 /* Flags are first syscall argument. */
|
||||
mov out1=in1 /* Stack address. */
|
||||
mov out2=in2 /* Stack size. */
|
||||
DO_CALL (SYS_ify (clone2))
|
||||
cmp.eq p6,p0=-1,r10
|
||||
;;
|
||||
(p6) br.cond.spnt.few __syscall_error
|
||||
@ -64,18 +49,16 @@ ENTRY(__clone2)
|
||||
# define PARENT p7
|
||||
cmp.eq CHILD,PARENT=0,r8 /* Are we the child? */
|
||||
;;
|
||||
(CHILD) ld8 r34=[r14],8 /* Retrieve code pointer. */
|
||||
(CHILD) mov ar.bspstore=r18 /* Set register backing store in the child */
|
||||
(CHILD) mov r32=r16 /* Pass proper argument to fn */
|
||||
mov ar.rsc=r17 /* Restore RSE mode (both threads). */
|
||||
(CHILD) ld8 out1=[loc0],8 /* Retrieve code pointer. */
|
||||
(CHILD) mov out0=loc1 /* Pass proper argument to fn */
|
||||
(PARENT) ret
|
||||
;;
|
||||
ld8 gp=[r14] /* Load function gp. */
|
||||
mov b6=r34
|
||||
ld8 gp=[loc0] /* Load function gp. */
|
||||
mov b6=out1
|
||||
;;
|
||||
br.call.dptk.few rp=b6 /* Call fn(arg) in the child */
|
||||
;;
|
||||
mov r32=r8 /* Argument to _exit */
|
||||
mov out0=r8 /* Argument to _exit */
|
||||
.globl _exit
|
||||
br.call.dpnt.few rp=_exit /* call _exit with result from fn. */
|
||||
ret /* Not reached. */
|
||||
|
Reference in New Issue
Block a user