summaryrefslogtreecommitdiffhomepage
path: root/arch/nt64/syscall_arch.h
blob: 9a5d4afcc252a6da67216687e8a552ecce69d94b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
extern unsigned long ** __syscall_vtbl;
extern long __syscall_alert(long);

typedef long __syscall0_fn(void);
typedef long __syscall1_fn(long a1);
typedef long __syscall2_fn(long a1, long a2);
typedef long __syscall3_fn(long a1, long a2, long a3);
typedef long __syscall4_fn(long a1, long a2, long a3, long a4);
typedef long __syscall5_fn(long a1, long a2, long a3, long a4, long a5);
typedef long __syscall6_fn(long a1, long a2, long a3, long a4, long a5, long a6);

#define sysfn_from_fn(x) \
	x * sysfn = (x *)__syscall_vtbl[n]

static __inline long __syscall0(long n)
{
	sysfn_from_fn(__syscall0_fn);
	return sysfn ? sysfn() : __syscall_alert(n);
}

static __inline long __syscall1(long n, long a1)
{
	sysfn_from_fn(__syscall1_fn);
	return sysfn ? sysfn(a1) : __syscall_alert(n);
}

static __inline long __syscall2(long n, long a1, long a2)
{
	sysfn_from_fn(__syscall2_fn);
	return sysfn ? sysfn(a1, a2) : __syscall_alert(n);
}

static __inline long __syscall3(long n, long a1, long a2, long a3)
{
	sysfn_from_fn(__syscall3_fn);
	return sysfn ? sysfn(a1, a2, a3) : __syscall_alert(n);
}

static __inline long __syscall4(long n, long a1, long a2, long a3, long a4)
{
	sysfn_from_fn(__syscall4_fn);
	return sysfn ? sysfn(a1, a2, a3, a4) : __syscall_alert(n);
}

static __inline long __syscall5(long n, long a1, long a2, long a3, long a4, long a5)
{
	sysfn_from_fn(__syscall5_fn);
	return sysfn ? sysfn(a1, a2, a3, a4, a5) : __syscall_alert(n);
}

static __inline long __syscall6(long n, long a1, long a2, long a3, long a4, long a5, long a6)
{
	sysfn_from_fn(__syscall6_fn);
	return sysfn ? sysfn(a1, a2, a3, a4, a5, a6) : __syscall_alert(n);
}


#define __SYSCALL_LL_E(x) (x)
#define __SYSCALL_LL_O(x) (x)