xref: /netbsd-src/lib/libc/arch/i386/sys/__syscall.S (revision 0d34bfa26d596b4f9bcb49175a92020d91572850)
1*0d34bfa2Suebayasi/*	$NetBSD: __syscall.S,v 1.5 2014/05/23 02:34:19 uebayasi Exp $	*/
2731305d1Smycroft
3731305d1Smycroft/*-
4731305d1Smycroft * Copyright (c) 1990 The Regents of the University of California.
5731305d1Smycroft * All rights reserved.
6731305d1Smycroft *
7731305d1Smycroft * This code is derived from software contributed to Berkeley by
8731305d1Smycroft * William Jolitz.
9731305d1Smycroft *
10731305d1Smycroft * Redistribution and use in source and binary forms, with or without
11731305d1Smycroft * modification, are permitted provided that the following conditions
12731305d1Smycroft * are met:
13731305d1Smycroft * 1. Redistributions of source code must retain the above copyright
14731305d1Smycroft *    notice, this list of conditions and the following disclaimer.
15731305d1Smycroft * 2. Redistributions in binary form must reproduce the above copyright
16731305d1Smycroft *    notice, this list of conditions and the following disclaimer in the
17731305d1Smycroft *    documentation and/or other materials provided with the distribution.
18eb7c1594Sagc * 3. Neither the name of the University nor the names of its contributors
19731305d1Smycroft *    may be used to endorse or promote products derived from this software
20731305d1Smycroft *    without specific prior written permission.
21731305d1Smycroft *
22731305d1Smycroft * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23731305d1Smycroft * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24731305d1Smycroft * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25731305d1Smycroft * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26731305d1Smycroft * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27731305d1Smycroft * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28731305d1Smycroft * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29731305d1Smycroft * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30731305d1Smycroft * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31731305d1Smycroft * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32731305d1Smycroft * SUCH DAMAGE.
33731305d1Smycroft *
34731305d1Smycroft *	from: @(#)syscall.s	5.1 (Berkeley) 4/23/90
35731305d1Smycroft */
36731305d1Smycroft
37731305d1Smycroft#include <machine/asm.h>
38731305d1Smycroft#if defined(SYSLIBC_SCCS) && !defined(lint)
39*0d34bfa2Suebayasi	RCSID("$NetBSD: __syscall.S,v 1.5 2014/05/23 02:34:19 uebayasi Exp $")
40731305d1Smycroft#endif /* SYSLIBC_SCCS and not lint */
41731305d1Smycroft
42731305d1Smycroft#include "SYS.h"
43731305d1Smycroft
44731305d1SmycroftENTRY(__syscall)
45731305d1Smycroft	pop	%ecx	/* rta */
46731305d1Smycroft	pop	%eax	/* syscall number */
47731305d1Smycroft	pop	%edx	/* junk */
48731305d1Smycroft	push	%ecx
49731305d1Smycroft	int	$0x80
50731305d1Smycroft	push	%ecx	/* Keep stack frame consistant */
51731305d1Smycroft	push	%ecx	/* Keep stack frame consistant */
52731305d1Smycroft	jc	err
53731305d1Smycroft	ret
54731305d1Smycrofterr:
55731305d1Smycroft	jmp	CERROR
56*0d34bfa2SuebayasiEND(__syscall)
57