Home | History | Annotate | Line # | Download | only in powerpc
SYS.h revision 1.7
      1  1.7   kleink /*	$NetBSD: SYS.h,v 1.7 1999/01/14 22:48:21 kleink Exp $	*/
      2  1.1  thorpej 
      3  1.1  thorpej #include <machine/asm.h>
      4  1.1  thorpej #include <sys/syscall.h>
      5  1.1  thorpej 
      6  1.1  thorpej #ifdef __STDC__
      7  1.4  thorpej #define	_DOSYSCALL(x)		li	0,(SYS_ ## x)		;\
      8  1.4  thorpej 				sc
      9  1.4  thorpej #else
     10  1.4  thorpej #define	_DOSYSCALL(x)		li	0,(SYS_/**/x)		;\
     11  1.1  thorpej 				sc
     12  1.4  thorpej #endif /* __STDC__ */
     13  1.1  thorpej 
     14  1.4  thorpej #define	_SYSCALL_NOERROR(x,y)	.text				;\
     15  1.1  thorpej 				.align	2			;\
     16  1.1  thorpej 			ENTRY(x)				;\
     17  1.4  thorpej 				_DOSYSCALL(y)
     18  1.1  thorpej 
     19  1.2   kleink #define _SYSCALL(x,y)		.text				;\
     20  1.1  thorpej 				.align	2			;\
     21  1.7   kleink 			2:	b	PIC_PLT(_C_LABEL(__cerror));\
     22  1.2   kleink 				_SYSCALL_NOERROR(x,y)		;\
     23  1.1  thorpej 				bso	2b
     24  1.1  thorpej 
     25  1.2   kleink #define SYSCALL_NOERROR(x)	_SYSCALL_NOERROR(x,x)
     26  1.2   kleink 
     27  1.2   kleink #define SYSCALL(x)		_SYSCALL(x,x)
     28  1.2   kleink 
     29  1.2   kleink #define PSEUDO_NOERROR(x,y)	_SYSCALL_NOERROR(x,y)		;\
     30  1.2   kleink 				blr
     31  1.2   kleink 
     32  1.2   kleink #define PSEUDO(x,y)		_SYSCALL_NOERROR(x,y)		;\
     33  1.3   kleink 				bnslr				;\
     34  1.7   kleink 				b	PIC_PLT(_C_LABEL(__cerror))
     35  1.2   kleink 
     36  1.2   kleink #define RSYSCALL_NOERROR(x)	PSEUDO_NOERROR(x,x)
     37  1.2   kleink 
     38  1.2   kleink #define RSYSCALL(x)		PSEUDO(x,x)
     39