Avoid void* error buffer declaration
authorDavide Libenzi <dlibenzi@google.com>
Thu, 8 Oct 2015 21:23:05 +0000 (14:23 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 13 Oct 2015 18:46:03 +0000 (14:46 -0400)
Place errbuf declaration so that it can be explicitly declared, instead
as void pointer.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
[Touched up commit formatting / typos]
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/drivers/dev/eventfd.c
kern/include/err.h
kern/include/kthread.h
kern/include/ns.h
kern/src/fdtap.c
kern/src/printfmt.c
kern/src/syscall.c

index faa8aba..395eaa0 100644 (file)
@@ -18,6 +18,7 @@
 #include <error.h>
 #include <sys/queue.h>
 #include <fdtap.h>
+#include <syscall.h>
 
 struct dev efd_devtab;
 
index 09bbcc7..37fd8e5 100644 (file)
@@ -4,11 +4,7 @@
 #define ROS_KERN_ERR_H
 
 #include <setjmp.h>
-#include <syscall.h>
-
-struct errbuf {
-       struct jmpbuf jmpbuf;
-};
+#include <kthread.h>
 
 #define ERRSTACK(x) struct errbuf *prev_errbuf; struct errbuf errstack[(x)];   \
                     int curindex = 0;
index c5d90a4..bc0bade 100644 (file)
 #include <atomic.h>
 #include <setjmp.h>
 
+struct errbuf {
+       struct jmpbuf jmpbuf;
+};
+
 struct proc;
 struct kthread;
 struct semaphore;
@@ -31,7 +35,7 @@ struct kthread {
        uintptr_t                                       stacktop;
        struct proc                                     *proc;
        struct syscall                          *sysc;
-       void                                            *errbuf;        /* TODO: avoiding include loops */
+       struct errbuf                           *errbuf;
        TAILQ_ENTRY(kthread)            link;
        /* ID, other shit, etc */
        bool                                            is_ktask;       /* default is FALSE */
index aacffbd..8e0d483 100644 (file)
@@ -8,6 +8,8 @@
 #include <rwlock.h>
 #include <linker_func.h>
 #include <fdtap.h>
+#include <ros/fs.h>
+#include <vfs.h>
 
 /*
  * functions (possibly) linked in, complete, from libc.
index 83d6749..4c93e5a 100644 (file)
@@ -9,6 +9,7 @@
 #include <vfs.h>
 #include <event.h>
 #include <kmalloc.h>
+#include <syscall.h>
 #include <error.h>
 
 
index 4bbceb2..b597e75 100644 (file)
@@ -7,6 +7,7 @@
 #include <string.h>
 #include <stdarg.h>
 #include <kthread.h>
+#include <syscall.h>
 #include <ns.h>
 
 /* Print a number (base <= 16) in reverse order,
index 60554ff..baa2f8e 100644 (file)
@@ -282,7 +282,7 @@ char *current_errstr(void)
 struct errbuf *get_cur_errbuf(void)
 {
        struct per_cpu_info *pcpui = &per_cpu_info[core_id()];
-       return (struct errbuf*)pcpui->cur_kthread->errbuf;
+       return pcpui->cur_kthread->errbuf;
 }
 
 void set_cur_errbuf(struct errbuf *ebuf)