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.


HRT image replacement from ROS application
[palacios.git] / guest / linux / hvm-ros / v3_hvm_ros_user.c
index f292626..345f8cb 100644 (file)
@@ -240,6 +240,61 @@ static void wait_for_completion()
 }
 
 
+int v3_hvm_ros_install_hrt_image(void *image, uint64_t size)
+{
+    unsigned long long rc, num, a1=0, a2=0, a3=0, a4=0, a5=0, a6=0, a7=0, a8=0;
+    unsigned long long i;
+    volatile long long sum=0;
+
+    num = 0xf00d;
+    a1 = 0x8; // install image
+    a2 = (unsigned long long) image;
+    a3 = size;
+
+    // touch the whoel image to make it has ptes
+    for (i=0;i<size;i++) { 
+       sum+=((char*)image)[i];
+    }
+
+    HCALL(rc,num,a1,a2,a3,a4,a5,a6,a7,a8);
+
+    if (rc) { 
+       return -1;
+    } else {
+       return 0;
+    }
+}
+
+int v3_hvm_ros_reset(reset_type what)
+{
+    unsigned long long num, a1=0, a2=0, a3=0, a4=0, a5=0, a6=0, a7=0, a8=0;
+    unsigned long long rc;
+    
+    num=0xf00d;
+    switch (what) { 
+       case RESET_ROS:
+           a1 = 0x1;
+           break;
+       case RESET_HRT:
+           a1 = 0x2;
+           break;
+       case RESET_BOTH:
+           a1 = 0x3;
+           break;
+    }
+    
+    HCALL(rc,num,a1,a2,a3,a4,a5,a6,a7,a8);
+    
+    if (rc) {
+       INFO("Error in request to reset rc=0x%llx\n",rc);
+       return -1;
+    } else {
+       // no waiting for completion here
+       return 0;
+    }
+}
+
+
 int v3_hvm_ros_merge_address_spaces()
 {
     unsigned long long num, a1=0, a2=0, a3=0, a4=0, a5=0, a6=0, a7=0, a8=0;