Added the null syscall and a userapp that exploits it.
[akaros.git] / inc / syscall.h
index bdcee2b..b8ea258 100644 (file)
@@ -2,22 +2,32 @@
 #define ROS_INC_SYSCALL_H
 
 #include <inc/types.h>
+#include <inc/ring_buffer.h>
 
 /* system call numbers */
 enum
 {
-       SYS_cputs = 0,
+       SYS_null = 1,
+       SYS_cputs,
        SYS_cgetc,
        SYS_getenvid,
        SYS_env_destroy,
-       NSYSCALLS
 };
+#define NSYSCALLS (SYS_env_destroy)
 
 #define NUM_SYS_ARGS 6
-typedef struct Syscall {
+typedef struct SyscallRequest {
        uint32_t num;
        uint32_t flags;
        uint32_t args[NUM_SYS_ARGS];
-} syscall_t;
+} syscall_req_t;
+
+typedef struct SyscallResponse {
+       uint32_t retval;
+} syscall_resp_t;
+
+
+// Generic Syscall Ring Buffer
+DEFINE_RING_TYPES(syscall, syscall_req_t, syscall_resp_t);
 
 #endif /* !ROS_INC_SYSCALL_H */