21 #error syscall-stubs.h requires SERVICE to be defined 24 #error syscall-stubs.h requires SERVICE_ERROR to be defined 27 #error syscall-stubs.h requires SERVICE_INIT to be defined 33 static int syscall0(
int function)
35 int eax = ((SERVICE & 0xFFFF) << 16) | (
function & 0xFFFF);
38 #ifdef USE_PIC_SYSCALLS 39 asm volatile(
"push %%ebx; \ 44 :
"=a"(ret),
"=r"(SERVICE_ERROR)
47 asm volatile(
"int $255" :
"=a"(ret),
"=b"(SERVICE_ERROR) :
"0"(eax));
52 static int syscall1(
int function,
int p1)
54 int eax = ((SERVICE & 0xFFFF) << 16) | (
function & 0xFFFF);
57 #ifdef USE_PIC_SYSCALLS 58 asm volatile(
"push %%ebx; \ 63 :
"=a"(ret),
"=r"(SERVICE_ERROR)
66 asm volatile(
"int $255" 67 :
"=a"(ret),
"=b"(SERVICE_ERROR)
73 static int syscall2(
int function,
int p1,
int p2)
75 int eax = ((SERVICE & 0xFFFF) << 16) | (
function & 0xFFFF);
78 #ifdef USE_PIC_SYSCALLS 79 asm volatile(
"push %%ebx; \ 84 :
"=a"(ret),
"=r"(SERVICE_ERROR)
85 :
"0"(eax),
"1"(p1),
"c"(p2));
87 asm volatile(
"int $255" 88 :
"=a"(ret),
"=b"(SERVICE_ERROR)
89 :
"0"(eax),
"1"(p1),
"c"(p2));
94 static int syscall3(
int function,
int p1,
int p2,
int p3)
96 int eax = ((SERVICE & 0xFFFF) << 16) | (
function & 0xFFFF);
99 #ifdef USE_PIC_SYSCALLS 100 asm volatile(
"push %%ebx; \ 105 :
"=a"(ret),
"=r"(SERVICE_ERROR)
106 :
"0"(eax),
"1"(p1),
"c"(p2),
"d"(p3));
108 asm volatile(
"int $255" 109 :
"=a"(ret),
"=b"(SERVICE_ERROR)
110 :
"0"(eax),
"1"(p1),
"c"(p2),
"d"(p3));
115 static int syscall4(
int function,
int p1,
int p2,
int p3,
int p4)
117 int eax = ((SERVICE & 0xFFFF) << 16) | (
function & 0xFFFF);
120 #ifdef USE_PIC_SYSCALLS 121 asm volatile(
"push %%ebx; \ 126 :
"=a"(ret),
"=r"(SERVICE_ERROR)
127 :
"0"(eax),
"1"(p1),
"c"(p2),
"d"(p3),
"S"(p4));
129 asm volatile(
"int $255" 130 :
"=a"(ret),
"=b"(SERVICE_ERROR)
131 :
"0"(eax),
"1"(p1),
"c"(p2),
"d"(p3),
"S"(p4));
136 static int syscall5(
int function,
int p1,
int p2,
int p3,
int p4,
int p5)
138 int eax = ((SERVICE & 0xFFFF) << 16) | (
function & 0xFFFF);
141 #ifdef USE_PIC_SYSCALLS 142 asm volatile(
"push %%ebx; \ 147 :
"=a"(ret),
"+m"(p1)
148 :
"0"(eax),
"c"(p2),
"d"(p3),
"S"(p4),
"D"(p5));
151 asm volatile(
"int $255" 152 :
"=a"(ret),
"=b"(SERVICE_ERROR)
153 :
"0"(eax),
"1"(p1),
"c"(p2),
"d"(p3),
"S"(p4),
"D"(p5));