Rewrite the lunabuild toolchain with enhanced feature (#60)
[lunaix-os.git] / lunaix-os / kernel / device / poll.c
index 58d3621988831f13d3223bb30a6f328e37782a31..159c2bb87cffb896cb6312220fb5cae6421df978 100644 (file)
@@ -7,6 +7,7 @@
 #include <lunaix/spike.h>
 #include <lunaix/syscall.h>
 #include <lunaix/syscall_utils.h>
+#include <lunaix/kpreempt.h>
 
 #define MAX_POLLER_COUNT 16
 
@@ -153,7 +154,7 @@ static void
 __wait_until_event()
 {
     block_current_thread();
-    sched_pass();
+    yield_current();
 }
 
 void
@@ -244,9 +245,13 @@ iopoll_install(struct thread* thread, struct v_fd* fd)
     return pld;
 }
 
-__DEFINE_LXSYSCALL2(int, pollctl, int, action, va_list, va)
+__DEFINE_LXSYSCALL2(int, pollctl, int, action, sc_va_list, _ap)
 {
     int retcode = 0;
+    va_list va;
+
+    convert_valist(&va, _ap);
+    
     switch (action) {
         case _SPOLL_ADD: {
             int* ds = va_arg(va, int*);