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