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