diff options
Diffstat (limited to 'src/userspace/syscall.h')
-rw-r--r-- | src/userspace/syscall.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/userspace/syscall.h b/src/userspace/syscall.h index 8dd647f..60fb288 100644 --- a/src/userspace/syscall.h +++ b/src/userspace/syscall.h @@ -18,25 +18,25 @@ #define DEFN_SYSCALL1(fn, num, P1) \ int syscall_##fn(P1 p1) { \ - int __res; __asm__ __volatile__("int $0x80" \ + int __res; __asm__ __volatile__("push %%ebx; movl %2,%%ebx; int $0x80; pop %%ebx" \ : "=a" (__res) \ - : "0" (num), "b" ((int)(p1)) \ + : "0" (num), "r" ((int)(p1)) \ : "memory"); \ return __res; \ } #define DEFN_SYSCALL2(fn, num, P1, P2) \ int syscall_##fn(P1 p1, P2 p2) { \ - int __res; __asm__ __volatile__("int $0x80" \ + int __res; __asm__ __volatile__("push %%ebx; movl %2,%%ebx; int $0x80; pop %%ebx" \ : "=a" (__res) \ - : "0" (num), "b" ((int)(p1)), "c"((int)(p2)) \ + : "0" (num), "r" ((int)(p1)), "c"((int)(p2)) \ : "memory"); \ return __res; \ } #define DEFN_SYSCALL3(fn, num, P1, P2, P3) \ int syscall_##fn(P1 p1, P2 p2, P3 p3) { \ - int __res; __asm__ __volatile__("int $0x80" \ + int __res; __asm__ __volatile__("push %%ebx; movl %2,%%ebx; int $0x80; pop %%ebx" \ : "=a" (__res) \ : "0" (num), "b" ((int)(p1)), "c"((p2)), "d"((int)(p3)) \ : "memory"); \ @@ -45,7 +45,7 @@ #define DEFN_SYSCALL4(fn, num, P1, P2, P3, P4) \ int syscall_##fn(P1 p1, P2 p2, P3 p3, P4 p4) { \ - int __res; __asm__ __volatile__("int $0x80" \ + int __res; __asm__ __volatile__("push %%ebx; movl %2,%%ebx; int $0x80; pop %%ebx" \ : "=a" (__res) \ : "0" (num), "b" ((int)(p1)), "c"((int)(p2)), "d"((int)(p3)), "S"((int)(p4)) \ : "memory"); \ @@ -54,7 +54,7 @@ #define DEFN_SYSCALL5(fn, num, P1, P2, P3, P4, P5) \ int syscall_##fn(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { \ - int __res; __asm__ __volatile__("int $0x80" \ + int __res; __asm__ __volatile__("push %%ebx; movl %2,%%ebx; int $0x80; pop %%ebx" \ : "=a" (__res) \ : "0" (num), "b" ((int)(p1)), "c"((int)(p2)), "d"((int)(p3)), "S"((int)(p4)), "D"((int)(p5)) \ : "memory"); \ |