141842Sbostic /*- 2*61115Sbostic * Copyright (c) 1990, 1993 3*61115Sbostic * The Regents of the University of California. All rights reserved. 441842Sbostic * 541842Sbostic * This code is derived from software contributed to Berkeley by 641842Sbostic * the Systems Programming Group of the University of Utah Computer 741842Sbostic * Science Department. 841842Sbostic * 941842Sbostic * %sccs.include.redist.c% 1041842Sbostic * 11*61115Sbostic * @(#)SYS.h 8.1 (Berkeley) 06/04/93 1241842Sbostic */ 1341842Sbostic 1441842Sbostic #include <sys/syscall.h> 1541842Sbostic 1659689Shibler #ifdef __STDC__ 1741842Sbostic #ifdef PROF 1859689Shibler #if __GNUC__ >= 2 1959689Shibler #define ENTRY(x) .globl _ ## x; .even; _ ## x:; .data; PROF ## x:; \ 2059689Shibler .long 0; .text; link a6,\#0; lea PROF ## x,a0; \ 2159689Shibler jbsr mcount; unlk a6 2259689Shibler #else 2359689Shibler #define ENTRY(x) .globl _ ## x; .even; _ ## x:; .data; PROF ## x:; \ 2459689Shibler .long 0; .text; link a6,#0; lea PROF ## x,a0; \ 2559689Shibler jbsr mcount; unlk a6 2659689Shibler #endif 2759689Shibler #else 2859689Shibler #define ENTRY(x) .globl _ ## x; .even; _ ## x: 2959689Shibler #endif 3059689Shibler #if __GNUC__ >= 2 3159689Shibler #define SYSTRAP(x) movl \#SYS_ ## x,d0; trap \#0 3259689Shibler #else 3359689Shibler #define SYSTRAP(x) movl #SYS_ ## x,d0; trap #0 3459689Shibler #endif 3559689Shibler #else 3659689Shibler #ifdef PROF 3741842Sbostic #define ENTRY(x) .globl _/**/x; .even; _/**/x:; .data; PROF/**/x:; \ 3841842Sbostic .long 0; .text; link a6,#0; lea PROF/**/x,a0; \ 3941842Sbostic jbsr mcount; unlk a6 4041842Sbostic #else 4159689Shibler #define ENTRY(x) .globl _/**/x; .even; _/**/x: 4241842Sbostic #endif 4359689Shibler #define SYSTRAP(x) movl #SYS_/**/x,d0; trap #0 4459689Shibler #endif 4559689Shibler 4659689Shibler #define SYSCALL(x) .even; err: jmp cerror; ENTRY(x); SYSTRAP(x); jcs err 4749356Sbostic #define RSYSCALL(x) SYSCALL(x); rts 4859689Shibler #define PSEUDO(x,y) ENTRY(x); SYSTRAP(y); rts 4941842Sbostic 5042469Sbostic #define ASMSTR .asciz 5142469Sbostic 5241842Sbostic .globl cerror 53