1/* 2 * Copyright 2007, Travis Geiselbrecht. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5/* 6** Copyright 2001, Travis Geiselbrecht. All rights reserved. 7** Distributed under the terms of the NewOS License. 8*/ 9 10/* 11 * syscall interface works as such: 12 * eax has syscall # 13 * esp + 4 points to the syscall parameters 14 * branch to the syscall vector in the commpage 15 */ 16 17#include <asm_defs.h> 18#include <commpage_defs.h> 19 20#define _SYSCALL(name, n) \ 21 .align 8; \ 22 FUNCTION(name): \ 23 movl $n, %eax; \ 24 movl __gCommPageAddress, %edx; \ 25 addl 4 * COMMPAGE_ENTRY_X86_SYSCALL(%edx), %edx; \ 26 jmp *%edx; \ 27 FUNCTION_END(name) 28 29#define SYSCALL0(name, n) _SYSCALL(name, n) 30#define SYSCALL1(name, n) _SYSCALL(name, n) 31#define SYSCALL2(name, n) _SYSCALL(name, n) 32#define SYSCALL3(name, n) _SYSCALL(name, n) 33#define SYSCALL4(name, n) _SYSCALL(name, n) 34#define SYSCALL5(name, n) _SYSCALL(name, n) 35#define SYSCALL6(name, n) _SYSCALL(name, n) 36#define SYSCALL7(name, n) _SYSCALL(name, n) 37#define SYSCALL8(name, n) _SYSCALL(name, n) 38#define SYSCALL9(name, n) _SYSCALL(name, n) 39#define SYSCALL10(name, n) _SYSCALL(name, n) 40#define SYSCALL11(name, n) _SYSCALL(name, n) 41#define SYSCALL12(name, n) _SYSCALL(name, n) 42#define SYSCALL13(name, n) _SYSCALL(name, n) 43#define SYSCALL14(name, n) _SYSCALL(name, n) 44#define SYSCALL15(name, n) _SYSCALL(name, n) 45#define SYSCALL16(name, n) _SYSCALL(name, n) 46#define SYSCALL17(name, n) _SYSCALL(name, n) 47#define SYSCALL18(name, n) _SYSCALL(name, n) 48#define SYSCALL19(name, n) _SYSCALL(name, n) 49#define SYSCALL20(name, n) _SYSCALL(name, n) 50 51