X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_util.h;fp=palacios%2Finclude%2Fpalacios%2Fvmm_util.h;h=323b977f2356cc449967beec8da9ef4bdc3bb30c;hp=0000000000000000000000000000000000000000;hb=a109eb919a162bd7de58d62020801bc2e633be50;hpb=5ad0c835a5bd7181a7a342478bd398ad73712306 diff --git a/palacios/include/palacios/vmm_util.h b/palacios/include/palacios/vmm_util.h new file mode 100644 index 0000000..323b977 --- /dev/null +++ b/palacios/include/palacios/vmm_util.h @@ -0,0 +1,45 @@ +#ifndef __VMM_UTIL_H +#define __VMM_UTIL_H + +#include + + +#ifndef PAGE_SIZE +#define PAGE_SIZE 4096 +#endif + + +typedef union reg_ex { + ullong_t r_reg; + struct { + uint_t low; + uint_t high; + } e_reg; + +} reg_ex_t; + + + +// These are the GPRs layed out according to 'pusha' +struct VMM_GPRs { + uint_t edi; + uint_t esi; + uint_t ebp; + uint_t esp; + uint_t ebx; + uint_t edx; + uint_t ecx; + uint_t eax; +}; + + +#define GET_LOW_32(x) (*((uint_t*)(&(x)))) +#define GET_HIGH_32(x) (*((uint_t*)(((char*)(&(x)))+4))) + + +void PrintTraceHex(unsigned char x); + +void PrintTraceMemDump(unsigned char * start, int n); + + +#endif