Home | History | Annotate | Line # | Download | only in powerpc
SYS.h revision 1.8.2.1
      1  1.8.2.1     tron /*	$NetBSD: SYS.h,v 1.8.2.1 2004/07/23 13:55:01 tron 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.8.2.1     tron #define	_DOSYSCALL(x)		li	%r0,(SYS_ ## x)		;\
      8      1.4  thorpej 				sc
      9      1.4  thorpej #else
     10  1.8.2.1     tron #define	_DOSYSCALL(x)		li	%r0,(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      1.8  thorpej 
     40      1.8  thorpej #define	WSYSCALL(weak,strong)	WEAK_ALIAS(weak,strong)		;\
     41      1.8  thorpej 				PSEUDO(strong,weak)
     42