xref: /csrg-svn/lib/libc/i386/SYS.h (revision 61135)
141012Swilliam /*-
2*61135Sbostic  * Copyright (c) 1990, 1993
3*61135Sbostic  *	The Regents of the University of California.  All rights reserved.
441012Swilliam  *
541012Swilliam  * This code is derived from software contributed to Berkeley by
641012Swilliam  * William Jolitz.
741012Swilliam  *
841012Swilliam  * %sccs.include.redist.c%
941012Swilliam  *
10*61135Sbostic  *	@(#)SYS.h	8.1 (Berkeley) 06/04/93
1141012Swilliam  */
1241012Swilliam 
1350413Sbostic #include <sys/syscall.h>
1441012Swilliam 
1541012Swilliam #ifdef PROF
1641012Swilliam #define	ENTRY(x)	.globl _/**/x; \
1745819Swilliam 			.data; 1:; .long 0; .text; .align 2; _/**/x: \
1841012Swilliam 			movl $1b,%eax; call mcount
1941012Swilliam #else
2045819Swilliam #define	ENTRY(x)	.globl _/**/x; .text; .align 2; _/**/x:
2141012Swilliam #endif PROF
2249357Sbostic #define	SYSCALL(x)	2: jmp cerror; ENTRY(x); lea SYS_/**/x,%eax; LCALL(7,0); jb 2b
2349357Sbostic #define	RSYSCALL(x)	SYSCALL(x); ret
2448806Storek #define	PSEUDO(x,y)	ENTRY(x); lea SYS_/**/y, %eax; ; LCALL(7,0); ret
2541012Swilliam #define	CALL(x,y)	call _/**/y; addl $4*x,%esp
2641012Swilliam /* gas fucks up offset -- although we don't currently need it, do for BCS */
2741012Swilliam #define	LCALL(x,y)	.byte 0x9a ; .long y; .word x
2841012Swilliam 
2942470Sbostic #define	ASMSTR		.asciz
3042470Sbostic 
3141012Swilliam 	.globl	cerror
32