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 new copyright and license
[palacios.git] / palacios / include / palacios / vmm_decoder.h
index bee9b4f..de00a02 100644 (file)
@@ -1,5 +1,25 @@
-#ifndef __VMM_EMULATE_H
-#define __VMM_EMULATE_H
+
+/*
+ * This file is part of the Palacios Virtual Machine Monitor developed
+ * by the V3VEE Project with funding from the United States National 
+ * Science Foundation and the Department of Energy.  
+ *
+ * The V3VEE Project is a joint project between Northwestern University
+ * and the University of New Mexico.  You can find out more at 
+ * http://www.v3vee.org
+ *
+ * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> 
+ * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org> 
+ * All rights reserved.
+ *
+ * Author: Jack Lange <jarusl@cs.northwestern.edu>
+ *
+ * This is free software.  You are permitted to use,
+ * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
+ */
+
+#ifndef __VMM_DECODER_H
+#define __VMM_DECODER_H
 
 #ifdef __V3VEE__
 
@@ -7,7 +27,7 @@
 #include <palacios/vmm.h>
 
 
-typedef enum {INVALID_OPERAND, REG_OPERAND, MEM_OPERAND} operand_type_t;
+typedef enum {INVALID_OPERAND, REG_OPERAND, MEM_OPERAND, IMM_OPERAND} operand_type_t;
 
 struct x86_operand {
   addr_t operand;
@@ -40,13 +60,22 @@ struct x86_instr {
   uint_t instr_length;
   addr_t opcode;    // a pointer to the V3_OPCODE_[*] arrays defined below
   uint_t num_operands;
-  struct x86_operand first_operand;
-  struct x86_operand second_operand;
+  struct x86_operand dst_operand;
+  struct x86_operand src_operand;
   struct x86_operand third_operand;
   void * decoder_data;
 };
 
 
+struct basic_instr_info {
+  uint_t instr_length;
+  uint_t op_size;
+  uint_t str_op    : 1;
+  uint_t has_rep : 1;
+};
+
+
+
   /************************/
  /* EXTERNAL DECODER API */
 /************************/
@@ -80,10 +109,16 @@ int v3_decode(struct guest_info * info, addr_t instr_ptr, struct x86_instr * ins
 int v3_encode(struct guest_info * info, struct x86_instr * instr, char * instr_buf);
 
 
+/*
+ * Gets the operand size for a memory operation
+ *
+ */
+int v3_basic_mem_decode(struct guest_info * info, addr_t instr_ptr, struct basic_instr_info * instr_info);
 
 
 
-
+/* Removes a rep prefix in place */
+void strip_rep_prefix(uchar_t * instr, int length);