VirtualBox

Changeset 63682 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Sep 2, 2016 9:22:00 AM (8 years ago)
Author:
vboxsync
Message:

PDM,IOM: MMIO range length is now a RTGCPHYS instead of uint32_t.

Location:
trunk/src/VBox/VMM/VMMR3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/IOM.cpp

    r62643 r63682  
    13601360 */
    13611361VMMR3_INT_DECL(int)
    1362 IOMR3MmioRegisterR3(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTHCPTR pvUser,
     1362IOMR3MmioRegisterR3(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTGCPHYS cbRange, RTHCPTR pvUser,
    13631363                    R3PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback, R3PTRTYPE(PFNIOMMMIOREAD) pfnReadCallback,
    13641364                    R3PTRTYPE(PFNIOMMMIOFILL) pfnFillCallback, uint32_t fFlags, const char *pszDesc)
    13651365{
    1366     LogFlow(("IOMR3MmioRegisterR3: pDevIns=%p GCPhysStart=%RGp cbRange=%#x pvUser=%RHv pfnWriteCallback=%#x pfnReadCallback=%#x pfnFillCallback=%#x fFlags=%#x pszDesc=%s\n",
     1366    LogFlow(("IOMR3MmioRegisterR3: pDevIns=%p GCPhysStart=%RGp cbRange=%RGp pvUser=%RHv pfnWriteCallback=%#x pfnReadCallback=%#x pfnFillCallback=%#x fFlags=%#x pszDesc=%s\n",
    13671367             pDevIns, GCPhysStart, cbRange, pvUser, pfnWriteCallback, pfnReadCallback, pfnFillCallback, fFlags, pszDesc));
    13681368    int rc;
     
    13711371     * Validate input.
    13721372     */
    1373     AssertMsgReturn(GCPhysStart + (cbRange - 1) >= GCPhysStart,("Wrapped! %RGp %#x bytes\n", GCPhysStart, cbRange),
     1373    AssertMsgReturn(GCPhysStart + (cbRange - 1) >= GCPhysStart,("Wrapped! %RGp LB %RGp\n", GCPhysStart, cbRange),
    13741374                    VERR_IOM_INVALID_MMIO_RANGE);
    13751375    AssertMsgReturn(   !(fFlags & ~IOMMMIO_FLAGS_VALID_MASK)
     
    14631463 */
    14641464VMMR3_INT_DECL(int)
    1465 IOMR3MmioRegisterRC(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTGCPTR pvUser,
     1465IOMR3MmioRegisterRC(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTGCPHYS cbRange, RTGCPTR pvUser,
    14661466                    RCPTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback, RCPTRTYPE(PFNIOMMMIOREAD) pfnReadCallback,
    14671467                    RCPTRTYPE(PFNIOMMMIOFILL) pfnFillCallback)
    14681468{
    1469     LogFlow(("IOMR3MmioRegisterRC: pDevIns=%p GCPhysStart=%RGp cbRange=%#x pvUser=%RGv pfnWriteCallback=%#x pfnReadCallback=%#x pfnFillCallback=%#x\n",
     1469    LogFlow(("IOMR3MmioRegisterRC: pDevIns=%p GCPhysStart=%RGp cbRange=%RGp pvUser=%RGv pfnWriteCallback=%#x pfnReadCallback=%#x pfnFillCallback=%#x\n",
    14701470             pDevIns, GCPhysStart, cbRange, pvUser, pfnWriteCallback, pfnReadCallback, pfnFillCallback));
    14711471    AssertReturn(!HMIsEnabled(pVM), VERR_IOM_HM_IPE);
     
    14761476    if (!pfnWriteCallback && !pfnReadCallback)
    14771477    {
    1478         AssertMsgFailed(("No callbacks! %RGp LB%#x\n", GCPhysStart, cbRange));
     1478        AssertMsgFailed(("No callbacks! %RGp LB %RGp\n", GCPhysStart, cbRange));
    14791479        return VERR_INVALID_PARAMETER;
    14801480    }
     
    15221522 */
    15231523VMMR3_INT_DECL(int)
    1524 IOMR3MmioRegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTR0PTR pvUser,
     1524IOMR3MmioRegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTGCPHYS cbRange, RTR0PTR pvUser,
    15251525                    R0PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback,
    15261526                    R0PTRTYPE(PFNIOMMMIOREAD) pfnReadCallback,
    15271527                    R0PTRTYPE(PFNIOMMMIOFILL) pfnFillCallback)
    15281528{
    1529     LogFlow(("IOMR3MmioRegisterR0: pDevIns=%p GCPhysStart=%RGp cbRange=%#x pvUser=%RHv pfnWriteCallback=%#x pfnReadCallback=%#x pfnFillCallback=%#x\n",
     1529    LogFlow(("IOMR3MmioRegisterR0: pDevIns=%p GCPhysStart=%RGp cbRange=%RGp pvUser=%RHv pfnWriteCallback=%#x pfnReadCallback=%#x pfnFillCallback=%#x\n",
    15301530             pDevIns, GCPhysStart, cbRange, pvUser, pfnWriteCallback, pfnReadCallback, pfnFillCallback));
    15311531
     
    15351535    if (!pfnWriteCallback && !pfnReadCallback)
    15361536    {
    1537         AssertMsgFailed(("No callbacks! %RGp LB%#x\n", GCPhysStart, cbRange));
     1537        AssertMsgFailed(("No callbacks! %RGp LB %RGp\n", GCPhysStart, cbRange));
    15381538        return VERR_INVALID_PARAMETER;
    15391539    }
     
    15761576 *          all the checks you might expect it to do.
    15771577 */
    1578 VMMR3_INT_DECL(int) IOMR3MmioDeregister(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange)
    1579 {
    1580     LogFlow(("IOMR3MmioDeregister: pDevIns=%p GCPhysStart=%RGp cbRange=%#x\n", pDevIns, GCPhysStart, cbRange));
     1578VMMR3_INT_DECL(int) IOMR3MmioDeregister(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTGCPHYS cbRange)
     1579{
     1580    LogFlow(("IOMR3MmioDeregister: pDevIns=%p GCPhysStart=%RGp cbRange=%RGp\n", pDevIns, GCPhysStart, cbRange));
    15811581
    15821582    /*
     
    15861586    if (GCPhysLast < GCPhysStart)
    15871587    {
    1588         AssertMsgFailed(("Wrapped! %#x LB%#x\n", GCPhysStart, cbRange));
     1588        AssertMsgFailed(("Wrapped! %#x LB %RGp\n", GCPhysStart, cbRange));
    15891589        return VERR_IOM_INVALID_MMIO_RANGE;
    15901590    }
     
    16061606        }
    16071607        AssertMsgReturnStmt(pRange->pDevInsR3 == pDevIns,
    1608                             ("Not owner! GCPhys=%RGp %RGp LB%#x %s\n", GCPhys, GCPhysStart, cbRange, pRange->pszDesc),
     1608                            ("Not owner! GCPhys=%RGp %RGp LB %RGp %s\n", GCPhys, GCPhysStart, cbRange, pRange->pszDesc),
    16091609                            IOM_UNLOCK_EXCL(pVM),
    16101610                            VERR_IOM_NOT_MMIO_RANGE_OWNER);
    16111611        AssertMsgReturnStmt(pRange->Core.KeyLast <= GCPhysLast,
    1612                             ("Incomplete R3 range! GCPhys=%RGp %RGp LB%#x %s\n", GCPhys, GCPhysStart, cbRange, pRange->pszDesc),
     1612                            ("Incomplete R3 range! GCPhys=%RGp %RGp LB %RGp %s\n", GCPhys, GCPhysStart, cbRange, pRange->pszDesc),
    16131613                            IOM_UNLOCK_EXCL(pVM),
    16141614                            VERR_IOM_INCOMPLETE_MMIO_RANGE);
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r62643 r63682  
    274274
    275275/** @interface_method_impl{PDMDEVHLPR3,pfnMMIORegister} */
    276 static DECLCALLBACK(int) pdmR3DevHlp_MMIORegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTHCPTR pvUser,
     276static DECLCALLBACK(int) pdmR3DevHlp_MMIORegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTGCPHYS cbRange, RTHCPTR pvUser,
    277277                                                  PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, PFNIOMMMIOFILL pfnFill,
    278278                                                  uint32_t fFlags, const char *pszDesc)
     
    281281    PVM pVM = pDevIns->Internal.s.pVMR3;
    282282    VM_ASSERT_EMT(pVM);
    283     LogFlow(("pdmR3DevHlp_MMIORegister: caller='%s'/%d: GCPhysStart=%RGp cbRange=%#x pvUser=%p pfnWrite=%p pfnRead=%p pfnFill=%p fFlags=%#x pszDesc=%p:{%s}\n",
     283    LogFlow(("pdmR3DevHlp_MMIORegister: caller='%s'/%d: GCPhysStart=%RGp cbRange=%RGp pvUser=%p pfnWrite=%p pfnRead=%p pfnFill=%p fFlags=%#x pszDesc=%p:{%s}\n",
    284284             pDevIns->pReg->szName, pDevIns->iInstance, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc, fFlags, pszDesc));
    285285
     
    300300
    301301/** @interface_method_impl{PDMDEVHLPR3,pfnMMIORegisterRC} */
    302 static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterRC(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTRCPTR pvUser,
     302static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterRC(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTGCPHYS cbRange, RTRCPTR pvUser,
    303303                                                    const char *pszWrite, const char *pszRead, const char *pszFill)
    304304{
     
    306306    PVM pVM = pDevIns->Internal.s.pVMR3;
    307307    VM_ASSERT_EMT(pVM);
    308     LogFlow(("pdmR3DevHlp_MMIORegisterRC: caller='%s'/%d: GCPhysStart=%RGp cbRange=%#x pvUser=%p pszWrite=%p:{%s} pszRead=%p:{%s} pszFill=%p:{%s}\n",
     308    LogFlow(("pdmR3DevHlp_MMIORegisterRC: caller='%s'/%d: GCPhysStart=%RGp cbRange=%RGp pvUser=%p pszWrite=%p:{%s} pszRead=%p:{%s} pszFill=%p:{%s}\n",
    309309             pDevIns->pReg->szName, pDevIns->iInstance, GCPhysStart, cbRange, pvUser, pszWrite, pszWrite, pszRead, pszRead, pszFill, pszFill));
    310310
     
    357357
    358358/** @interface_method_impl{PDMDEVHLPR3,pfnMMIORegisterR0} */
    359 static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTR0PTR pvUser,
     359static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTGCPHYS cbRange, RTR0PTR pvUser,
    360360                                                    const char *pszWrite, const char *pszRead, const char *pszFill)
    361361{
    362362    PDMDEV_ASSERT_DEVINS(pDevIns);
    363363    VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
    364     LogFlow(("pdmR3DevHlp_MMIORegisterHC: caller='%s'/%d: GCPhysStart=%RGp cbRange=%#x pvUser=%p pszWrite=%p:{%s} pszRead=%p:{%s} pszFill=%p:{%s}\n",
     364    LogFlow(("pdmR3DevHlp_MMIORegisterHC: caller='%s'/%d: GCPhysStart=%RGp cbRange=%RGp pvUser=%p pszWrite=%p:{%s} pszRead=%p:{%s} pszFill=%p:{%s}\n",
    365365             pDevIns->pReg->szName, pDevIns->iInstance, GCPhysStart, cbRange, pvUser, pszWrite, pszWrite, pszRead, pszRead, pszFill, pszFill));
    366366
     
    385385            rc3 = pdmR3DevGetSymbolR0Lazy(pDevIns, pszFill, &pfnR0PtrFill);
    386386        if (RT_SUCCESS(rc) && RT_SUCCESS(rc2) && RT_SUCCESS(rc3))
    387             rc = IOMR3MmioRegisterR0(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvUser, pfnR0PtrWrite, pfnR0PtrRead, pfnR0PtrFill);
     387            rc = IOMR3MmioRegisterR0(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvUser,
     388                                     pfnR0PtrWrite, pfnR0PtrRead, pfnR0PtrFill);
    388389        else
    389390        {
     
    409410
    410411/** @interface_method_impl{PDMDEVHLPR3,pfnMMIODeregister} */
    411 static DECLCALLBACK(int) pdmR3DevHlp_MMIODeregister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange)
     412static DECLCALLBACK(int) pdmR3DevHlp_MMIODeregister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTGCPHYS cbRange)
    412413{
    413414    PDMDEV_ASSERT_DEVINS(pDevIns);
    414415    VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
    415     LogFlow(("pdmR3DevHlp_MMIODeregister: caller='%s'/%d: GCPhysStart=%RGp cbRange=%#x\n",
     416    LogFlow(("pdmR3DevHlp_MMIODeregister: caller='%s'/%d: GCPhysStart=%RGp cbRange=%RGp\n",
    416417             pDevIns->pReg->szName, pDevIns->iInstance, GCPhysStart, cbRange));
    417418
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