new_intr_shadow = hvmemul_ctxt->intr_shadow;
/* MOV-SS instruction toggles MOV-SS shadow, else we just clear it. */
- if ( hvmemul_ctxt->ctxt.retire.flags.mov_ss )
+ if ( hvmemul_ctxt->ctxt.retire.mov_ss )
new_intr_shadow ^= HVM_INTR_SHADOW_MOV_SS;
else
new_intr_shadow &= ~HVM_INTR_SHADOW_MOV_SS;
/* STI instruction toggles STI shadow, else we just clear it. */
- if ( hvmemul_ctxt->ctxt.retire.flags.sti )
+ if ( hvmemul_ctxt->ctxt.retire.sti )
new_intr_shadow ^= HVM_INTR_SHADOW_STI;
else
new_intr_shadow &= ~HVM_INTR_SHADOW_STI;
hvm_funcs.set_interrupt_shadow(curr, new_intr_shadow);
}
- if ( hvmemul_ctxt->ctxt.retire.flags.hlt &&
+ if ( hvmemul_ctxt->ctxt.retire.hlt &&
!hvm_local_events_need_delivery(curr) )
{
hvm_hlt(regs->eflags);
state->eip = ctxt->regs->eip;
/* Initialise output state in x86_emulate_ctxt */
- ctxt->retire.byte = 0;
+ ctxt->retire.raw = 0;
op_bytes = def_op_bytes = ad_bytes = def_ad_bytes = ctxt->addr_size/8;
if ( op_bytes == 8 )
case 0x17: /* pop %%ss */
src.val = x86_seg_ss;
- ctxt->retire.flags.mov_ss = 1;
+ ctxt->retire.mov_ss = true;
goto pop_seg;
case 0x1e: /* push %%ds */
if ( (rc = load_seg(seg, src.val, 0, NULL, ctxt, ops)) != 0 )
goto done;
if ( seg == x86_seg_ss )
- ctxt->retire.flags.mov_ss = 1;
+ ctxt->retire.mov_ss = true;
dst.type = OP_NONE;
break;
case 0xf4: /* hlt */
generate_exception_if(!mode_ring0(), EXC_GP, 0);
- ctxt->retire.flags.hlt = 1;
+ ctxt->retire.hlt = true;
break;
case 0xf5: /* cmc */
if ( !(_regs.eflags & EFLG_IF) )
{
_regs.eflags |= EFLG_IF;
- ctxt->retire.flags.sti = 1;
+ ctxt->retire.sti = true;
}
break;
/* Retirement state, set by the emulator (valid only on X86EMUL_OKAY). */
union {
+ uint8_t raw;
struct {
- uint8_t hlt:1; /* Instruction HLTed. */
- uint8_t mov_ss:1; /* Instruction sets MOV-SS irq shadow. */
- uint8_t sti:1; /* Instruction sets STI irq shadow. */
- } flags;
- uint8_t byte;
+ bool hlt:1; /* Instruction HLTed. */
+ bool mov_ss:1; /* Instruction sets MOV-SS irq shadow. */
+ bool sti:1; /* Instruction sets STI irq shadow. */
+ };
} retire;
};