Kernel support for set_errstr()
[akaros.git] / kern / include / ros / syscall.h
1 #ifndef ROS_INC_SYSCALL_H
2 #define ROS_INC_SYSCALL_H
3
4 #include <arch/arch.h>
5 #include <ros/bits/syscall.h>
6 #include <ros/arch/syscall.h>
7 #include <ros/event.h>
8 #include <ros/atomic.h>
9
10 /* Flags for an individual syscall. */
11 #define SC_DONE                                 0x0001          /* SC is done */
12 #define SC_PROGRESS                             0x0002          /* SC made progress */
13 #define SC_UEVENT                               0x0004          /* user has an ev_q */
14 #define SC_K_LOCK                               0x0008          /* kernel locked sysc */
15
16 #define MAX_ERRSTR_LEN                  32
17
18 struct syscall {
19         unsigned int                            num;
20         int                                                     err;                    /* errno */
21         long                                            retval;
22         atomic_t                                        flags;
23         struct event_queue                      *ev_q;
24         void                                            *u_data;
25         long                                            arg0;
26         long                                            arg1;
27         long                                            arg2;
28         long                                            arg3;
29         long                                            arg4;
30         long                                            arg5;
31         char                                            errstr[MAX_ERRSTR_LEN];
32 };
33
34 #ifndef ROS_KERNEL
35
36 /* Temp hack, til the rest of glibc/userspace uses sys/syscall.h */
37 #include <sys/syscall.h>
38 #endif /* ifndef ROS_KERNEL */
39
40 #endif /* ROS_INC_SYSCALL_H */