1/* 2** Copyright 2001, Travis Geiselbrecht. All rights reserved. 3** Distributed under the terms of the NewOS License. 4*/ 5 6/* 7 * syscall interface works as such: 8 * eax has syscall # 9 * esp + 4 points to the syscall parameters 10 */ 11 12#define _SYSCALL(name, n) \ 13.globl name; \ 14.type name,@function; \ 15.align 8; \ 16name: \ 17 movl $n,%eax; \ 18 int $99; \ 19 ret 20 21#define SYSCALL0(name, n) _SYSCALL(name, n) 22#define SYSCALL1(name, n) _SYSCALL(name, n) 23#define SYSCALL2(name, n) _SYSCALL(name, n) 24#define SYSCALL3(name, n) _SYSCALL(name, n) 25#define SYSCALL4(name, n) _SYSCALL(name, n) 26#define SYSCALL5(name, n) _SYSCALL(name, n) 27#define SYSCALL6(name, n) _SYSCALL(name, n) 28#define SYSCALL7(name, n) _SYSCALL(name, n) 29#define SYSCALL8(name, n) _SYSCALL(name, n) 30#define SYSCALL9(name, n) _SYSCALL(name, n) 31#define SYSCALL10(name, n) _SYSCALL(name, n) 32#define SYSCALL11(name, n) _SYSCALL(name, n) 33#define SYSCALL12(name, n) _SYSCALL(name, n) 34#define SYSCALL13(name, n) _SYSCALL(name, n) 35#define SYSCALL14(name, n) _SYSCALL(name, n) 36#define SYSCALL15(name, n) _SYSCALL(name, n) 37#define SYSCALL16(name, n) _SYSCALL(name, n) 38