aboutsummaryrefslogtreecommitdiff
path: root/src/userspace/syscall.h
diff options
context:
space:
mode:
authorMarvin Borner2019-12-21 22:22:03 +0100
committerMarvin Borner2019-12-21 22:22:03 +0100
commit499784a824c541001c2fd52ae95eba88dcfc952b (patch)
treec3c26d7c8a3b9291d909f4655b7d27a5ae2369bc /src/userspace/syscall.h
parent38610cd06dc0b5a3a4ee46f5fe7c341191aa2bc1 (diff)
Many debugging/serial improvements
Sorry for the little information, but I did many things :)
Diffstat (limited to 'src/userspace/syscall.h')
-rw-r--r--src/userspace/syscall.h14
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"); \