X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_decoder.c;h=8aca0e6bb0d9f46477384f3a6b7bc66f0064715e;hb=58f350b730e9c9c091465ec1a39f2d71e92dd6f6;hp=6d1299a4b67c4b9e06fc0b116bb37f9d6d783925;hpb=07820ee58e9b356341ce86cd2b2938d3abef60c9;p=palacios.releases.git diff --git a/palacios/src/palacios/vmm_decoder.c b/palacios/src/palacios/vmm_decoder.c index 6d1299a..8aca0e6 100644 --- a/palacios/src/palacios/vmm_decoder.c +++ b/palacios/src/palacios/vmm_decoder.c @@ -1,3 +1,23 @@ +/* + * 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 + * Copyright (c) 2008, The V3VEE Project + * All rights reserved. + * + * Author: Jack Lange + * + * This is free software. You are permitted to use, + * redistribute, and modify it as specified in the file "V3VEE_LICENSE". + */ + + #include @@ -8,3 +28,23 @@ int opcode_cmp(const uchar_t * op1, const uchar_t * op2) { return memcmp(op1 + 1, op2 + 1, op1[0]); } } + + +void strip_rep_prefix(uchar_t * instr, int length) { + int read_ctr = 0; + int write_ctr = 0; + int found = 0; + + while (read_ctr < length) { + if ((!found) && + ( (instr[read_ctr] == 0xF2) || + (instr[read_ctr] == 0xF3))) { + read_ctr++; + found = 1; + } else { + instr[write_ctr] = instr[read_ctr]; + write_ctr++; + read_ctr++; + } + } +}