xref: /netbsd-src/lib/libc/arch/mips/sys/pipe.S (revision 22882071611a5c00787326883b2dec6842e4ad38)
1*22882071Smatt/*	$NetBSD: pipe.S,v 1.12 2009/12/14 01:07:42 matt Exp $	*/
281b108b4Sjonathan
3ae1bfcddSglass/*-
4ae1bfcddSglass * Copyright (c) 1991, 1993
5ae1bfcddSglass *	The Regents of the University of California.  All rights reserved.
6ae1bfcddSglass *
7ae1bfcddSglass * This code is derived from software contributed to Berkeley by
8ae1bfcddSglass * Ralph Campbell.
9ae1bfcddSglass *
10ae1bfcddSglass * Redistribution and use in source and binary forms, with or without
11ae1bfcddSglass * modification, are permitted provided that the following conditions
12ae1bfcddSglass * are met:
13ae1bfcddSglass * 1. Redistributions of source code must retain the above copyright
14ae1bfcddSglass *    notice, this list of conditions and the following disclaimer.
15ae1bfcddSglass * 2. Redistributions in binary form must reproduce the above copyright
16ae1bfcddSglass *    notice, this list of conditions and the following disclaimer in the
17ae1bfcddSglass *    documentation and/or other materials provided with the distribution.
18eb7c1594Sagc * 3. Neither the name of the University nor the names of its contributors
19ae1bfcddSglass *    may be used to endorse or promote products derived from this software
20ae1bfcddSglass *    without specific prior written permission.
21ae1bfcddSglass *
22ae1bfcddSglass * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23ae1bfcddSglass * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24ae1bfcddSglass * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25ae1bfcddSglass * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26ae1bfcddSglass * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27ae1bfcddSglass * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28ae1bfcddSglass * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29ae1bfcddSglass * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30ae1bfcddSglass * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31ae1bfcddSglass * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32ae1bfcddSglass * SUCH DAMAGE.
33ae1bfcddSglass */
34ae1bfcddSglass
35ae1bfcddSglass#include "SYS.h"
36ae1bfcddSglass
37ae1bfcddSglass#if defined(LIBC_SCCS) && !defined(lint)
38*22882071Smatt#if 0
39*22882071Smatt	RCSID("from: @(#)pipe.s	8.1 (Berkeley) 6/4/93")
40*22882071Smatt#else
41*22882071Smatt	RCSID("$NetBSD: pipe.S,v 1.12 2009/12/14 01:07:42 matt Exp $")
42*22882071Smatt#endif
43ae1bfcddSglass#endif /* LIBC_SCCS and not lint */
44ae1bfcddSglass
4582fd76bbSkleink#ifdef WEAK_ALIAS
4682fd76bbSkleinkWEAK_ALIAS(pipe, _pipe)
4782fd76bbSkleink#endif
4882fd76bbSkleink
4982fd76bbSkleinkLEAF(_pipe)
50*22882071Smatt	PIC_PROLOGUE(_pipe);
51*22882071Smatt
52*22882071Smatt	SYSTRAP(pipe)	# pipe(fildes) int fildes[2];
53*22882071Smatt
54ae1bfcddSglass	bne	a3, zero, 1f
55*22882071Smatt	INT_S	v0, 0(a0)	# store the two file descriptors
56*22882071Smatt	INT_S	v1, 4(a0)
57ae1bfcddSglass	move	v0, zero
58*22882071Smatt	PIC_RETURN()
59ae1bfcddSglass1:
60*22882071Smatt	PIC_TAILCALL(__cerror)
610cbe508fSsimonbEND(_pipe)
62