Cross Reference: SYS.h
xref: /src/lib/libc/arch/powerpc64/SYS.h
  • Home
  • History
  • AnnotateAnnotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /src/lib/libc/arch/powerpc64/
SYS.h revision 1.1
11.1Sross/*	$NetBSD: SYS.h,v 1.1 2006/07/01 16:37:20 ross Exp $	*/
21.1Sross
31.1Sross#include <machine/asm.h>
41.1Sross#include <sys/syscall.h>
51.1Sross
61.1Sross#ifdef __STDC__
71.1Sross#define	_DOSYSCALL(x)		li	%r0,(SYS_ ## x)		;\
81.1Sross				sc
91.1Sross#else
101.1Sross#define	_DOSYSCALL(x)		li	%r0,(SYS_/**/x)		;\
111.1Sross				sc
121.1Sross#endif /* __STDC__ */
131.1Sross
141.1Sross#define	_SYSCALL_NOERROR(x,y)	.text				;\
151.1Sross				.align	2			;\
161.1Sross			ENTRY(x)				;\
171.1Sross				_DOSYSCALL(y)
181.1Sross
191.1Sross#define _SYSCALL(x,y)		.text				;\
201.1Sross				.align	2			;\
211.1Sross			2:	b	PIC_PLT(_C_LABEL(__cerror));\
221.1Sross				_SYSCALL_NOERROR(x,y)		;\
231.1Sross				bso	2b
241.1Sross
251.1Sross#define SYSCALL_NOERROR(x)	_SYSCALL_NOERROR(x,x)
261.1Sross
271.1Sross#define SYSCALL(x)		_SYSCALL(x,x)
281.1Sross
291.1Sross#define PSEUDO_NOERROR(x,y)	_SYSCALL_NOERROR(x,y)		;\
301.1Sross				blr
311.1Sross
321.1Sross#define PSEUDO(x,y)		_SYSCALL_NOERROR(x,y)		;\
331.1Sross				bnslr				;\
341.1Sross				b	PIC_PLT(_C_LABEL(__cerror))
351.1Sross
361.1Sross#define RSYSCALL_NOERROR(x)	PSEUDO_NOERROR(x,x)
371.1Sross
381.1Sross#define RSYSCALL(x)		PSEUDO(x,x)
391.1Sross
401.1Sross#define	WSYSCALL(weak,strong)	WEAK_ALIAS(weak,strong)		;\
411.1Sross				PSEUDO(strong,weak)
42

Indexes created Mon Nov 10 17:20:41 GMT 2025