ia64/xen-unstable

changeset 13267:d04ff58bbe18

merge
author Ian Campbell <ian.campbell@xensource.com>
date Fri Jan 05 10:40:19 2007 +0000 (2007-01-05)
parents f890bbfc2d25 583f3e93a421
children 344c8ae3cecb
files
line diff
     1.1 --- a/xen/arch/x86/x86_emulate.c	Fri Jan 05 10:39:45 2007 +0000
     1.2 +++ b/xen/arch/x86/x86_emulate.c	Fri Jan 05 10:40:19 2007 +0000
     1.3 @@ -85,9 +85,15 @@ static uint8_t opcode_table[256] = {
     1.4      ByteOp|DstReg|SrcMem|ModRM, DstReg|SrcMem|ModRM,
     1.5      0, 0, 0, 0,
     1.6      /* 0x40 - 0x4F */
     1.7 -    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     1.8 +    ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
     1.9 +    ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
    1.10 +    ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
    1.11 +    ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
    1.12      /* 0x50 - 0x5F */
    1.13 -    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    1.14 +    ImplicitOps|Mov, ImplicitOps|Mov, ImplicitOps|Mov, ImplicitOps|Mov,
    1.15 +    ImplicitOps|Mov, ImplicitOps|Mov, ImplicitOps|Mov, ImplicitOps|Mov,
    1.16 +    ImplicitOps|Mov, ImplicitOps|Mov, ImplicitOps|Mov, ImplicitOps|Mov,
    1.17 +    ImplicitOps|Mov, ImplicitOps|Mov, ImplicitOps|Mov, ImplicitOps|Mov,
    1.18      /* 0x60 - 0x6F */
    1.19      0, 0, 0, DstReg|SrcMem32|ModRM|Mov /* movsxd (x86/64) */,
    1.20      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    1.21 @@ -864,8 +870,8 @@ x86_emulate_memop(
    1.22          dst.val = src.val;
    1.23          break;
    1.24      case 0x8f: /* pop (sole member of Grp1a) */
    1.25 -        /* 64-bit mode: POP always pops a 64-bit operand. */
    1.26 -        if ( mode == X86EMUL_MODE_PROT64 )
    1.27 +        /* 64-bit mode: POP defaults to a 64-bit operand. */
    1.28 +        if ( (mode == X86EMUL_MODE_PROT64) && (dst.bytes == 4) )
    1.29              dst.bytes = 8;
    1.30          if ( (rc = ops->read(x86_seg_ss, truncate_ea(_regs.esp),
    1.31                               &dst.val, dst.bytes, ctxt)) != 0 )
    1.32 @@ -940,8 +946,8 @@ x86_emulate_memop(
    1.33              emulate_1op("dec", dst, _regs.eflags);
    1.34              break;
    1.35          case 6: /* push */
    1.36 -            /* 64-bit mode: PUSH always pushes a 64-bit operand. */
    1.37 -            if ( mode == X86EMUL_MODE_PROT64 )
    1.38 +            /* 64-bit mode: PUSH defaults to a 64-bit operand. */
    1.39 +            if ( (mode == X86EMUL_MODE_PROT64) && (dst.bytes == 4) )
    1.40              {
    1.41                  dst.bytes = 8;
    1.42                  if ( (rc = ops->read(dst.mem.seg, dst.mem.off,
    1.43 @@ -1011,6 +1017,37 @@ x86_emulate_memop(
    1.44      }
    1.45      switch ( b )
    1.46      {
    1.47 +    case 0x40 ... 0x4f: /* inc/dec reg */
    1.48 +        dst.type  = OP_REG;
    1.49 +        dst.reg   = decode_register(b&7, &_regs, 0);
    1.50 +        dst.bytes = op_bytes;
    1.51 +        dst.orig_val = dst.val = *dst.reg;
    1.52 +        if ( b & 8 )
    1.53 +            emulate_1op("dec", dst, _regs.eflags);
    1.54 +        else
    1.55 +            emulate_1op("inc", dst, _regs.eflags);
    1.56 +        break;
    1.57 +    case 0x50 ... 0x57: /* push reg */
    1.58 +        dst.type  = OP_MEM;
    1.59 +        dst.bytes = op_bytes;
    1.60 +        if ( (mode == X86EMUL_MODE_PROT64) && (dst.bytes == 4) )
    1.61 +            dst.bytes = 8;
    1.62 +        dst.val = *(unsigned long *)decode_register(b&7, &_regs, 0);
    1.63 +        register_address_increment(_regs.esp, -dst.bytes);
    1.64 +        dst.mem.seg = x86_seg_ss;
    1.65 +        dst.mem.off = truncate_ea(_regs.esp);
    1.66 +        break;
    1.67 +    case 0x58 ... 0x5f: /* pop reg */
    1.68 +        dst.type  = OP_REG;
    1.69 +        dst.reg   = decode_register(b&7, &_regs, 0);
    1.70 +        dst.bytes = op_bytes;
    1.71 +        if ( (mode == X86EMUL_MODE_PROT64) && (dst.bytes == 4) )
    1.72 +            dst.bytes = 8;
    1.73 +        if ( (rc = ops->read(x86_seg_ss, truncate_ea(_regs.esp),
    1.74 +                             &dst.val, dst.bytes, ctxt)) != 0 )
    1.75 +            goto done;
    1.76 +        register_address_increment(_regs.esp, dst.bytes);
    1.77 +        break;
    1.78      case 0xa0 ... 0xa1: /* mov mem.offs,{%al,%ax,%eax,%rax} */
    1.79          /* Source EA is not encoded via ModRM. */
    1.80          dst.type  = OP_REG;