Changeset 13999 in vbox for trunk/src/recompiler_new
- Timestamp:
- Nov 10, 2008 12:09:18 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler_new/target-i386/translate.c
r13968 r13999 631 631 #endif 632 632 } 633 #ifdef VBOX 634 DECLINLINE(void) gen_op_seg_check(int reg, bool keepA0) 635 { 636 /* It seems segments doesn't get out of sync - if they do in fact - enable below code. */ 637 #if 0 638 /* Our segments could be outdated, thus check for newselector field to see if update really needed */ 639 int skip_label; 640 TCGv t0, a0; 641 642 /* For other segments this check is waste of time, and also TCG is unable to cope with this code, 643 for data segments, as expects alive temps */ 644 if (reg != R_GS) 645 return; 646 647 if (keepA0) 648 { 649 /* we need to store old cpu_A0 */ 650 a0 = tcg_temp_local_new(TCG_TYPE_TL); 651 tcg_gen_mov_tl(a0, cpu_A0); 652 } 653 654 skip_label = gen_new_label(); 655 t0 = tcg_temp_local_new(TCG_TYPE_TL); 656 657 tcg_gen_ld32u_tl(t0, cpu_env, offsetof(CPUState, segs[reg].newselector) + REG_L_OFFSET); 658 tcg_gen_brcondi_i32(TCG_COND_EQ, t0, 0, skip_label); 659 tcg_gen_ld32u_tl(t0, cpu_env, offsetof(CPUState, eflags) + REG_L_OFFSET); 660 tcg_gen_andi_tl(t0, t0, VM_MASK); 661 tcg_gen_brcondi_i32(TCG_COND_NE, t0, 0, skip_label); 662 tcg_gen_movi_tl(t0, reg); 663 664 tcg_gen_helper_0_1(helper_sync_seg, t0); 665 666 tcg_temp_free(t0); 667 668 gen_set_label(skip_label); 669 if (keepA0) 670 { 671 tcg_gen_mov_tl(cpu_A0, a0); 672 tcg_temp_free(a0); 673 } 674 #endif /* 0 */ 675 } 676 #endif 633 677 634 678 #ifndef VBOX … … 638 682 #endif /* VBOX */ 639 683 { 684 #ifdef VBOX 685 gen_op_seg_check(reg, false); 686 #endif 640 687 tcg_gen_ld32u_tl(cpu_A0, cpu_env, offsetof(CPUState, segs[reg].base) + REG_L_OFFSET); 641 688 } … … 647 694 #endif /* VBOX */ 648 695 { 696 #ifdef VBOX 697 gen_op_seg_check(reg, true); 698 #endif 649 699 tcg_gen_ld_tl(cpu_tmp0, cpu_env, offsetof(CPUState, segs[reg].base)); 650 700 tcg_gen_add_tl(cpu_A0, cpu_A0, cpu_tmp0); … … 661 711 #endif /* VBOX */ 662 712 { 713 #ifdef VBOX 714 gen_op_seg_check(reg, false); 715 #endif 663 716 tcg_gen_ld_tl(cpu_A0, cpu_env, offsetof(CPUState, segs[reg].base)); 664 717 } … … 670 723 #endif /* VBOX */ 671 724 { 725 #ifdef VBOX 726 gen_op_seg_check(reg, true); 727 #endif 672 728 tcg_gen_ld_tl(cpu_tmp0, cpu_env, offsetof(CPUState, segs[reg].base)); 673 729 tcg_gen_add_tl(cpu_A0, cpu_A0, cpu_tmp0); … … 7853 7909 if (!s->pe || s->vm86) 7854 7910 goto illegal_op; 7911 7855 7912 t0 = tcg_temp_local_new(TCG_TYPE_TL); 7856 7913 t1 = tcg_temp_local_new(TCG_TYPE_TL);
Note:
See TracChangeset
for help on using the changeset viewer.