Fixing syscalls to new seterrno and setretval.
[akaros.git] / kern / arch / i686 / ros / syscall.h
1 #ifndef _ROS_ARCH_SYSCALL_H
2 #define _ROS_ARCH_SYSCALL_H
3
4 #define T_SYSCALL       0x80
5
6 #ifndef ROS_KERNEL
7
8 #include <ros/arch/bits/syscall.h>
9
10 static inline intreg_t syscall_sysenter(uint16_t num, intreg_t a1,
11                                   intreg_t a2, intreg_t a3,
12                                   intreg_t a4, intreg_t a5)
13 {
14         return __syscall_sysenter(num, a1, a2, a3, a4, a5, &errno);
15 }
16 static inline intreg_t syscall_trap(uint16_t num, intreg_t a1,
17                                   intreg_t a2, intreg_t a3,
18                                   intreg_t a4, intreg_t a5)
19 {
20         return __syscall_trap(num, a1, a2, a3, a4, a5, &errno);
21 }
22
23 static inline long __attribute__((always_inline))
24 __ros_syscall(long _num, long _a0, long _a1, long _a2, long _a3, long _a4)
25 {
26         #ifdef __CONFIG_SYSCALL_TRAP__
27                 return syscall_trap(_num, _a0, _a1, _a2, _a3, _a4);
28         #else
29                 return syscall_sysenter(_num, _a0, _a1, _a2, _a3, _a4);
30         #endif
31 }
32
33 #endif
34
35 #endif
36