VirtualBox

Ignore:
Timestamp:
Aug 13, 2013 7:34:18 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
87948
Message:

REM: Attempt at better selector attribute handling, to avoid further weird bits turning up.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/target-i386/cpu.h

    r47678 r47709  
    117117#define DESC_TSS_BUSY_MASK (1 << 9)
    118118#ifdef VBOX
    119 # define DESC_INTEL_UNUSABLE    RT_BIT_32(16+8) /**< Internal VT-x bit for NULL sectors. */
     119# define DESC_INTEL_UNUSABLE    RT_BIT_32(16+8)      /**< Internal VT-x bit for NULL sectors. */
     120# define DESC_RAW_FLAG_BITS     UINT32_C(0x00ffffff) /**< Flag bits we load from the descriptor. */
    120121#endif
    121122
     
    934935/* this function must always be used to load data in the segment
    935936   cache: it synchronizes the hflags with the segment cache values */
     937#ifndef VBOX
    936938static inline void cpu_x86_load_seg_cache(CPUX86State *env,
    937939                                          int seg_reg, unsigned int selector,
     
    939941                                          unsigned int limit,
    940942                                          unsigned int flags)
     943#else
     944static inline void cpu_x86_load_seg_cache_with_clean_flags(CPUX86State *env,
     945                                                           int seg_reg, unsigned int selector,
     946                                                           target_ulong base,
     947                                                           unsigned int limit,
     948                                                           unsigned int flags)
     949#endif
    941950{
    942951    SegmentCache *sc;
     
    947956    sc->base = base;
    948957    sc->limit = limit;
    949 #ifndef VBOX
    950958    sc->flags = flags;
    951 #else
    952     if (flags & DESC_P_MASK)
    953     {
    954         flags |= DESC_A_MASK;           /* Make sure the A bit is set to avoid trouble. */
    955         flags &= ~DESC_INTEL_UNUSABLE;
    956     }
    957     else if (selector < 4U)
    958         flags |= DESC_INTEL_UNUSABLE;
    959     else
    960         flags &= ~DESC_INTEL_UNUSABLE;
    961     sc->flags = flags;
     959#ifdef VBOX
    962960    sc->newselector = 0;
    963961    sc->fVBoxFlags  = CPUMSELREG_FLAGS_VALID;
     
    10061004}
    10071005
     1006#ifdef VBOX
     1007/* Raw input, adjust the flags adding the stupid intel flag when applicable. */
     1008static inline void cpu_x86_load_seg_cache(CPUX86State *env,
     1009                                          int seg_reg, unsigned int selector,
     1010                                          target_ulong base,
     1011                                          unsigned int limit,
     1012                                          unsigned int flags)
     1013{
     1014    flags &= DESC_RAW_FLAG_BITS;
     1015    if (flags & DESC_P_MASK)
     1016        flags |= DESC_A_MASK;           /* Make sure the A bit is set to avoid trouble. */
     1017    else if (selector < 4U)
     1018        flags |= DESC_INTEL_UNUSABLE;
     1019    cpu_x86_load_seg_cache_with_clean_flags(env, seg_reg, selector, base, limit, flags);
     1020}
     1021#endif
     1022
    10081023static inline void cpu_x86_load_seg_cache_sipi(CPUX86State *env,
    10091024                                               int sipi_vector)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette