4.4BSD snapshot (revision 8.1)
[unix-history] / usr / src / lib / libc / i386 / SYS.h
CommitLineData
b7468159
WN
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 *
188d5d8b 10 * @(#)SYS.h 5.6 (Berkeley) %G%
b7468159
WN
11 */
12
188d5d8b 13#include <sys/syscall.h>
b7468159
WN
14
15#ifdef PROF
16#define ENTRY(x) .globl _/**/x; \
7f8f3659 17 .data; 1:; .long 0; .text; .align 2; _/**/x: \
b7468159
WN
18 movl $1b,%eax; call mcount
19#else
7f8f3659 20#define ENTRY(x) .globl _/**/x; .text; .align 2; _/**/x:
b7468159 21#endif PROF
b0ef1e61
KB
22#define SYSCALL(x) 2: jmp cerror; ENTRY(x); lea SYS_/**/x,%eax; LCALL(7,0); jb 2b
23#define RSYSCALL(x) SYSCALL(x); ret
d4a67384 24#define PSEUDO(x,y) ENTRY(x); lea SYS_/**/y, %eax; ; LCALL(7,0); ret
b7468159
WN
25#define CALL(x,y) call _/**/y; addl $4*x,%esp
26/* gas fucks up offset -- although we don't currently need it, do for BCS */
27#define LCALL(x,y) .byte 0x9a ; .long y; .word x
28
8d39917d
KB
29#define ASMSTR .asciz
30
b7468159 31 .globl cerror