Remove EVENT_JUSTHANDLEIT (XCC)
[akaros.git] / kern / include / ros / syscall.h
index 0a9dc75..1e6d8f7 100644 (file)
@@ -1,11 +1,59 @@
-#ifndef ROS_INCLUDE_SYSCALL_H
-#define ROS_INCLUDE_SYSCALL_H
+#ifndef ROS_INC_SYSCALL_H
+#define ROS_INC_SYSCALL_H
 
 #include <ros/bits/syscall.h>
-
-// convenience wrapper for __ros_syscall
-#define ros_syscall(which,a0,a1,a2,a3,a4) \
-   __ros_syscall(which,(long)(a0),(long)(a1),(long)(a2),(long)(a3),(long)(a4))
 #include <ros/arch/syscall.h>
+#include <ros/event.h>
+#include <ros/atomic.h>
+
+/* Flags for an individual syscall. */
+#define SC_DONE                                        0x0001          /* SC is done */
+#define SC_PROGRESS                            0x0002          /* SC made progress */
+#define SC_UEVENT                              0x0004          /* user has an ev_q */
+#define SC_K_LOCK                              0x0008          /* kernel locked sysc */
+#define SC_ABORT                               0x0010          /* syscall abort attempted */
+
+#define MAX_ERRSTR_LEN                 128
+
+struct syscall {
+       unsigned int                            num;
+       int                                                     err;                    /* errno */
+       long                                            retval;
+       atomic_t                                        flags;
+       struct event_queue                      *ev_q;
+       void                                            *u_data;
+       long                                            arg0;
+       long                                            arg1;
+       long                                            arg2;
+       long                                            arg3;
+       long                                            arg4;
+       long                                            arg5;
+       char                                            errstr[MAX_ERRSTR_LEN];
+};
+
+struct childfdmap {
+       unsigned int                            parentfd;
+       unsigned int                            childfd;
+       int                                                     ok;
+};
+
+struct argenv {
+       size_t argc;
+       size_t envc;
+       char buf[];
+       /* The buf array is laid out as follows:
+        * buf {
+        *   char *argv[argc]; // Offset of arg relative to &argbuf[0]
+        *   char *envp[envc]; // Offset of envvar relative to &argbuf[0]
+        *   char argbuf[sum(map(strlen + 1, argv + envp))];
+        * }
+        */
+};
+
+#ifndef ROS_KERNEL
+
+/* Temp hack, til the rest of glibc/userspace uses sys/syscall.h */
+#include <sys/syscall.h>
+#endif /* ifndef ROS_KERNEL */
 
-#endif /* !ROS_INCLUDE_SYSCALL_H */
+#endif /* ROS_INC_SYSCALL_H */