Changeset 42407 in vbox for trunk/src/recompiler/target-i386
- Timestamp:
- Jul 26, 2012 11:41:35 AM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 79503
- Location:
- trunk/src/recompiler/target-i386
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler/target-i386/cpu.h
r38319 r42407 65 65 # include <VBox/vmm/vmm.h> 66 66 # include <VBox/vmm/stam.h> 67 # include <VBox/vmm/cpumctx.h> 67 68 #endif /* VBOX */ 68 69 … … 532 533 typedef struct SegmentCache { 533 534 uint32_t selector; 535 #ifdef VBOX 536 /** The new selector is saved here when we are unable to sync it before invoking the recompiled code. */ 537 uint16_t newselector; 538 uint16_t fVBoxFlags; 539 #endif 534 540 target_ulong base; 535 541 uint32_t limit; 536 542 uint32_t flags; 537 #ifdef VBOX538 /** The new selector is saved here when we are unable to sync it before invoking the recompiled code. */539 uint32_t newselector;540 #endif541 543 } SegmentCache; 542 544 … … 942 944 sc->base = base; 943 945 sc->limit = limit; 946 #ifndef VBOX 944 947 sc->flags = flags; 945 #ifdef VBOX 948 #else 949 if (flags & DESC_P_MASK) 950 flags |= DESC_A_MASK; /* Make sure the A bit is set to avoid trouble. */ 951 sc->flags = flags; 946 952 sc->newselector = 0; 953 sc->fVBoxFlags = CPUMSELREG_FLAGS_VALID; 947 954 #endif 948 955 -
trunk/src/recompiler/target-i386/op_helper.c
r39969 r42407 254 254 sc->limit = get_seg_limit(e1, e2); 255 255 sc->flags = e2; 256 #ifdef VBOX 257 sc->newselector = 0; 258 sc->fVBoxFlags = CPUMSELREG_FLAGS_VALID; 259 #endif 256 260 } 257 261 … … 557 561 env->tr.limit = tss_limit; 558 562 env->tr.flags = e2 & ~DESC_TSS_BUSY_MASK; 563 #ifdef VBOX 564 env->tr.fVBoxFlags = CPUMSELREG_FLAGS_VALID; 565 env->tr.newselector = 0; 566 #endif 559 567 560 568 if ((type & 8) && (env->cr[0] & CR0_PG_MASK)) { … … 596 604 env->ldt.limit = 0; 597 605 env->ldt.flags = 0; 606 #ifdef VBOX 607 env->ldt.fVBoxFlags = CPUMSELREG_FLAGS_VALID; 608 env->ldt.newselector = 0; 609 #endif 598 610 599 611 /* load the LDT */ … … 1954 1966 env->ldt.limit = ldl_phys(sm_state + 0x7e74); 1955 1967 env->ldt.flags = (lduw_phys(sm_state + 0x7e72) & 0xf0ff) << 8; 1968 #ifdef VBOX 1969 env->ldt.fVBoxFlags = CPUMSELREG_FLAGS_VALID; 1970 env->ldt.newselector = 0; 1971 #endif 1956 1972 1957 1973 env->idt.base = ldq_phys(sm_state + 0x7e88); … … 1962 1978 env->tr.limit = ldl_phys(sm_state + 0x7e94); 1963 1979 env->tr.flags = (lduw_phys(sm_state + 0x7e92) & 0xf0ff) << 8; 1980 #ifdef VBOX 1981 env->tr.fVBoxFlags = CPUMSELREG_FLAGS_VALID; 1982 env->tr.newselector = 0; 1983 #endif 1964 1984 1965 1985 EAX = ldq_phys(sm_state + 0x7ff8); … … 2008 2028 env->tr.limit = ldl_phys(sm_state + 0x7f60); 2009 2029 env->tr.flags = (ldl_phys(sm_state + 0x7f5c) & 0xf0ff) << 8; 2030 #ifdef VBOX 2031 env->tr.fVBoxFlags = CPUMSELREG_FLAGS_VALID; 2032 env->tr.newselector = 0; 2033 #endif 2010 2034 2011 2035 env->ldt.selector = ldl_phys(sm_state + 0x7fc0) & 0xffff; … … 2013 2037 env->ldt.limit = ldl_phys(sm_state + 0x7f7c); 2014 2038 env->ldt.flags = (ldl_phys(sm_state + 0x7f78) & 0xf0ff) << 8; 2039 #ifdef VBOX 2040 env->ldt.fVBoxFlags = CPUMSELREG_FLAGS_VALID; 2041 env->ldt.newselector = 0; 2042 #endif 2015 2043 2016 2044 env->gdt.base = ldl_phys(sm_state + 0x7f74); … … 2448 2476 env->ldt.base = 0; 2449 2477 env->ldt.limit = 0; 2478 #ifdef VBOX 2479 env->ldt.fVBoxFlags = CPUMSELREG_FLAGS_VALID; 2480 env->ldt.newselector = 0; 2481 #endif 2450 2482 } else { 2451 2483 if (selector & 0x4) … … 2510 2542 env->tr.limit = 0; 2511 2543 env->tr.flags = 0; 2544 #ifdef VBOX 2545 env->tr.fVBoxFlags = CPUMSELREG_FLAGS_VALID; 2546 env->tr.newselector = 0; 2547 #endif 2512 2548 } else { 2513 2549 if (selector & 0x4) … … 5724 5760 5725 5761 /* Successful sync. */ 5726 env1->segs[seg_reg].newselector = 0;5762 Assert(env1->segs[seg_reg].newselector == 0); 5727 5763 } 5728 5764 else … … 5741 5777 load_segment(&e1, &e2, selector); 5742 5778 cpu_x86_load_seg_cache(env, R_CS, selector, 5743 get_seg_base(e1, e2),5744 get_seg_limit(e1, e2),5745 e2);5779 get_seg_base(e1, e2), 5780 get_seg_limit(e1, e2), 5781 e2); 5746 5782 } 5747 5783 else … … 5753 5789 5754 5790 /* Successful sync. */ 5755 env1->segs[seg_reg].newselector = 0;5791 Assert(env1->segs[seg_reg].newselector == 0); 5756 5792 } 5757 5793 else
Note:
See TracChangeset
for help on using the changeset viewer.