/[qemu]/qemu/op-i386.c
ViewVC logotype

Diff of /qemu/op-i386.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.27 by bellard, Sat May 10 15:10:02 2003 UTC revision 1.28 by bellard, Sat May 10 21:35:30 2003 UTC
# Line 634  void OPPROTO op_into(void) Line 634  void OPPROTO op_into(void)
634      int eflags;      int eflags;
635      eflags = cc_table[CC_OP].compute_all();      eflags = cc_table[CC_OP].compute_all();
636      if (eflags & CC_O) {      if (eflags & CC_O) {
637            EIP = PARAM1;
638          raise_exception(EXCP04_INTO);          raise_exception(EXCP04_INTO);
639      }      }
640      FORCE_RET();      FORCE_RET();
# Line 1136  void OPPROTO op_addl_A0_seg(void) Line 1137  void OPPROTO op_addl_A0_seg(void)
1137      A0 += *(unsigned long *)((char *)env + PARAM1);      A0 += *(unsigned long *)((char *)env + PARAM1);
1138  }  }
1139    
1140    void helper_lsl(void)
1141    {
1142        unsigned int selector, limit;
1143        SegmentDescriptorTable *dt;
1144        int index;
1145        uint32_t e1, e2;
1146        uint8_t *ptr;
1147    
1148        CC_SRC = cc_table[CC_OP].compute_all() & ~CC_Z;
1149        selector = T0 & 0xffff;
1150        if (selector & 0x4)
1151            dt = &env->ldt;
1152        else
1153            dt = &env->gdt;
1154        index = selector & ~7;
1155        if ((index + 7) > dt->limit)
1156            return;
1157        ptr = dt->base + index;
1158        e1 = ldl(ptr);
1159        e2 = ldl(ptr + 4);
1160        limit = (e1 & 0xffff) | (e2 & 0x000f0000);
1161        if (e2 & (1 << 23))
1162            limit = (limit << 12) | 0xfff;
1163        T1 = limit;
1164        CC_SRC |= CC_Z;
1165    }
1166    
1167    void OPPROTO op_lsl(void)
1168    {
1169        helper_lsl();
1170    }
1171    
1172    void helper_lar(void)
1173    {
1174        unsigned int selector;
1175        SegmentDescriptorTable *dt;
1176        int index;
1177        uint32_t e2;
1178        uint8_t *ptr;
1179    
1180        CC_SRC = cc_table[CC_OP].compute_all() & ~CC_Z;
1181        selector = T0 & 0xffff;
1182        if (selector & 0x4)
1183            dt = &env->ldt;
1184        else
1185            dt = &env->gdt;
1186        index = selector & ~7;
1187        if ((index + 7) > dt->limit)
1188            return;
1189        ptr = dt->base + index;
1190        e2 = ldl(ptr + 4);
1191        T1 = e2 & 0x00f0ff00;
1192        CC_SRC |= CC_Z;
1193    }
1194    
1195    void OPPROTO op_lar(void)
1196    {
1197        helper_lar();
1198    }
1199    
1200  /* flags handling */  /* flags handling */
1201    
1202  /* slow jumps cases (compute x86 flags) */  /* slow jumps cases (compute x86 flags) */
# Line 1490  CCTable cc_table[CC_OP_NB] = { Line 1551  CCTable cc_table[CC_OP_NB] = {
1551      [CC_OP_DECW] = { compute_all_decw, compute_c_incl },      [CC_OP_DECW] = { compute_all_decw, compute_c_incl },
1552      [CC_OP_DECL] = { compute_all_decl, compute_c_incl },      [CC_OP_DECL] = { compute_all_decl, compute_c_incl },
1553            
1554      [CC_OP_SHLB] = { compute_all_shlb, compute_c_shll },      [CC_OP_SHLB] = { compute_all_shlb, compute_c_shlb },
1555      [CC_OP_SHLW] = { compute_all_shlw, compute_c_shll },      [CC_OP_SHLW] = { compute_all_shlw, compute_c_shlw },
1556      [CC_OP_SHLL] = { compute_all_shll, compute_c_shll },      [CC_OP_SHLL] = { compute_all_shll, compute_c_shll },
1557    
1558      [CC_OP_SARB] = { compute_all_sarb, compute_c_shll },      [CC_OP_SARB] = { compute_all_sarb, compute_c_sarl },
1559      [CC_OP_SARW] = { compute_all_sarw, compute_c_shll },      [CC_OP_SARW] = { compute_all_sarw, compute_c_sarl },
1560      [CC_OP_SARL] = { compute_all_sarl, compute_c_shll },      [CC_OP_SARL] = { compute_all_sarl, compute_c_sarl },
1561  };  };
1562    
1563  /* floating point support. Some of the code for complicated x87  /* floating point support. Some of the code for complicated x87

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26