First run at integrating LWIP into the tree (again)
[akaros.git] / kern / include / ros / syscall.h
index 128ff43..809db14 100644 (file)
@@ -1,35 +1,64 @@
 #ifndef ROS_INCLUDE_SYSCALL_H
 #define ROS_INCLUDE_SYSCALL_H
 
-#include <arch/types.h>
-#include <ros/ring_buffer.h>
+/* system call numbers.  need to #def them for use in assembly. */
+#define SYS_null                                        1
+#define SYS_cache_buster                        2
+#define SYS_cache_invalidate            3
+#define SYS_reboot                                      4
+#define SYS_cputs                                       5
+#define SYS_cgetc                                       6
+#define SYS_getcpuid                            7
+#define SYS_getvcoreid                          8
+#define SYS_getpid                                      9
+#define SYS_proc_create                                10
+#define SYS_proc_run                           11
+#define SYS_proc_destroy                       12
+#define SYS_yield                                      13
+#define SYS_run_binary                         14
+#define SYS_fork                                       15
+#define SYS_exec                                       16
+#define SYS_trywait                                    17
+#define SYS_mmap                                       18
+#define SYS_munmap                                     19
+#define SYS_mprotect                           20
+/* // these are the other mmap related calls, some of which we'll implement
+#define SYS_mincore // can read page tables instead
+#define SYS_madvise
+#define SYS_mlock
+#define SYS_msync
+*/
+#define SYS_brk                                                21
+#define SYS_shared_page_alloc          22
+#define SYS_shared_page_free           23
+#define SYS_resource_req                       24
+/* Platform specific syscalls */
+#define SYS_serial_read                                25
+#define SYS_serial_write                       26
+#define SYS_eth_read                           27
+#define SYS_eth_write                          28
+#define SYS_eth_get_mac_addr                   29
+#define SYS_frontend                           30
 
-/* system call numbers */
-enum
-{
-       SYS_begofcalls, //Should always be first
-
-       SYS_null,
-       SYS_cache_buster,
-       SYS_cache_invalidate,
-       SYS_cputs,
-       SYS_cgetc,
-       SYS_getcpuid,
-       SYS_serial_write,
-       SYS_serial_read,
-       SYS_shared_page_alloc,
-       SYS_shared_page_free,
-       SYS_getenvid,
-       SYS_env_destroy,
-       SYS_yield,
-       SYS_proc_create,
-       SYS_proc_run,
-
-       SYS_endofcalls //Should always be last
-};
-#define NSYSCALLS (SYS_endofcalls -1)
-// syscall number starts at 1 and goes up to NSYSCALLS, without holes.
-#define INVALID_SYSCALL(syscallno) ((syscallno) > NSYSCALLS)
+#define SYS_read                               100
+#define SYS_write                              101
+#define SYS_open                               102
+#define SYS_close                              103
+#define SYS_fstat                              104
+#define SYS_stat                               105
+#define SYS_lstat                              106
+#define SYS_fcntl                              107
+#define SYS_access                             108
+#define SYS_umask                              109
+#define SYS_chmod                              110
+#define SYS_lseek                              111
+#define SYS_link                               112
+#define SYS_unlink                             113
+#define SYS_chdir                              114
+#define SYS_getcwd                             115
+#define SYS_gettimeofday               116
+#define SYS_tcgetattr                  117
+#define SYS_tcsetattr                  118
 
 /* For Buster Measurement Flags */
 #define BUSTER_SHARED                  0x0001
@@ -38,18 +67,4 @@ enum
 #define BUSTER_PRINT_TICKS             0x0008
 #define BUSTER_JUST_LOCKS              0x0010 // unimplemented
 
-#define NUM_SYSCALL_ARGS 6
-typedef struct syscall_req {
-       uint32_t num;
-       uint32_t flags;
-       uint32_t args[NUM_SYSCALL_ARGS];
-} syscall_req_t;
-
-typedef struct syscall_rsp {
-       int32_t retval;
-} syscall_rsp_t;
-
-// Generic Syscall Ring Buffer
-DEFINE_RING_TYPES(syscall, syscall_req_t, syscall_rsp_t);
-
 #endif /* !ROS_INCLUDE_SYSCALL_H */