Added stubs for sys_serial_read and sys_serial_write for remote syscall servicing.
authorKevin Klues <klueska@cs.berkeley.edu>
Fri, 5 Jun 2009 00:52:44 +0000 (17:52 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Fri, 5 Jun 2009 00:52:44 +0000 (17:52 -0700)
include/ros/syscall.h
kern/src/syscall.c

index ee9c838..4af4c05 100644 (file)
@@ -16,6 +16,8 @@ enum
        SYS_getenvid,
        SYS_getcpuid,
        SYS_env_destroy,
+       SYS_serial_write,
+       SYS_serial_read,
 };
 #define NSYSCALLS (SYS_env_destroy)
 // syscall number starts at 1 and goes up to NSYSCALLS, without holes.
index 56323d8..9e1a71e 100644 (file)
@@ -35,6 +35,20 @@ static void sys_null(void)
        return;
 }
 
+//Write a buffer over the serial port
+static error_t sys_serial_write(env_t* e, const char *DANGEROUS buf, uint16_t len) 
+{
+    char *COUNT(len) _buf = user_mem_assert(e, buf, len, PTE_U);
+       return -1;
+}
+
+//Read a buffer over the serial port
+static uint16_t sys_serial_read(env_t* e, const char *DANGEROUS buf, uint16_t len) 
+{
+    char *COUNT(len) _buf = user_mem_assert(e, buf, len, PTE_U);
+       return len;
+}
+
 // Invalidate the cache of this core
 static void sys_cache_invalidate(void)
 {
@@ -141,6 +155,10 @@ int32_t syscall(env_t* e, uint32_t syscallno, uint32_t a1, uint32_t a2,
                case SYS_null:
                        sys_null();
                        return 0;
+               case SYS_serial_write:
+                       return sys_serial_write(e, (char *DANGEROUS)a1, (size_t)a2);
+               case SYS_serial_read:
+                       return sys_serial_read(e, (char *DANGEROUS)a1, (size_t)a2);
                case SYS_cache_invalidate:
                        sys_cache_invalidate();
                        return 0;