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.


HVM capability enhancement: asynchronous upcalls to ROS userspace
[palacios.git] / linux_usr / v3_ctrl.c
index 0183a95..54e8df7 100644 (file)
@@ -150,3 +150,24 @@ int stop_vm (const char * filename) {
 
     return 0;
 }
+
+
+/*
+ * generic ELF header buffer hash function. 
+ * Mirrors internal Palacios implementation
+ */
+unsigned long v3_hash_buffer (unsigned char * msg, unsigned int len) {
+    unsigned long hash = 0;
+    unsigned long temp = 0;
+    unsigned int i;
+
+    for (i = 0; i < len; i++) {
+        hash = (hash << 4) + *(msg + i) + i;
+        if ((temp = (hash & 0xF0000000))) {
+            hash ^= (temp >> 24);
+        }
+        hash &= ~temp;
+    }
+    return hash;
+}
+