pipe.S revision 184547
1218885Sdim/*- 2218885Sdim * Copyright (c) 1990 The Regents of the University of California. 3218885Sdim * All rights reserved. 4218885Sdim * 5218885Sdim * This code is derived from software contributed to Berkeley by 6218885Sdim * William Jolitz. 7218885Sdim * 8218885Sdim * Redistribution and use in source and binary forms, with or without 9218885Sdim * modification, are permitted provided that the following conditions 10218885Sdim * are met: 11218885Sdim * 1. Redistributions of source code must retain the above copyright 12218885Sdim * notice, this list of conditions and the following disclaimer. 13218885Sdim * 2. Redistributions in binary form must reproduce the above copyright 14280031Sdim * notice, this list of conditions and the following disclaimer in the 15280031Sdim * documentation and/or other materials provided with the distribution. 16218885Sdim * 4. Neither the name of the University nor the names of its contributors 17218885Sdim * may be used to endorse or promote products derived from this software 18261991Sdim * without specific prior written permission. 19218885Sdim * 20276479Sdim * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21276479Sdim * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22218885Sdim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23218885Sdim * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24218885Sdim * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25218885Sdim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26234353Sdim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27234353Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28280031Sdim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29280031Sdim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30276479Sdim * SUCH DAMAGE. 31288943Sdim */ 32288943Sdim 33288943Sdim#if defined(SYSLIBC_SCCS) && !defined(lint) 34288943Sdim .asciz "@(#)pipe.s 5.1 (Berkeley) 4/23/90" 35288943Sdim#endif /* SYSLIBC_SCCS and not lint */ 36288943Sdim#include <machine/asm.h> 37288943Sdim__FBSDID("$FreeBSD: head/lib/libc/amd64/sys/pipe.S 184547 2008-11-02 01:10:54Z peter $"); 38288943Sdim 39288943Sdim#include "SYS.h" 40288943Sdim 41288943Sdim .weak _pipe 42288943Sdim .set _pipe,__sys_pipe 43288943Sdim .weak pipe 44288943Sdim .set pipe,__sys_pipe 45288943SdimENTRY(__sys_pipe) 46288943Sdim mov $SYS_pipe,%rax 47276479Sdim KERNCALL 48276479Sdim jb 1f 49288943Sdim movl %eax,(%rdi) /* %rdi is preserved by syscall */ 50288943Sdim movl %edx,4(%rdi) 51276479Sdim movq $0,%rax 52288943Sdim ret 53288943Sdim1: 54218885Sdim#ifdef PIC 55218885Sdim movq PIC_GOT(HIDENAME(cerror)),%rdx 56288943Sdim jmp *%rdx 57251662Sdim#else 58261991Sdim jmp HIDENAME(cerror) 59261991Sdim#endif 60261991SdimEND(__sys_pipe) 61261991Sdim