VirtualBox

Changeset 9760 in vbox


Ignore:
Timestamp:
Jun 17, 2008 12:09:03 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
32117
Message:

64 bits disassembly (CPUM this time).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/CPUM.cpp

    r9661 r9760  
    17991799    /** Whether the PageMapLock is valid or not. */
    18001800    bool            fLocked;
     1801    /** 64 bits mode or not. */
     1802    bool            f64Bits;
    18011803} CPUMDISASSTATE, *PCPUMDISASSTATE;
    18021804
     
    18521854
    18531855        /* check the segemnt limit */
    1854         if (PtrSrc > pState->cbSegLimit)
     1856        if (!pState->f64Bits && PtrSrc > pState->cbSegLimit)
    18551857            return VERR_OUT_OF_SELECTOR_BOUNDS;
    18561858
    18571859        /* calc how much we can read */
    18581860        uint32_t cb = PAGE_SIZE - (GCPtr & PAGE_OFFSET_MASK);
    1859         RTGCUINTPTR cbSeg = pState->GCPtrSegEnd - GCPtr;
    1860         if (cb > cbSeg && !cbSeg)
    1861             cb = cbSeg;
     1861        if (!pState->f64Bits)
     1862        {
     1863            RTGCUINTPTR cbSeg = pState->GCPtrSegEnd - GCPtr;
     1864            if (cb > cbSeg && cbSeg)
     1865                cb = cbSeg;
     1866        }
    18621867        if (cb > cbRead)
    18631868            cb = cbRead;
     
    18901895    int             rc;
    18911896
     1897    const PGMMODE enmMode = PGMGetGuestMode(pVM);
    18921898    State.pCpu            = pCpu;
    18931899    State.pvPageGC        = 0;
     
    18951901    State.pVM             = pVM;
    18961902    State.fLocked         = false;
     1903    State.f64Bits         = false;
    18971904
    18981905    /*
     
    19041911        if (CPUMAreHiddenSelRegsValid(pVM))
    19051912        {
     1913            State.f64Bits         = enmMode >= PGMMODE_AMD64 && pCtx->csHid.Attr.n.u1Long;
    19061914            State.GCPtrSegBase    = pCtx->csHid.u64Base;
    19071915            State.GCPtrSegEnd     = pCtx->csHid.u32Limit + 1 + (RTGCUINTPTR)pCtx->csHid.u64Base;
    19081916            State.cbSegLimit      = pCtx->csHid.u32Limit;
    1909             pCpu->mode            = pCtx->csHid.Attr.n.u1DefBig ? CPUMODE_32BIT : CPUMODE_16BIT;
     1917            pCpu->mode            = (State.f64Bits)
     1918                                    ? CPUMODE_64BIT
     1919                                    : pCtx->csHid.Attr.n.u1DefBig
     1920                                    ? CPUMODE_32BIT
     1921                                    : CPUMODE_16BIT;
    19101922        }
    19111923        else
Note: See TracChangeset for help on using the changeset viewer.

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