1 /* $NetBSD: SYS.h,v 1.7 2009/11/03 05:07:25 snj Exp $ */
3 /* $OpenBSD: SYS.h,v 1.9 2001/09/20 20:52:09 millert Exp $ */
6 * Copyright (c) 1998-2002 Michael Shalayeff
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF MIND
24 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #include <sys/syscall.h>
31 #include <machine/asm.h>
32 #include <machine/vmparam.h>
35 #include <machine/frame.h>
37 #define SYSENTRY(x) LEAF_ENTRY(x)
38 #define SYSEXIT(x) EXIT(x)
41 stw %rp, HPPA_FRAME_ERP(%sr0,%sp) !\
42 ldil L%SYSCALLGATE, %r1 !\
44 ldi __CONCAT(SYS_,x), %t1 !\
45 .import __cerror, code !\
46 comb,<> %r0, %t1, __cerror !\
47 ldw HPPA_FRAME_ERP(%sr0,%sp), %rp
49 #define PSEUDO(x,y) !\
56 #define PSEUDO_NOERROR(x,y) !\
58 stw %rp, HPPA_FRAME_ERP(%sr0,%sp) !\
59 ldil L%SYSCALLGATE, %r1 !\
61 ldi __CONCAT(SYS_,y), %t1 !\
62 ldw HPPA_FRAME_ERP(%sr0,%sp), %rp !\
67 #define RSYSCALL(x) PSEUDO(x,x)
68 #define RSYSCALL_NOERROR(x) PSEUDO_NOERROR(x,x)
71 #define WSYSCALL(weak,strong) !\
72 WEAK_ALIAS(weak,strong) !\
75 #define WSYSCALL(weak,strong) !\