X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_decoder.h;h=b6e65e6ad2be7e0c590eba630cc2032bae0dd272;hb=101529b6eae500272347287df43ec51aa003d0aa;hp=bee9b4f01f0a886a37ff7665ca54766935e6e670;hpb=07820ee58e9b356341ce86cd2b2938d3abef60c9;p=palacios.git diff --git a/palacios/include/palacios/vmm_decoder.h b/palacios/include/palacios/vmm_decoder.h index bee9b4f..b6e65e6 100644 --- a/palacios/include/palacios/vmm_decoder.h +++ b/palacios/include/palacios/vmm_decoder.h @@ -1,3 +1,6 @@ +/* (c) 2008, Jack Lange */ +/* (c) 2008, The V3VEE Project */ + #ifndef __VMM_EMULATE_H #define __VMM_EMULATE_H @@ -7,7 +10,7 @@ #include -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 +43,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 +92,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);