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.


e859ee5bae65d113900b7de46c70fceb320e13c4
[palacios.git] / palacios / src / palacios / vmm_decoder.c
1 /* Northwestern University */
2 /* (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> */
3
4 #include <palacios/vmm_decoder.h>
5
6
7 int opcode_cmp(const uchar_t * op1, const uchar_t * op2) {
8   if (op1[0] != op2[0]) {
9     return op1[0] - op2[0];;
10   } else {
11     return memcmp(op1 + 1, op2 + 1, op1[0]);
12   }
13 }
14
15
16 void strip_rep_prefix(uchar_t * instr, int length) {
17   int read_ctr = 0;
18   int write_ctr = 0;
19   int found = 0;
20
21   while (read_ctr < length) {
22     if ((!found) && 
23         ( (instr[read_ctr] == 0xF2) ||
24           (instr[read_ctr] == 0xF3))) {
25       read_ctr++;
26       found = 1;
27     } else {
28       instr[write_ctr] = instr[read_ctr];
29       write_ctr++;
30       read_ctr++;
31     }
32   }
33 }