VirtualBox

Changeset 93635 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Feb 7, 2022 10:43:45 AM (3 years ago)
Author:
vboxsync
Message:

VMM/PGM,VMM/PDM,VGA: Consolidate the user parameters of the physical access handlers into a single uint64_t value that shouldn't be a pointer, at least not for ring-0 callbacks. Special hack for devices where it's translated from a ring-0 device instance index into a current context PPDMDEVINS (not really tested yet). bugref:10094

Location:
trunk/src/VBox/Devices/Graphics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA-cmd.cpp

    r93115 r93635  
    358358 * @param   enmAccessType   The access type.
    359359 * @param   enmOrigin       Who is making the access.
    360  * @param   pvUser          User argument.
     360 * @param   pvUser          User argument - VMM sets this to the address of the
     361 *                          device instance.
    361362 */
    362363DECLCALLBACK(VBOXSTRICTRC)
    363364vmsvgaR3GboAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf,
    364                          PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser)
     365                         PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, uint64_t uUser)
    365366{
    366367    RT_NOREF(pVM, pVCpu, pvPhys, enmAccessType);
     
    369370        return VINF_PGM_HANDLER_DO_DEFAULT;
    370371
    371     PPDMDEVINS  pDevIns = (PPDMDEVINS)pvUser;
    372     PVGASTATE   pThis   = PDMDEVINS_2_DATA(pDevIns, PVGASTATE);
    373     PVGASTATECC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PVGASTATECC);
    374     PVMSVGAR3STATE pSvgaR3State = pThisCC->svga.pSvgaR3State;
     372    PPDMDEVINS      pDevIns = (PPDMDEVINS)uUser;
     373    AssertPtrReturn(pDevIns, VERR_INTERNAL_ERROR_4);
     374    AssertReturn(pDevIns->u32Version == PDM_DEVINSR3_VERSION, VERR_INTERNAL_ERROR_5);
     375    PVGASTATE       pThis   = PDMDEVINS_2_DATA(pDevIns, PVGASTATE);
     376    PVGASTATECC     pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PVGASTATECC);
     377    PVMSVGAR3STATE  pSvgaR3State = pThisCC->svga.pSvgaR3State;
    375378
    376379    /*
     
    415418}
    416419
    417 
    418420#ifdef VBOX_WITH_VMSVGA3D
     421
    419422static int vmsvgaR3GboCreate(PVMSVGAR3STATE pSvgaR3State, SVGAMobFormat ptDepth, PPN64 baseAddress, uint32_t sizeInBytes, bool fGCPhys64, bool fWriteProtected, PVMSVGAGBO pGbo)
    420423{
     
    592595        for (uint32_t i = 0; i < pGbo->cDescriptors; ++i)
    593596        {
    594             rc = PDMDevHlpPGMHandlerPhysicalRegister(pSvgaR3State->pDevIns,
    595                                                      pGbo->paDescriptors[i].GCPhys, pGbo->paDescriptors[i].GCPhys + pGbo->paDescriptors[i].cPages * PAGE_SIZE - 1,
    596                                                      pSvgaR3State->hGboAccessHandlerType, pSvgaR3State->pDevIns, NIL_RTR0PTR, NIL_RTRCPTR, "VMSVGA GBO");
     597            rc = PDMDevHlpPGMHandlerPhysicalRegister(pSvgaR3State->pDevIns, pGbo->paDescriptors[i].GCPhys,
     598                                                     pGbo->paDescriptors[i].GCPhys + pGbo->paDescriptors[i].cPages * PAGE_SIZE - 1,
     599                                                     pSvgaR3State->hGboAccessHandlerType, "VMSVGA GBO");
    597600            AssertRC(rc);
    598601        }
     
    10351038    return rc;
    10361039}
     1040
    10371041#endif /* VBOX_WITH_VMSVGA3D */
    1038 
    10391042
    10401043/*
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA-internal.h

    r93115 r93635  
    248248
    249249DECLCALLBACK(VBOXSTRICTRC) vmsvgaR3GboAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf,
    250                                                     PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser);
     250                                                    PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, uint64_t uUser);
    251251
    252252void vmsvgaR3ResetScreens(PVGASTATE pThis, PVGASTATECC pThisCC);
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