xref: /freebsd/lib/libsys/i386/syscall.S (revision 39a15d747007b934cc515d6151595055d8262828)
18269e767SBrooks Davis/*-
28269e767SBrooks Davis * Copyright (c) 1990 The Regents of the University of California.
38269e767SBrooks Davis * All rights reserved.
48269e767SBrooks Davis *
58269e767SBrooks Davis * This code is derived from software contributed to Berkeley by
68269e767SBrooks Davis * William Jolitz.
78269e767SBrooks Davis *
88269e767SBrooks Davis * Redistribution and use in source and binary forms, with or without
98269e767SBrooks Davis * modification, are permitted provided that the following conditions
108269e767SBrooks Davis * are met:
118269e767SBrooks Davis * 1. Redistributions of source code must retain the above copyright
128269e767SBrooks Davis *    notice, this list of conditions and the following disclaimer.
138269e767SBrooks Davis * 2. Redistributions in binary form must reproduce the above copyright
148269e767SBrooks Davis *    notice, this list of conditions and the following disclaimer in the
158269e767SBrooks Davis *    documentation and/or other materials provided with the distribution.
168269e767SBrooks Davis * 3. Neither the name of the University nor the names of its contributors
178269e767SBrooks Davis *    may be used to endorse or promote products derived from this software
188269e767SBrooks Davis *    without specific prior written permission.
198269e767SBrooks Davis *
208269e767SBrooks Davis * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
218269e767SBrooks Davis * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
228269e767SBrooks Davis * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
238269e767SBrooks Davis * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
248269e767SBrooks Davis * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
258269e767SBrooks Davis * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
268269e767SBrooks Davis * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
278269e767SBrooks Davis * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
288269e767SBrooks Davis * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
298269e767SBrooks Davis * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
308269e767SBrooks Davis * SUCH DAMAGE.
318269e767SBrooks Davis */
328269e767SBrooks Davis
338269e767SBrooks Davis#include <machine/asm.h>
348269e767SBrooks Davis#include "SYS.h"
358269e767SBrooks Davis
368269e767SBrooks DavisENTRY(syscall)
378269e767SBrooks Davis	pop	%ecx	/* rta */
388269e767SBrooks Davis	pop	%eax	/* syscall number */
398269e767SBrooks Davis	push	%ecx
408269e767SBrooks Davis	int	$0x80
418269e767SBrooks Davis	push	%ecx	/* need to push a word to keep stack frame intact
428269e767SBrooks Davis			   upon return; the word must be the return address. */
438269e767SBrooks Davis	jb	HIDENAME(cerror)
448269e767SBrooks Davis	ret
458269e767SBrooks DavisEND(syscall)
468269e767SBrooks Davis
47*39a15d74SBrooks DavisPSEUDO(syscall)
48*39a15d74SBrooks Davis
498269e767SBrooks Davis	.section .note.GNU-stack,"",%progbits
50