Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


initial skeleton
Jack Lange [Tue, 26 Apr 2011 21:20:13 +0000 (16:20 -0500)]
palacios/include/palacios/vmm_barrier.h
palacios/src/palacios/vmm_barrier.c

index 4513c09..d4b7eda 100644 (file)
@@ -26,8 +26,7 @@
 #include <util/vmm_lock.h>
 
 struct v3_barrier {
-    
-
+    uint64_t cpus;
     int active;     // If 1, barrier is active, everyone must wait 
                     // If 0, barrier is clear, can proceed
 
@@ -35,6 +34,10 @@ struct v3_barrier {
 };
 
 
+int v3_init_barrier(struct v3_barrier * barrier);
+
+int v3_activate_barrier(struct guest_info * core);
+int v3_check_barrier(struct guest_info * core);
 
 
 #endif
index 1115ce0..614ceca 100644 (file)
 
 
 #include <util/vmm_barrier.h>
+
+
+
+int v3_init_barrier(struct v3_barrier * barrier) {
+    memset(barrier, 0, sizeof(struct v3_barrier));
+    v3_lock_init(&(barrier->lock));
+
+    return 0;
+}
+
+
+int v3_activate_barrier(struct guest_info * core, struct v3_barrier * barrier) {
+    addr_t flag;
+    int acquired = 0;
+    
+    flag = v3_lock_irqsave(barrier->lock);
+
+    if (barrier->active == 0) {
+       barrier->active = 1;
+       acquired = 1;
+    }
+
+    v3_unlock_irqrestore(barrier->lock, flag);
+
+    if (acquired == 0) {
+       return -1;
+    }
+
+
+    // wait for barrier catch
+
+
+    return 0;
+}
+
+
+
+
+int v3_deactivate_barrier(struct v3_barrier * barrier) {
+
+}
+
+
+int v3_check_barrier(struct guest_info * core, struct v3_barrier * barrier) {
+
+    if (barrier->activated == 0) {
+       return 0;
+    }
+    
+    // set cpu bit
+
+    // wait for cpu bit to clear
+
+}