xref: /netbsd-src/lib/libc/arch/ia64/SYS.h (revision 503611ba29d4c920cb1878a9ece7ebd1e0ac2e16)
1*503611baScherry /* $NetBSD: SYS.h,v 1.1 2006/09/10 21:22:33 cherry Exp $ */
2*503611baScherry 
3*503611baScherry /*
4*503611baScherry  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
5*503611baScherry  * All rights reserved.
6*503611baScherry  *
7*503611baScherry  * Author: Chris G. Demetriou
8*503611baScherry  *
9*503611baScherry  * Permission to use, copy, modify and distribute this software and
10*503611baScherry  * its documentation is hereby granted, provided that both the copyright
11*503611baScherry  * notice and this permission notice appear in all copies of the
12*503611baScherry  * software, derivative works or modified versions, and any portions
13*503611baScherry  * thereof, and that both notices appear in supporting documentation.
14*503611baScherry  *
15*503611baScherry  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16*503611baScherry  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17*503611baScherry  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18*503611baScherry  *
19*503611baScherry  * Carnegie Mellon requests users of this software to return to
20*503611baScherry  *
21*503611baScherry  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
22*503611baScherry  *  School of Computer Science
23*503611baScherry  *  Carnegie Mellon University
24*503611baScherry  *  Pittsburgh PA 15213-3890
25*503611baScherry  *
26*503611baScherry  * any improvements or extensions that they make and grant Carnegie the
27*503611baScherry  * rights to redistribute these changes.
28*503611baScherry  */
29*503611baScherry 
30*503611baScherry #include <sys/cdefs.h>
31*503611baScherry 
32*503611baScherry #include <machine/asm.h>
33*503611baScherry #include <sys/syscall.h>
34*503611baScherry 
35*503611baScherry #define RET { br.ret.sptk.few rp;; }
36*503611baScherry 
37*503611baScherry #define CALLSYS_ERROR(name)					\
38*503611baScherry 	CALLSYS_NOERROR(name)					\
39*503611baScherry {	cmp.ne  p6,p0=r0,r10;					\
40*503611baScherry (p6)    br.cond.sptk.few __cerror ;; }
41*503611baScherry 
42*503611baScherry #define	SYSCALL(name)						\
43*503611baScherry ENTRY(name,0);				/* XXX # of args? */	\
44*503611baScherry 	CALLSYS_ERROR(name)
45*503611baScherry 
46*503611baScherry #define	SYSCALL_NOERROR(name)					\
47*503611baScherry ENTRY(name,0);				/* XXX # of args? */	\
48*503611baScherry 	CALLSYS_NOERROR(name)
49*503611baScherry 
50*503611baScherry #define	PSEUDO(label,name)					\
51*503611baScherry ENTRY(label,0);				/* XXX # of args? */	\
52*503611baScherry 	CALLSYS_ERROR(name);					\
53*503611baScherry 	RET;							\
54*503611baScherry END(label);
55*503611baScherry 
56*503611baScherry #define	PSEUDO_NOERROR(label,name)				\
57*503611baScherry ENTRY(label,0);				/* XXX # of args? */	\
58*503611baScherry 	CALLSYS_NOERROR(name);					\
59*503611baScherry 	RET;							\
60*503611baScherry END(label);
61*503611baScherry 
62*503611baScherry #define RSYSCALL(name)						\
63*503611baScherry 	SYSCALL(name);						\
64*503611baScherry 	RET;							\
65*503611baScherry END(name)
66*503611baScherry 
67*503611baScherry #define RSYSCALL_NOERROR(name)					\
68*503611baScherry 	SYSCALL_NOERROR(name);					\
69*503611baScherry 	RET;							\
70*503611baScherry END(name)
71*503611baScherry 
72*503611baScherry #define	WSYSCALL(weak,strong)					\
73*503611baScherry 	WEAK_ALIAS(weak,strong);				\
74*503611baScherry 	PSEUDO(strong,weak)
75