VirtualBox

Changeset 332 in vbox for trunk


Ignore:
Timestamp:
Jan 25, 2007 8:49:05 PM (18 years ago)
Author:
vboxsync
Message:

introduced PDMDevHlpGetVM()

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/pdm.h

    r255 r332  
    56895689
    56905690/**
     5691 * @copydoc PDMDEVHLP::pfnGetVM
     5692 */
     5693DECLINLINE(PVM) PDMDevHlpGetVM(PPDMDEVINS pDevIns)
     5694{
     5695    return pDevIns->pDevHlp->pfnGetVM(pDevIns);
     5696}
     5697
     5698/**
    56915699 * @copydoc PDMDEVHLP::pfnPhysReadGCVirt
    56925700 */
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r317 r332  
    4040
    4141#undef LOG_VOICES
     42//#define USE_MIXER
    4243
    4344#define AC97_SSM_VERSION 1
     
    580581#ifdef USE_MIXER
    581582    record_select (s, 0);
    582     set_volume (s, AC97_Master_Volume_Mute, AUD_MIXER_VOLUME  , 0x8000);
    583     set_volume (s, AC97_PCM_Out_Volume_Mute, AUD_MIXER_PCM    , 0x8808);
     583    set_volume (s, AC97_Master_Volume_Mute,  AUD_MIXER_VOLUME, 0x8000);
     584    set_volume (s, AC97_PCM_Out_Volume_Mute, AUD_MIXER_PCM,    0x8808);
    584585    set_volume (s, AC97_Line_In_Volume_Mute, AUD_MIXER_LINE_IN, 0x8808);
    585586#else
     
    14731474    record_select (s, mixer_load (s, AC97_Record_Select));
    14741475#define V_(a, b) set_volume (s, a, b, mixer_load (s, a))
    1475     V_ (AC97_Master_Volume_Mute, AUD_MIXER_VOLUME);
     1476    V_ (AC97_Master_Volume_Mute,  AUD_MIXER_VOLUME);
    14761477    V_ (AC97_PCM_Out_Volume_Mute, AUD_MIXER_PCM);
    14771478    V_ (AC97_Line_In_Volume_Mute, AUD_MIXER_LINE_IN);
     
    16671668    /** @todo r=bird: add a devhlp for this of course! */
    16681669    if (!pData->ac97.voice_pi || !pData->ac97.voice_po || !pData->ac97.voice_mc)
    1669         VMSetRuntimeError(pDevIns->pDevHlp->pfnGetVM(pDevIns), false,
     1670        VMSetRuntimeError(PDMDevHlpGetVM(pDevIns), false,
    16701671                          N_("Some audio devices could not be opened. Guest applications "
    16711672                             "generating audio output or depending on audio input may hang. "
  • trunk/src/VBox/Devices/Bus/DevPCI.cpp

    r1 r332  
    13121312    PPCIGLOBALS pGlobals = DEVINS2PCIGLOBALS(pDevIns);
    13131313    PPCIBUS     pBus = PDMINS2DATA(pDevIns, PPCIBUS);
    1314     PVM         pVM = pDevIns->pDevHlp->pfnGetVM(pDevIns);
     1314    PVM         pVM = PDMDevHlpGetVM(pDevIns);
    13151315    Assert(pVM);
    13161316
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r1 r332  
    36343634    {
    36353635        PPDMDEVINS pDevIns = pData->pDevInsHC;
    3636         PGMHandlerPhysicalReset(pDevIns->pDevHlp->pfnGetVM(pDevIns), pData->GCPhysVRAM);
     3636        PGMHandlerPhysicalReset(PDMDevHlpGetVM(pDevIns), pData->GCPhysVRAM);
    36373637        pData->fHaveDirtyBits = false;
    36383638    }
     
    40384038    Assert(pDevIns);
    40394039
    4040     pVM = pDevIns->pDevHlp->pfnGetVM(pDevIns);
     4040    pVM = PDMDevHlpGetVM(pDevIns);
    40414041    Assert(pVM);
    40424042
     
    41344134         * already registered before trying to do that all over again.
    41354135         */
    4136         PVM pVM = pPciDev->pDevIns->pDevHlp->pfnGetVM(pPciDev->pDevIns);
     4136        PVM pVM = PDMDevHlpGetVM(pPciDev->pDevIns);
    41374137        if (pData->GCPhysVRAM)
    41384138        {
     
    43534353        &&  pData->GCPhysVRAM)
    43544354    {
    4355         int rc = PGMHandlerPhysicalReset(pDevIns->pDevHlp->pfnGetVM(pDevIns), pData->GCPhysVRAM);
     4355        int rc = PGMHandlerPhysicalReset(PDMDevHlpGetVM(pDevIns), pData->GCPhysVRAM);
    43564356        AssertRC(rc);
    43574357    }
     
    45044504    unsigned i;
    45054505    PVGASTATE   pData = PDMINS2DATA(pDevIns, PVGASTATE);
    4506     PVM         pVM = pDevIns->pDevHlp->pfnGetVM(pDevIns);
     4506    PVM         pVM = PDMDevHlpGetVM(pDevIns);
    45074507#ifdef VBE_NEW_DYN_LIST
    45084508    uint32_t    cCustomModes;
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r306 r332  
    12001200#if 0
    12011201    if (pData->RDRAPhysOld != 0 && pData->GCRDRA != pData->RDRAPhysOld)
    1202         PGMHandlerPhysicalDeregister(pDevIns->pDevHlp->pfnGetVM(pDevIns),
     1202        PGMHandlerPhysicalDeregister(PDMDevHlpGetVM(pDevIns),
    12031203                                     pData->RDRAPhysOld & ~PAGE_OFFSET_MASK);
    12041204    if (   pData->TRDAPhysOld != 0 && pData->GCTDRA != pData->TRDAPhysOld
     
    12091209    {
    12101210        int rc;
    1211         rc = PGMR3HandlerPhysicalRegister(pDevIns->pDevHlp->pfnGetVM(pDevIns),
     1211        rc = PGMR3HandlerPhysicalRegister(PDMDevHlpGetVM(pDevIns),
    12121212                                          PGMPHYSHANDLERTYPE_PHYSICAL_WRITE,
    12131213                                          pData->GCRDRA & ~PAGE_OFFSET_MASK,
     
    12281228    {
    12291229        if (pData->TRDAPhysOld != 0)
    1230             PGMHandlerPhysicalDeregister(pDevIns->pDevHlp->pfnGetVM(pDevIns),
     1230            PGMHandlerPhysicalDeregister(PDMDevHlpVM(pDevIns),
    12311231                                         pData->TRDAPhysOld & ~PAGE_OFFSET_MASK);
    12321232
    12331233        int rc;
    12341234
    1235         rc = PGMR3HandlerPhysicalRegister(pDevIns->pDevHlp->pfnGetVM(pDevIns),
     1235        rc = PGMR3HandlerPhysicalRegister(PDMDevHlpGetVM(pDevIns),
    12361236                                          PGMPHYSHANDLERTYPE_PHYSICAL_WRITE,
    12371237                                          pData->GCTDRA & ~PAGE_OFFSET_MASK,
     
    39423942
    39433943#ifdef PCNET_NO_POLLING
    3944     rc = PDMR3GetSymbolR0Lazy(pDevIns->pDevHlp->pfnGetVM(pDevIns), NULL, "EMInterpretInstruction", (void **)&pData->pfnEMInterpretInstructionR0);
     3944    rc = PDMR3GetSymbolR0Lazy(PDMDevHlpGetVM(pDevIns), NULL, "EMInterpretInstruction", (void **)&pData->pfnEMInterpretInstructionR0);
    39453945    if (VBOX_SUCCESS(rc))
    39463946    {
     
    39493949         */
    39503950        RTGCPTR pfnHandlerGC;
    3951         rc = PDMR3GetSymbolGCLazy(pDevIns->pDevHlp->pfnGetVM(pDevIns), NULL, "EMInterpretInstruction", (RTGCPTR *)&pData->pfnEMInterpretInstructionGC);
     3951        rc = PDMR3GetSymbolGCLazy(PDMDevHlpGetVM(pDevIns), NULL, "EMInterpretInstruction", (RTGCPTR *)&pData->pfnEMInterpretInstructionGC);
    39523952    }
    39533953    if (VBOX_FAILURE(rc))
  • trunk/src/VBox/Devices/PC/DevPcBios.cpp

    r155 r332  
    195195    AssertRC(rc);
    196196#else
    197     PVM pVM = pDevIns->pDevHlp->pfnGetVM(pDevIns);
     197    PVM pVM = PDMDevHlpGetVM(pDevIns);
    198198    IOMIOPortWrite(pVM, 0x70, off, 1);
    199199    IOMIOPortWrite(pVM, 0x71, u32Val, 1);
     
    276276    uint32_t        u32;
    277277    unsigned        i;
    278     PVM             pVM = pDevIns->pDevHlp->pfnGetVM(pDevIns);
     278    PVM             pVM = PDMDevHlpGetVM(pDevIns);
    279279    PPDMIBLOCKBIOS  apHDs[4] = {0};
    280280    PPDMIBLOCKBIOS  apFDs[2] = {0};
     
    533533            {
    534534#if 0
    535                 PVM pVM = pDevIns->pDevHlp->pfnGetVM(pDevIns);
     535                PVM pVM = PDMDevHlpGetVM(pDevIns);
    536536                AssertRelease(pVM);
    537537                VM_FF_SET(pVM, VM_FF_TERMINATE);
     
    659659     * Paranoia: Check that the BIOS ROM hasn't changed.
    660660     */
    661     PVM pVM = pDevIns->pDevHlp->pfnGetVM(pDevIns);
     661    PVM pVM = PDMDevHlpGetVM(pDevIns);
    662662    /* the low ROM mapping. */
    663663    unsigned cb = RT_MIN(g_cbPcBiosBinary, 128 * _1K);
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r307 r332  
    23912391                        PPDMDEVINS pDevIns = ATADEVSTATE_2_DEVINS(s);
    23922392                        PVMREQ pReq;
    2393                         rc = VMR3ReqCall(pDevIns->pDevHlp->pfnGetVM(pDevIns), &pReq, RT_INDEFINITE_WAIT,
     2393                        rc = VMR3ReqCall(PDMDevHlpGetVM(pDevIns), &pReq, RT_INDEFINITE_WAIT,
    23942394                                         (PFNRT)s->pDrvMount->pfnUnmount, 1, s->pDrvMount);
    23952395                        AssertReleaseRC(rc);
     
    45804580            MMGCRamWriteNoTrapHandler((char *)GCDst + i, s->CTXSUFF(pbIOBuffer) + s->iIOBufferPIODataStart + i, cb);
    45814581#else /* !IN_GC */
    4582         rc = PGMPhysWriteGCPtrDirty(pDevIns->pDevHlp->pfnGetVM(pDevIns), GCDst, s->CTXSUFF(pbIOBuffer) + s->iIOBufferPIODataStart, cbTransfer);
     4582        rc = PGMPhysWriteGCPtrDirty(PDMDevHlpGetVM(pDevIns), GCDst, s->CTXSUFF(pbIOBuffer) + s->iIOBufferPIODataStart, cbTransfer);
    45834583        Assert(rc == VINF_SUCCESS);
    45844584#endif /* IN_GC */
     
    46374637            MMGCRamReadNoTrapHandler(s->CTXSUFF(pbIOBuffer) + s->iIOBufferPIODataStart + i, (char *)GCSrc + i, cb);
    46384638#else /* !IN_GC */
    4639         rc = PGMPhysReadGCPtr(pDevIns->pDevHlp->pfnGetVM(pDevIns), s->CTXSUFF(pbIOBuffer) + s->iIOBufferPIODataStart, GCSrc, cbTransfer);
     4639        rc = PGMPhysReadGCPtr(PDMDevHlpGetVM(pDevIns), s->CTXSUFF(pbIOBuffer) + s->iIOBufferPIODataStart, GCSrc, cbTransfer);
    46404640        Assert(rc == VINF_SUCCESS);
    46414641#endif /* IN_GC */
     
    47284728     * can be either from ataPowerOff or ataSuspend), there is no other
    47294729     * reasonable solution. */
    4730     fVMLocked = VMMR3LockIsOwner(pDevIns->pDevHlp->pfnGetVM(pDevIns));
     4730    fVMLocked = VMMR3LockIsOwner(PDMDevHlpGetVM(pDevIns));
    47314731
    47324732    if (fVMLocked)
     
    47644764{
    47654765    if (s->pbIOBufferHC)
    4766         s->pbIOBufferGC = MMHyperHC2GC(pDevIns->pDevHlp->pfnGetVM(pDevIns), s->pbIOBufferHC);
     4766        s->pbIOBufferGC = MMHyperHC2GC(PDMDevHlpGetVM(pDevIns), s->pbIOBufferHC);
    47674767}
    47684768
     
    49434943     * Allocate I/O buffer.
    49444944     */
     4945    PVM pVM = PDMDevHlpGetVM(pDevIns);
    49454946    if (pIf->cbIOBuffer)
    49464947    {
     
    49524953            AssertRelease(pIf->cbIOBuffer == ATA_MAX_MULT_SECTORS * 512);
    49534954        Assert(pIf->pbIOBufferHC);
    4954         Assert(pIf->pbIOBufferGC == MMHyperHC2GC(pDevIns->pDevHlp->pfnGetVM(pDevIns), pIf->pbIOBufferHC));
     4955        Assert(pIf->pbIOBufferGC == MMHyperHC2GC(pVM, pIf->pbIOBufferHC));
    49554956    }
    49564957    else
     
    49614962            pIf->cbIOBuffer = ATA_MAX_MULT_SECTORS * 512;
    49624963        Assert(!pIf->pbIOBufferHC);
    4963         rc = MMHyperAlloc(pDevIns->pDevHlp->pfnGetVM(pDevIns), pIf->cbIOBuffer, 1, MM_TAG_PDM_DEVICE_USER, (void **)&pIf->pbIOBufferHC);
     4964        rc = MMHyperAlloc(pVM, pIf->cbIOBuffer, 1, MM_TAG_PDM_DEVICE_USER, (void **)&pIf->pbIOBufferHC);
    49644965        if (VBOX_FAILURE(rc))
    49654966            return VERR_NO_MEMORY;
    4966         pIf->pbIOBufferGC = MMHyperHC2GC(pDevIns->pDevHlp->pfnGetVM(pDevIns), pIf->pbIOBufferHC);
     4967        pIf->pbIOBufferGC = MMHyperHC2GC(pVM, pIf->pbIOBufferHC);
    49674968    }
    49684969
     
    54045405            pData->aCts[i].aIfs[j].pDevInsGC = PDMDEVINS_2_GCPTR(pDevIns);
    54055406            pData->aCts[i].aIfs[j].pControllerHC = &pData->aCts[i];
    5406             pData->aCts[i].aIfs[j].pControllerGC = MMHyperHC2GC(pDevIns->pDevHlp->pfnGetVM(pDevIns), &pData->aCts[i]);
     5407            pData->aCts[i].aIfs[j].pControllerGC = MMHyperHC2GC(PDMDevHlpGetVM(pDevIns), &pData->aCts[i]);
    54075408            pData->aCts[i].aIfs[j].IBase.pfnQueryInterface = ataQueryInterface;
    54085409            pData->aCts[i].aIfs[j].IMountNotify.pfnMountNotify = ataMountNotify;
  • trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp

    r211 r332  
    236236{
    237237    PPDMDEVINS pDevIns = VMMDEVSTATE_2_DEVINS(pVMMDevState);
    238     PVM pVM = pDevIns->pDevHlp->pfnGetVM(pDevIns);
     238    PVM pVM = PDMDevHlpGetVM(pDevIns);
    239239    int rc;
    240240    PVMREQ pReq;
     
    645645            {
    646646                VMMDevReqHypervisorInfo *hypervisorInfo = (VMMDevReqHypervisorInfo*)requestHeader;
    647                 PVM pVM = pDevIns->pDevHlp->pfnGetVM(pDevIns);
     647                PVM pVM = PDMDevHlpGetVM(pDevIns);
    648648                size_t hypervisorSize = 0;
    649649                requestHeader->rc = PGMR3MappingsSize(pVM, &hypervisorSize);
     
    667667            {
    668668                VMMDevReqHypervisorInfo *hypervisorInfo = (VMMDevReqHypervisorInfo*)requestHeader;
    669                 PVM pVM = pDevIns->pDevHlp->pfnGetVM(pDevIns);
     669                PVM pVM = PDMDevHlpGetVM(pDevIns);
    670670                if (hypervisorInfo->hypervisorStart == 0)
    671671                {
     
    11841184         * already registered before trying to do that all over again.
    11851185         */
    1186         PVM pVM = pPciDev->pDevIns->pDevHlp->pfnGetVM(pPciDev->pDevIns);
     1186        PVM pVM = PDMDevHlpGetVM(pPciDev->pDevIns);
    11871187
    11881188        if (pData->GCPhysVMMDevRAM)
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