xref: /openbsd/sys/lib/libkern/arch/mips64/SYS.h (revision 5f1af725)
1*5f1af725Skrw /*	$OpenBSD: SYS.h,v 1.2 2015/01/19 15:30:52 krw Exp $ */
265efb508Spefo /*-
365efb508Spefo  * Copyright (c) 1990 The Regents of the University of California.
465efb508Spefo  * All rights reserved.
565efb508Spefo  *
665efb508Spefo  * This code is derived from software contributed to Berkeley by
765efb508Spefo  * William Jolitz.
865efb508Spefo  *
965efb508Spefo  * Redistribution and use in source and binary forms, with or without
1065efb508Spefo  * modification, are permitted provided that the following conditions
1165efb508Spefo  * are met:
1265efb508Spefo  * 1. Redistributions of source code must retain the above copyright
1365efb508Spefo  *    notice, this list of conditions and the following disclaimer.
1465efb508Spefo  * 2. Redistributions in binary form must reproduce the above copyright
1565efb508Spefo  *    notice, this list of conditions and the following disclaimer in the
1665efb508Spefo  *    documentation and/or other materials provided with the distribution.
1765efb508Spefo  * 3. Neither the name of the University nor the names of its contributors
1865efb508Spefo  *    may be used to endorse or promote products derived from this software
1965efb508Spefo  *    without specific prior written permission.
2065efb508Spefo  *
2165efb508Spefo  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2265efb508Spefo  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2365efb508Spefo  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2465efb508Spefo  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2565efb508Spefo  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2665efb508Spefo  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2765efb508Spefo  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2865efb508Spefo  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2965efb508Spefo  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3065efb508Spefo  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3165efb508Spefo  * SUCH DAMAGE.
3265efb508Spefo  *
3365efb508Spefo  *	from: @(#)SYS.h	5.5 (Berkeley) 5/7/91
3465efb508Spefo  */
3565efb508Spefo 
3665efb508Spefo #include <machine/asm.h>
3765efb508Spefo #include <sys/syscall.h>
3865efb508Spefo 
3965efb508Spefo #define	SYSCALL(x)	.text; .align 2; 2: jmp PIC_PLT(cerror); ENTRY(x); movl $(SYS_/**/x),%eax; int $0x80; jc 2b
4065efb508Spefo #define	RSYSCALL(x)	SYSCALL(x); ret
4165efb508Spefo #define	PSEUDO(x,y)	ENTRY(x); movl $(SYS_/**/y),%eax; int $0x80; ret
4265efb508Spefo #define	CALL(x,y)	call PIC_PLT(_/**/y); addl $4*x,%esp
4365efb508Spefo 
4465efb508Spefo 	.globl	cerror
45