Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d77a25074a8f845401f0eb786ebb8996e45d9e22
Commit:     d77a25074a8f845401f0eb786ebb8996e45d9e22
Parent:     3176bc3e59cc4e30ac10888f08124b31969a7a88
Author:     Nitin A Kamble <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 12 17:40:33 2007 -0700
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 17:52:53 2008 +0200

    KVM: x86 emulator: Implement emulation of instruction: inc & dec
    
    Instructions:
        inc r16/r32 (opcode 0x40-0x47)
        dec r16/r32 (opcode 0x48-0x4f)
    
    Signed-off-by: Nitin A Kamble <[EMAIL PROTECTED]>
    Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/x86_emulate.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 75fd23b..988c649 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -96,8 +96,12 @@ static u8 opcode_table[256] = {
        ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
        ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
        0, 0, 0, 0,
-       /* 0x40 - 0x4F */
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       /* 0x40 - 0x47 */
+       ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
+       ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
+       /* 0x48 - 0x4F */
+       ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
+       ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
        /* 0x50 - 0x57 */
        ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
        ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
@@ -1376,6 +1380,18 @@ special_insn:
        if (c->twobyte)
                goto twobyte_special_insn;
        switch (c->b) {
+       case 0x40 ... 0x47: /* inc r16/r32 */
+               c->dst.bytes = c->op_bytes;
+               c->dst.ptr = (unsigned long *)&c->regs[c->b & 0x7];
+               c->dst.val = *c->dst.ptr;
+               emulate_1op("inc", c->dst, ctxt->eflags);
+               break;
+       case 0x48 ... 0x4f: /* dec r16/r32 */
+               c->dst.bytes = c->op_bytes;
+               c->dst.ptr = (unsigned long *)&c->regs[c->b & 0x7];
+               c->dst.val = *c->dst.ptr;
+               emulate_1op("dec", c->dst, ctxt->eflags);
+               break;
        case 0x50 ... 0x57:  /* push reg */
                if (c->op_bytes == 2)
                        c->src.val = (u16) c->regs[c->b & 0x7];
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to