[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lost] [Patch 3/3] kernel2: v_and_wait_for_rpc



+ kernel2: v_and_wait_for_rpc
Index: trunk/src/kernel2/include/syscall.h
===================================================================
--- trunk.orig/src/kernel2/include/syscall.h
+++ trunk/src/kernel2/include/syscall.h
@@ -96,6 +96,9 @@ int syscall_pm_p(void);
 /// Kritischen Abschnitt verlassen
 int syscall_pm_v(pid_t pid);
 
+/// Kritischen Abschnitt verlassen und auf RPC warten
+int syscall_pm_v_and_wait_for_rpc();
+
 /// Die Kontrolle an einen anderen Task abgeben
 void syscall_pm_sleep(void);
 
Index: trunk/src/kernel2/src/syscall.c
===================================================================
--- trunk.orig/src/kernel2/src/syscall.c
+++ trunk/src/kernel2/src/syscall.c
@@ -62,6 +62,8 @@ void syscall_init()
 
     syscall_register(SYSCALL_PM_P, (void*) &syscall_pm_p, 0);
     syscall_register(SYSCALL_PM_V, (void*) &syscall_pm_v, 1);
+    syscall_register(SYSCALL_PM_V_AND_WAIT_FOR_RPC, (void*)
+        &syscall_pm_v_and_wait_for_rpc, 0);
 
     syscall_register(SYSCALL_PM_CREATE_PROCESS, &syscall_pm_create_process, 4);
     syscall_register(SYSCALL_PM_INIT_PAGE, &syscall_init_child_page, 4);
Index: trunk/src/kernel2/src/syscalls/pv.c
===================================================================
--- trunk.orig/src/kernel2/src/syscalls/pv.c
+++ trunk/src/kernel2/src/syscalls/pv.c
@@ -72,3 +72,17 @@ int syscall_pm_v(pid_t pid)
 
     return 0;
 }
+
+/**
+ * Kritischen Abschnitt verlassen und auf RPC warten
+ *
+ * @param pid PID, fuer die wieder RPCs zugelassen werden sollen. 0 fuer
+ * den aufrufenden Prozess selbst
+ */
+int syscall_pm_v_and_wait_for_rpc()
+{
+    syscall_pm_v(0);
+    syscall_pm_wait_for_rpc();
+
+    return 0;
+}