X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_emulate.h;h=d4288a2a606877d723f580ae31ee5c22bcd6b80b;hb=a4b341afa075a6620dd087ee3a8ed850730c05c7;hp=26d4c6f6a3512e11c3185f54b15a6434d431d9b9;hpb=d8fc6aa4bc2a5d9cec50923e9d2bd30f867dd50a;p=palacios.git diff --git a/palacios/include/palacios/vmm_emulate.h b/palacios/include/palacios/vmm_emulate.h index 26d4c6f..d4288a2 100644 --- a/palacios/include/palacios/vmm_emulate.h +++ b/palacios/include/palacios/vmm_emulate.h @@ -120,6 +120,20 @@ static inline int is_prefix_byte(char byte) { } +static inline v3_reg_t get_gpr_mask(struct guest_info * info) { + switch (info->cpu_mode) { + case REAL: + return 0xffff; + break; + case PROTECTED: + case PROTECTED_PG: + return 0xffffffff; + default: + V3_ASSERT(0); + return 0; + } +} + static inline addr_t get_addr_linear(struct guest_info * info, addr_t addr, struct v3_segment * seg) { switch (info->cpu_mode) { @@ -131,6 +145,7 @@ static inline addr_t get_addr_linear(struct guest_info * info, addr_t addr, stru return addr + seg->base; break; default: + V3_ASSERT(0); return 0; } }