xref: /haiku/src/system/libroot/os/arch/x86/syscalls.inc (revision 079eccf655ba39812b421ae1b87a727d41b50354)
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 <commpage_defs.h>
18
19#define _SYSCALL(name, n) \
20.globl name; \
21.type name,@function; \
22.align 8; \
23name: \
24	movl	$n,%eax; \
25	jmp	*(USER_COMMPAGE_ADDR + COMMPAGE_ENTRY_X86_SYSCALL * 4)
26
27#define SYSCALL0(name, n) _SYSCALL(name, n)
28#define SYSCALL1(name, n) _SYSCALL(name, n)
29#define SYSCALL2(name, n) _SYSCALL(name, n)
30#define SYSCALL3(name, n) _SYSCALL(name, n)
31#define SYSCALL4(name, n) _SYSCALL(name, n)
32#define SYSCALL5(name, n) _SYSCALL(name, n)
33#define SYSCALL6(name, n) _SYSCALL(name, n)
34#define SYSCALL7(name, n) _SYSCALL(name, n)
35#define SYSCALL8(name, n) _SYSCALL(name, n)
36#define SYSCALL9(name, n) _SYSCALL(name, n)
37#define SYSCALL10(name, n) _SYSCALL(name, n)
38#define SYSCALL11(name, n) _SYSCALL(name, n)
39#define SYSCALL12(name, n) _SYSCALL(name, n)
40#define SYSCALL13(name, n) _SYSCALL(name, n)
41#define SYSCALL14(name, n) _SYSCALL(name, n)
42#define SYSCALL15(name, n) _SYSCALL(name, n)
43#define SYSCALL16(name, n) _SYSCALL(name, n)
44#define SYSCALL17(name, n) _SYSCALL(name, n)
45#define SYSCALL18(name, n) _SYSCALL(name, n)
46#define SYSCALL19(name, n) _SYSCALL(name, n)
47#define SYSCALL20(name, n) _SYSCALL(name, n)
48
49