X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_xed.c;h=140ecb69f857f2c6a584d08c67df5535f1a0aaf6;hb=f9bb3db89469169bb5775dc031d89e570c6fed70;hp=e48a1b8c941c9f93a3950c2e7f53d84ecd4f9548;hpb=af355c370ac80f8e19d6375cb3070213c29a92eb;p=palacios-OLD.git diff --git a/palacios/src/palacios/vmm_xed.c b/palacios/src/palacios/vmm_xed.c index e48a1b8..140ecb6 100644 --- a/palacios/src/palacios/vmm_xed.c +++ b/palacios/src/palacios/vmm_xed.c @@ -1,3 +1,6 @@ +/* Northwestern University */ +/* (c) 2008, Jack Lange */ + #ifdef __DECODER_TEST__ #include "vmm_decoder.h" #include "vmm_xed.h" @@ -11,6 +14,7 @@ #include #include + #endif static xed_state_t decoder_state; @@ -115,7 +119,8 @@ int init_decoder() { } -int v3_basic_mem_decode(struct guest_info * info, addr_t instr_ptr, uint_t * size, uint_t * instr_length) { + +int v3_basic_mem_decode(struct guest_info * info, addr_t instr_ptr, struct basic_instr_info * instr_info) { xed_decoded_inst_t xed_instr; xed_error_enum_t xed_error; @@ -137,7 +142,7 @@ int v3_basic_mem_decode(struct guest_info * info, addr_t instr_ptr, uint_t * siz return -1; } - *instr_length = xed_decoded_inst_get_length(&xed_instr); + instr_info->instr_length = xed_decoded_inst_get_length(&xed_instr); if (xed_decoded_inst_number_of_memory_operands(&xed_instr) == 0) { @@ -145,7 +150,22 @@ int v3_basic_mem_decode(struct guest_info * info, addr_t instr_ptr, uint_t * siz return -1; } - *size = xed_decoded_inst_get_memory_operand_length(&xed_instr,0); + instr_info->op_size = xed_decoded_inst_get_memory_operand_length(&xed_instr, 0); + + + xed_category_enum_t cat = xed_decoded_inst_get_category(&xed_instr); + if (cat == XED_CATEGORY_STRINGOP) { + instr_info->str_op = 1; + } else { + instr_info->str_op = 0; + } + + xed_operand_values_t * operands = xed_decoded_inst_operands(&xed_instr); + if (xed_operand_values_has_real_rep(operands)) { + instr_info->has_rep = 1; + } else { + instr_info->has_rep = 0; + } return 0; }