xref: /csrg-svn/lib/libc/i386/SYS.h (revision 45819)
141012Swilliam /*-
241012Swilliam  * Copyright (c) 1990 The Regents of the University of California.
341012Swilliam  * 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*45819Swilliam  *	@(#)SYS.h	5.3 (Berkeley) 12/17/90
1141012Swilliam  */
1241012Swilliam 
1341012Swilliam #include <syscall.h>
1441012Swilliam 
1541012Swilliam #ifdef PROF
1641012Swilliam #define	ENTRY(x)	.globl _/**/x; \
17*45819Swilliam 			.data; 1:; .long 0; .text; .align 2; _/**/x: \
1841012Swilliam 			movl $1b,%eax; call mcount
1941012Swilliam #else
20*45819Swilliam #define	ENTRY(x)	.globl _/**/x; .text; .align 2; _/**/x:
2141012Swilliam #endif PROF
2241012Swilliam #define	SYSCALL(x)	2: jmp cerror; ENTRY(x); lea SYS_/**/x,%eax; LCALL(7,0); jb 2b
2341012Swilliam #define	PSEUDO(x,y)	ENTRY(x); lea SYS_/**/y, %eax; ; LCALL(7,0)
2441012Swilliam #define	CALL(x,y)	call _/**/y; addl $4*x,%esp
2541012Swilliam /* gas fucks up offset -- although we don't currently need it, do for BCS */
2641012Swilliam #define	LCALL(x,y)	.byte 0x9a ; .long y; .word x
2741012Swilliam 
2842470Sbostic #define	ASMSTR		.asciz
2942470Sbostic 
3041012Swilliam 	.globl	cerror
31