Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215742
b: refs/heads/master
c: b250e60
h: refs/heads/master
v: v3
  • Loading branch information
Avi Kivity committed Oct 24, 2010
1 parent b9e5a20 commit d63ac80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0ef753b8c323f5b8d75d7dc57ceef6b35982afdb
refs/heads/master: b250e605895d02cede78922d034f7825af72a8b5
12 changes: 9 additions & 3 deletions trunk/arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
#define SrcImmFAddr (0xb<<4) /* Source is immediate far address */
#define SrcMemFAddr (0xc<<4) /* Source is far address in memory */
#define SrcAcc (0xd<<4) /* Source Accumulator */
#define SrcImmU16 (0xe<<4) /* Immediate operand, unsigned, 16 bits */
#define SrcMask (0xf<<4)
/* Generic ModRM decode. */
#define ModRM (1<<8)
Expand Down Expand Up @@ -2678,13 +2679,17 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt)
srcmem_common:
c->src = memop;
break;
case SrcImmU16:
c->src.bytes = 2;
goto srcimm;
case SrcImm:
case SrcImmU:
c->src.type = OP_IMM;
c->src.addr.mem = c->eip;
c->src.bytes = (c->d & ByteOp) ? 1 : c->op_bytes;
if (c->src.bytes == 8)
c->src.bytes = 4;
srcimm:
c->src.type = OP_IMM;
c->src.addr.mem = c->eip;
/* NB. Immediates are sign-extended as necessary. */
switch (c->src.bytes) {
case 1:
Expand All @@ -2697,7 +2702,8 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt)
c->src.val = insn_fetch(s32, 4, c->eip);
break;
}
if ((c->d & SrcMask) == SrcImmU) {
if ((c->d & SrcMask) == SrcImmU
|| (c->d & SrcMask) == SrcImmU16) {
switch (c->src.bytes) {
case 1:
c->src.val &= 0xff;
Expand Down

0 comments on commit d63ac80

Please sign in to comment.