SYS.h revision 1.3
11.3Smatt/* $NetBSD: SYS.h,v 1.3 2014/08/23 02:24:22 matt Exp $ */ 21.1Sross 31.1Sross#include <machine/asm.h> 41.1Sross#include <sys/syscall.h> 51.1Sross 61.3Smatt#ifdef _CALL_AIX 71.3Smatt#define BRANCH_TO_CERROR() b ._C_LABEL(__cerror); nop 81.3Smatt#else 91.3Smatt#define BRANCH_TO_CERROR() b _C_LABEL(__cerror) 101.3Smatt#endif 111.3Smatt 121.1Sross#define _DOSYSCALL(x) li %r0,(SYS_ ## x) ;\ 131.1Sross sc 141.1Sross 151.1Sross#define _SYSCALL_NOERROR(x,y) .text ;\ 161.3Smatt .p2align 2 ;\ 171.1Sross ENTRY(x) ;\ 181.1Sross _DOSYSCALL(y) 191.1Sross 201.1Sross#define _SYSCALL(x,y) .text ;\ 211.3Smatt .p2align 2 ;\ 221.3Smatt 2: BRANCH_TO_CERROR() ;\ 231.1Sross _SYSCALL_NOERROR(x,y) ;\ 241.1Sross bso 2b 251.1Sross 261.1Sross#define SYSCALL_NOERROR(x) _SYSCALL_NOERROR(x,x) 271.1Sross 281.1Sross#define SYSCALL(x) _SYSCALL(x,x) 291.1Sross 301.1Sross#define PSEUDO_NOERROR(x,y) _SYSCALL_NOERROR(x,y) ;\ 311.3Smatt blr ;\ 321.3Smatt END(x) 331.1Sross 341.1Sross#define PSEUDO(x,y) _SYSCALL_NOERROR(x,y) ;\ 351.1Sross bnslr ;\ 361.3Smatt BRANCH_TO_CERROR() ;\ 371.3Smatt END(x) 381.1Sross 391.1Sross#define RSYSCALL_NOERROR(x) PSEUDO_NOERROR(x,x) 401.1Sross 411.1Sross#define RSYSCALL(x) PSEUDO(x,x) 421.1Sross 431.1Sross#define WSYSCALL(weak,strong) WEAK_ALIAS(weak,strong) ;\ 441.1Sross PSEUDO(strong,weak) 45