xref: /original-bsd/lib/libc/i386/SYS.h (revision 50dd0bba)
1 /*-
2  * Copyright (c) 1990 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * William Jolitz.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)SYS.h	5.3 (Berkeley) 12/17/90
11  */
12 
13 #include <syscall.h>
14 
15 #ifdef PROF
16 #define	ENTRY(x)	.globl _/**/x; \
17 			.data; 1:; .long 0; .text; .align 2; _/**/x: \
18 			movl $1b,%eax; call mcount
19 #else
20 #define	ENTRY(x)	.globl _/**/x; .text; .align 2; _/**/x:
21 #endif PROF
22 #define	SYSCALL(x)	2: jmp cerror; ENTRY(x); lea SYS_/**/x,%eax; LCALL(7,0); jb 2b
23 #define	PSEUDO(x,y)	ENTRY(x); lea SYS_/**/y, %eax; ; LCALL(7,0)
24 #define	CALL(x,y)	call _/**/y; addl $4*x,%esp
25 /* gas fucks up offset -- although we don't currently need it, do for BCS */
26 #define	LCALL(x,y)	.byte 0x9a ; .long y; .word x
27 
28 #define	ASMSTR		.asciz
29 
30 	.globl	cerror
31