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.


added segmentation helper
[palacios.git] / palacios / include / geekos / vmm_emulate.h
index 5157214..dcead40 100644 (file)
@@ -150,6 +150,21 @@ static inline int is_prefix_byte(char byte) {
 
 
 
+static inline addr_t get_addr_linear(struct guest_info * info, addr_t addr, addr_t seg_base) {
+  switch (info->cpu_mode) {
+  case REAL:
+    return addr + (seg_base << 4);
+    break;
+  case PROTECTED:
+  case PROTECTED_PG:
+    return addr + seg_base;
+    break;
+  default:
+    return 0;
+  }
+}
+
+
 typedef enum {INVALID_ADDR_TYPE, REG, DISP0, DISP8, DISP16, DISP32} modrm_mode_t;
 typedef enum {INVALID_REG_SIZE, REG64, REG32, REG16, REG8} reg_size_t;
 typedef enum {INVALID_OPERAND, REG_OPERAND, MEM_OPERAND} operand_type_t;