fixing sparc-specific compilation issues.
authorDavid Zhu <yuzhu@cs.berkeley.edu>
Sun, 15 Aug 2010 04:30:02 +0000 (21:30 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Thu, 3 Nov 2011 00:35:51 +0000 (17:35 -0700)
kern/arch/i686/ros/syscall.h
kern/arch/sparc/fpu.c
kern/arch/sparc/trap.c
kern/include/ros/common.h
kern/include/ros/ring_syscall.h
kern/include/ros/sysevent.h
kern/src/arsc.c
tests/arsc_test.c
user/parlib/asynccall.c

index eb10265..891df14 100644 (file)
@@ -6,6 +6,7 @@
 #ifndef ROS_KERNEL
 
 #include <ros/arch/bits/syscall.h>
+#include <errno.h>
 
 static inline intreg_t syscall_sysenter(uint16_t num, intreg_t a1,
                                   intreg_t a2, intreg_t a3,
index b2267c3..4314e72 100644 (file)
@@ -3,6 +3,7 @@
 #include <arch/trap.h>
 #include <umem.h>
 #include <pmap.h>
+#include <smp.h>
 
 static inline uint32_t* effective_address(trapframe_t* state, uint32_t insn)
 {
index b9a4246..0a4b46a 100644 (file)
@@ -419,7 +419,7 @@ handle_syscall(trapframe_t* state)
 
        advance_pc(state);
        enable_irq();
-       struct per_cpu_info* coreinfo = per_cpu_info[core_id()];
+       struct per_cpu_info* coreinfo = &per_cpu_info[core_id()];
 
        set_current_tf(state);
 
index 5a6b43a..d9138a6 100644 (file)
@@ -32,7 +32,7 @@ typedef size_t uintreg_t;
        for (int _var = 0, var = (next); _var < (size); _var++, var = (var + 1) % (size))
 
 // Efficient min and max operations
-#ifdef ROS_KERNEL
+//#ifdef ROS_KERNEL
 #define MIN(_a, _b)                                            \
 ({                                                             \
        typeof(_a) __a = (_a);                                  \
@@ -45,7 +45,7 @@ typedef size_t uintreg_t;
        typeof(_b) __b = (_b);                                  \
        __a >= __b ? __a : __b;                                 \
 })
-#endif
+//#endif
 
 // Rounding operations (efficient when n is a power of 2)
 // Round down to the nearest multiple of n
index 6fd2e8a..968c1af 100644 (file)
@@ -13,7 +13,7 @@ typedef struct syscall_req {
 
 typedef struct syscall_rsp {
         uint32_t retval;
-               uint32_t errno;
+               uint32_t syserr;
 } syscall_rsp_t;
 
 // Generic Syscall Ring Buffer
index 6583360..174ff07 100644 (file)
@@ -9,6 +9,8 @@
 #define ROS_SYSEVENT_H
 
 #include <ros/ring_buffer.h>
+#include <ros/arch/mmu.h>
+
 
 typedef enum {
        SYS_begofevents, //Should always be first
index 4a965b4..27e37ad 100644 (file)
@@ -97,7 +97,7 @@ static intreg_t process_generic_syscalls(struct proc *p, size_t max)
                printd("req no %d, req arg %c\n", req->num, *((char*)req->args[0]));
                
                coreinfo->cur_ret.returnloc = &(rsp.retval);
-               coreinfo->cur_ret.errno_loc = &(rsp.errno);
+               coreinfo->cur_ret.errno_loc = &(rsp.syserr);
                
                rsp.retval = syscall_async(p, req);
                // write response into the slot it came from
index b31fef4..bcb771e 100644 (file)
@@ -2,6 +2,7 @@
 #include <vcore.h>
 #include <ros/syscall.h>
 #include <arc.h>
+#include <stdio.h>
 
 int sys_cputs_async(const char *s, size_t len, syscall_desc_t* desc,                                              
                      void (*cleanup_handler)(void*), void* cleanup_data)
index f9aefd9..209e291 100644 (file)
@@ -152,7 +152,11 @@ int waiton_syscall(syscall_desc_t* desc, syscall_rsp_t* rsp)
     // run a cleanup function for this desc, if available
     if (desc->cleanup)
        desc->cleanup(desc->data);
-       return 0;
+       if (rsp->syserr){
+               errno = rsp->syserr;
+               return -1;
+       } else 
+               return 0;
 }