VirtualBox

Changeset 2119 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Apr 17, 2007 8:37:41 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
20439
Message:

Finished hidden selector case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/SELMAll.cpp

    r2117 r2119  
    145145
    146146
    147     VBOXDESC    Desc;
    148147    uint32_t    u32Limit;
    149148    RTGCPTR     pvFlat;
     149    uint32_t    u1Present, u1DescType, u1Granularity, u4Type;
    150150
    151151    if (    pHiddenSel
    152152        &&  CPUMAreHiddenSelRegsValid(pVM))
    153153    {
    154         Desc.Gen.u1Present = pHiddenSel->Attr.n.u1Present;
     154        u1Present     = pHiddenSel->Attr.n.u1Present;
     155        u1Granularity = pHiddenSel->Attr.n.u1Granularity;
     156        u1DescType    = pHiddenSel->Attr.n.u1DescType;
     157        u4Type        = pHiddenSel->Attr.n.u4Type;
    155158    }
    156159    else
    157160    {
     161        VBOXDESC Desc;
     162
    158163        if (!(Sel & X86_SEL_LDT))
    159164        {
     
    188193                              |   Desc.Gen.u16BaseLow )
    189194                             );
     195
     196        u1Present     = Desc.Gen.u1Present;
     197        u1Granularity = Desc.Gen.u1Granularity;
     198        u1DescType    = Desc.Gen.u1DescType;
     199        u4Type        = Desc.Gen.u4Type;
    190200    }
    191201
     
    193203     * Check if present.
    194204     */
    195     if (Desc.Gen.u1Present)
     205    if (u1Present)
    196206    {
    197207        /*
     
    199209         */
    200210        #define BOTH(a, b) ((a << 16) | b)
    201         switch (BOTH(Desc.Gen.u1DescType, Desc.Gen.u4Type))
     211        switch (BOTH(u1DescType, u4Type))
    202212        {
    203213
     
    252262                }
    253263                /* check limit. */
    254                 if (!Desc.Gen.u1Granularity && (RTGCUINTPTR)Addr > (RTGCUINTPTR)0xffff)
     264                if (!u1Granularity && (RTGCUINTPTR)Addr > (RTGCUINTPTR)0xffff)
    255265                    return VERR_OUT_OF_SELECTOR_BOUNDS;
    256266                if ((RTGCUINTPTR)Addr <= u32Limit)
     
    261271                    *ppvGC = pvFlat;
    262272                if (pcb)
    263                     *pcb = (Desc.Gen.u1Granularity ? 0xffffffff : 0xffff) - (RTGCUINTPTR)Addr + 1;
     273                    *pcb = (u1Granularity ? 0xffffffff : 0xffff) - (RTGCUINTPTR)Addr + 1;
    264274                return VINF_SUCCESS;
    265275
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