ia64/xen-unstable

changeset 14733:d9b670f76f51

hvm: MMIO decoder rename local variable 'diff' to 'result'.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Apr 05 08:46:54 2007 +0100 (2007-04-05)
parents 97453bb714b9
children 2b24d842bbd3
files xen/arch/x86/hvm/io.c
line diff
     1.1 --- a/xen/arch/x86/hvm/io.c	Thu Apr 05 08:44:55 2007 +0100
     1.2 +++ b/xen/arch/x86/hvm/io.c	Thu Apr 05 08:46:54 2007 +0100
     1.3 @@ -483,7 +483,7 @@ static void hvm_mmio_assist(struct cpu_u
     1.4  {
     1.5      int sign = p->df ? -1 : 1;
     1.6      int size = -1, index = -1;
     1.7 -    unsigned long value = 0, diff = 0;
     1.8 +    unsigned long value = 0, result = 0;
     1.9      unsigned long src, dst;
    1.10  
    1.11      src = mmio_opp->operand[0];
    1.12 @@ -604,15 +604,15 @@ static void hvm_mmio_assist(struct cpu_u
    1.13          if (src & REGISTER) {
    1.14              index = operand_index(src);
    1.15              value = get_reg_value(size, index, 0, regs);
    1.16 -            diff = (unsigned long) p->data & value;
    1.17 +            result = (unsigned long) p->data & value;
    1.18          } else if (src & IMMEDIATE) {
    1.19              value = mmio_opp->immediate;
    1.20 -            diff = (unsigned long) p->data & value;
    1.21 +            result = (unsigned long) p->data & value;
    1.22          } else if (src & MEMORY) {
    1.23              index = operand_index(dst);
    1.24              value = get_reg_value(size, index, 0, regs);
    1.25 -            diff = (unsigned long) p->data & value;
    1.26 -            set_reg_value(size, index, 0, regs, diff);
    1.27 +            result = (unsigned long) p->data & value;
    1.28 +            set_reg_value(size, index, 0, regs, result);
    1.29          }
    1.30  
    1.31          /*
    1.32 @@ -622,24 +622,24 @@ static void hvm_mmio_assist(struct cpu_u
    1.33           */
    1.34          regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
    1.35                            X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
    1.36 -        set_eflags_ZF(size, diff, regs);
    1.37 -        set_eflags_SF(size, diff, regs);
    1.38 -        set_eflags_PF(size, diff, regs);
    1.39 +        set_eflags_ZF(size, result, regs);
    1.40 +        set_eflags_SF(size, result, regs);
    1.41 +        set_eflags_PF(size, result, regs);
    1.42          break;
    1.43  
    1.44      case INSTR_ADD:
    1.45          if (src & REGISTER) {
    1.46              index = operand_index(src);
    1.47              value = get_reg_value(size, index, 0, regs);
    1.48 -            diff = (unsigned long) p->data + value;
    1.49 +            result = (unsigned long) p->data + value;
    1.50          } else if (src & IMMEDIATE) {
    1.51              value = mmio_opp->immediate;
    1.52 -            diff = (unsigned long) p->data + value;
    1.53 +            result = (unsigned long) p->data + value;
    1.54          } else if (src & MEMORY) {
    1.55              index = operand_index(dst);
    1.56              value = get_reg_value(size, index, 0, regs);
    1.57 -            diff = (unsigned long) p->data + value;
    1.58 -            set_reg_value(size, index, 0, regs, diff);
    1.59 +            result = (unsigned long) p->data + value;
    1.60 +            set_reg_value(size, index, 0, regs, result);
    1.61          }
    1.62  
    1.63          /*
    1.64 @@ -648,29 +648,29 @@ static void hvm_mmio_assist(struct cpu_u
    1.65           */
    1.66          regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|X86_EFLAGS_AF|
    1.67                            X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
    1.68 -        set_eflags_CF(size, mmio_opp->instr, diff, value,
    1.69 +        set_eflags_CF(size, mmio_opp->instr, result, value,
    1.70                        (unsigned long) p->data, regs);
    1.71 -        set_eflags_OF(size, mmio_opp->instr, diff, value,
    1.72 +        set_eflags_OF(size, mmio_opp->instr, result, value,
    1.73                        (unsigned long) p->data, regs);
    1.74 -        set_eflags_AF(size, diff, value, (unsigned long) p->data, regs);
    1.75 -        set_eflags_ZF(size, diff, regs);
    1.76 -        set_eflags_SF(size, diff, regs);
    1.77 -        set_eflags_PF(size, diff, regs);
    1.78 +        set_eflags_AF(size, result, value, (unsigned long) p->data, regs);
    1.79 +        set_eflags_ZF(size, result, regs);
    1.80 +        set_eflags_SF(size, result, regs);
    1.81 +        set_eflags_PF(size, result, regs);
    1.82          break;
    1.83  
    1.84      case INSTR_OR:
    1.85          if (src & REGISTER) {
    1.86              index = operand_index(src);
    1.87              value = get_reg_value(size, index, 0, regs);
    1.88 -            diff = (unsigned long) p->data | value;
    1.89 +            result = (unsigned long) p->data | value;
    1.90          } else if (src & IMMEDIATE) {
    1.91              value = mmio_opp->immediate;
    1.92 -            diff = (unsigned long) p->data | value;
    1.93 +            result = (unsigned long) p->data | value;
    1.94          } else if (src & MEMORY) {
    1.95              index = operand_index(dst);
    1.96              value = get_reg_value(size, index, 0, regs);
    1.97 -            diff = (unsigned long) p->data | value;
    1.98 -            set_reg_value(size, index, 0, regs, diff);
    1.99 +            result = (unsigned long) p->data | value;
   1.100 +            set_reg_value(size, index, 0, regs, result);
   1.101          }
   1.102  
   1.103          /*
   1.104 @@ -680,24 +680,24 @@ static void hvm_mmio_assist(struct cpu_u
   1.105           */
   1.106          regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
   1.107                            X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
   1.108 -        set_eflags_ZF(size, diff, regs);
   1.109 -        set_eflags_SF(size, diff, regs);
   1.110 -        set_eflags_PF(size, diff, regs);
   1.111 +        set_eflags_ZF(size, result, regs);
   1.112 +        set_eflags_SF(size, result, regs);
   1.113 +        set_eflags_PF(size, result, regs);
   1.114          break;
   1.115  
   1.116      case INSTR_XOR:
   1.117          if (src & REGISTER) {
   1.118              index = operand_index(src);
   1.119              value = get_reg_value(size, index, 0, regs);
   1.120 -            diff = (unsigned long) p->data ^ value;
   1.121 +            result = (unsigned long) p->data ^ value;
   1.122          } else if (src & IMMEDIATE) {
   1.123              value = mmio_opp->immediate;
   1.124 -            diff = (unsigned long) p->data ^ value;
   1.125 +            result = (unsigned long) p->data ^ value;
   1.126          } else if (src & MEMORY) {
   1.127              index = operand_index(dst);
   1.128              value = get_reg_value(size, index, 0, regs);
   1.129 -            diff = (unsigned long) p->data ^ value;
   1.130 -            set_reg_value(size, index, 0, regs, diff);
   1.131 +            result = (unsigned long) p->data ^ value;
   1.132 +            set_reg_value(size, index, 0, regs, result);
   1.133          }
   1.134  
   1.135          /*
   1.136 @@ -707,9 +707,9 @@ static void hvm_mmio_assist(struct cpu_u
   1.137           */
   1.138          regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
   1.139                            X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
   1.140 -        set_eflags_ZF(size, diff, regs);
   1.141 -        set_eflags_SF(size, diff, regs);
   1.142 -        set_eflags_PF(size, diff, regs);
   1.143 +        set_eflags_ZF(size, result, regs);
   1.144 +        set_eflags_SF(size, result, regs);
   1.145 +        set_eflags_PF(size, result, regs);
   1.146          break;
   1.147  
   1.148      case INSTR_CMP:
   1.149 @@ -717,16 +717,16 @@ static void hvm_mmio_assist(struct cpu_u
   1.150          if (src & REGISTER) {
   1.151              index = operand_index(src);
   1.152              value = get_reg_value(size, index, 0, regs);
   1.153 -            diff = (unsigned long) p->data - value;
   1.154 +            result = (unsigned long) p->data - value;
   1.155          } else if (src & IMMEDIATE) {
   1.156              value = mmio_opp->immediate;
   1.157 -            diff = (unsigned long) p->data - value;
   1.158 +            result = (unsigned long) p->data - value;
   1.159          } else if (src & MEMORY) {
   1.160              index = operand_index(dst);
   1.161              value = get_reg_value(size, index, 0, regs);
   1.162 -            diff = value - (unsigned long) p->data;
   1.163 +            result = value - (unsigned long) p->data;
   1.164              if ( mmio_opp->instr == INSTR_SUB )
   1.165 -                set_reg_value(size, index, 0, regs, diff);
   1.166 +                set_reg_value(size, index, 0, regs, result);
   1.167          }
   1.168  
   1.169          /*
   1.170 @@ -737,22 +737,22 @@ static void hvm_mmio_assist(struct cpu_u
   1.171                            X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
   1.172          if ( src & (REGISTER | IMMEDIATE) )
   1.173          {
   1.174 -            set_eflags_CF(size, mmio_opp->instr, diff, value,
   1.175 +            set_eflags_CF(size, mmio_opp->instr, result, value,
   1.176                            (unsigned long) p->data, regs);
   1.177 -            set_eflags_OF(size, mmio_opp->instr, diff, value,
   1.178 +            set_eflags_OF(size, mmio_opp->instr, result, value,
   1.179                            (unsigned long) p->data, regs);
   1.180          }
   1.181          else
   1.182          {
   1.183 -            set_eflags_CF(size, mmio_opp->instr, diff,
   1.184 +            set_eflags_CF(size, mmio_opp->instr, result,
   1.185                            (unsigned long) p->data, value, regs);
   1.186 -            set_eflags_OF(size, mmio_opp->instr, diff,
   1.187 +            set_eflags_OF(size, mmio_opp->instr, result,
   1.188                            (unsigned long) p->data, value, regs);
   1.189          }
   1.190 -        set_eflags_AF(size, diff, value, (unsigned long) p->data, regs);
   1.191 -        set_eflags_ZF(size, diff, regs);
   1.192 -        set_eflags_SF(size, diff, regs);
   1.193 -        set_eflags_PF(size, diff, regs);
   1.194 +        set_eflags_AF(size, result, value, (unsigned long) p->data, regs);
   1.195 +        set_eflags_ZF(size, result, regs);
   1.196 +        set_eflags_SF(size, result, regs);
   1.197 +        set_eflags_PF(size, result, regs);
   1.198          break;
   1.199  
   1.200      case INSTR_TEST:
   1.201 @@ -765,16 +765,16 @@ static void hvm_mmio_assist(struct cpu_u
   1.202              index = operand_index(dst);
   1.203              value = get_reg_value(size, index, 0, regs);
   1.204          }
   1.205 -        diff = (unsigned long) p->data & value;
   1.206 +        result = (unsigned long) p->data & value;
   1.207  
   1.208          /*
   1.209           * Sets the SF, ZF, and PF status flags. CF and OF are set to 0
   1.210           */
   1.211          regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
   1.212                            X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
   1.213 -        set_eflags_ZF(size, diff, regs);
   1.214 -        set_eflags_SF(size, diff, regs);
   1.215 -        set_eflags_PF(size, diff, regs);
   1.216 +        set_eflags_ZF(size, result, regs);
   1.217 +        set_eflags_SF(size, result, regs);
   1.218 +        set_eflags_PF(size, result, regs);
   1.219          break;
   1.220  
   1.221      case INSTR_BT: