VirtualBox

Changeset 39136 in vbox for trunk


Ignore:
Timestamp:
Oct 28, 2011 10:13:34 AM (13 years ago)
Author:
vboxsync
Message:

More MMIO refactoring and some other cleanups.

Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmdev.h

    r39135 r39136  
    126126 * @remarks Not used.
    127127 */
    128 typedef DECLCALLBACK(int) FNPDMDEVIOCTL(PPDMDEVINS pDevIns, RTUINT uFunction,
    129                                         void *pvIn, RTUINT cbIn,
    130                                         void *pvOut, RTUINT cbOut, PRTUINT pcbOut);
     128typedef DECLCALLBACK(int) FNPDMDEVIOCTL(PPDMDEVINS pDevIns, uint32_t uFunction,
     129                                        void *pvIn, uint32_t cbIn,
     130                                        void *pvOut, uint32_t cbOut, PRTUINT pcbOut);
    131131/** Pointer to a FNPDMDEVIOCTL() function. */
    132132typedef FNPDMDEVIOCTL *PFNPDMDEVIOCTL;
     
    21632163     * @param   pszDesc             Pointer to description string. This must not be freed.
    21642164     */
    2165     DECLR3CALLBACKMEMBER(int, pfnIOPortRegister,(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTHCPTR pvUser,
     2165    DECLR3CALLBACKMEMBER(int, pfnIOPortRegister,(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts, RTHCPTR pvUser,
    21662166                                                 PFNIOMIOPORTOUT pfnOut, PFNIOMIOPORTIN pfnIn,
    21672167                                                 PFNIOMIOPORTOUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, const char *pszDesc));
     
    21872187     * @param   pszDesc             Pointer to description string. This must not be freed.
    21882188     */
    2189     DECLR3CALLBACKMEMBER(int, pfnIOPortRegisterRC,(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTRCPTR pvUser,
     2189    DECLR3CALLBACKMEMBER(int, pfnIOPortRegisterRC,(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts, RTRCPTR pvUser,
    21902190                                                   const char *pszOut, const char *pszIn,
    21912191                                                   const char *pszOutStr, const char *pszInStr, const char *pszDesc));
     
    22082208     * @param   pszDesc             Pointer to description string. This must not be freed.
    22092209     */
    2210     DECLR3CALLBACKMEMBER(int, pfnIOPortRegisterR0,(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTR0PTR pvUser,
     2210    DECLR3CALLBACKMEMBER(int, pfnIOPortRegisterR0,(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts, RTR0PTR pvUser,
    22112211                                                   const char *pszOut, const char *pszIn,
    22122212                                                   const char *pszOutStr, const char *pszInStr, const char *pszDesc));
     
    22222222     * @param   cPorts              Number of ports to deregister.
    22232223     */
    2224     DECLR3CALLBACKMEMBER(int, pfnIOPortDeregister,(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts));
     2224    DECLR3CALLBACKMEMBER(int, pfnIOPortDeregister,(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts));
    22252225
    22262226    /**
     
    22422242     * @param   pszDesc             Pointer to description string. This must not be freed.
    22432243     */
    2244     DECLR3CALLBACKMEMBER(int, pfnMMIORegister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
     2244    DECLR3CALLBACKMEMBER(int, pfnMMIORegister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTHCPTR pvUser,
    22452245                                               PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, PFNIOMMMIOFILL pfnFill,
    22462246                                               uint32_t fFlags, const char *pszDesc));
     
    22622262     * @param   pszFill             Name of the RC function which is gonna handle Fill/memset operations. (optional)
    22632263     */
    2264     DECLR3CALLBACKMEMBER(int, pfnMMIORegisterRC,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
     2264    DECLR3CALLBACKMEMBER(int, pfnMMIORegisterRC,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTRCPTR pvUser,
    22652265                                                 const char *pszWrite, const char *pszRead, const char *pszFill));
    22662266
     
    22822282     * @param   pszDesc             Obsolete. NULL is fine.
    22832283     */
    2284     DECLR3CALLBACKMEMBER(int, pfnMMIORegisterR0,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
     2284    DECLR3CALLBACKMEMBER(int, pfnMMIORegisterR0,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTR0PTR pvUser,
    22852285                                                 const char *pszWrite, const char *pszRead, const char *pszFill));
    22862286
     
    22952295     * @param   cbRange             The size of the range (in bytes).
    22962296     */
    2297     DECLR3CALLBACKMEMBER(int, pfnMMIODeregister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange));
     2297    DECLR3CALLBACKMEMBER(int, pfnMMIODeregister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange));
    22982298
    22992299    /**
     
    24222422     *          manually from the device yet. At present I doubt we need such features...
    24232423     */
    2424     DECLR3CALLBACKMEMBER(int, pfnROMRegister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange,
     2424    DECLR3CALLBACKMEMBER(int, pfnROMRegister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange,
    24252425                                              const void *pvBinary, uint32_t cbBinary, uint32_t fFlags, const char *pszDesc));
    24262426
     
    24362436     * @param   enmProt             The new protection type.
    24372437     */
    2438     DECLR3CALLBACKMEMBER(int, pfnROMProtectShadow,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, PGMROMPROT enmProt));
     2438    DECLR3CALLBACKMEMBER(int, pfnROMProtectShadow,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, PGMROMPROT enmProt));
    24392439
    24402440    /**
     
    29202920     *                              for the live of the device instance.
    29212921     */
    2922     DECLR3CALLBACKMEMBER(int, pfnDriverAttach,(PPDMDEVINS pDevIns, RTUINT iLun, PPDMIBASE pBaseInterface, PPDMIBASE *ppBaseInterface, const char *pszDesc));
     2922    DECLR3CALLBACKMEMBER(int, pfnDriverAttach,(PPDMDEVINS pDevIns, uint32_t iLun, PPDMIBASE pBaseInterface, PPDMIBASE *ppBaseInterface, const char *pszDesc));
    29232923
    29242924    /**
     
    29382938     * @thread  The emulation thread.
    29392939     */
    2940     DECLR3CALLBACKMEMBER(int, pfnQueueCreate,(PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
     2940    DECLR3CALLBACKMEMBER(int, pfnQueueCreate,(PPDMDEVINS pDevIns, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
    29412941                                              PFNPDMQUEUEDEV pfnCallback, bool fRZEnabled, const char *pszName, PPDMQUEUE *ppQueue));
    29422942
     
    40674067 * @copydoc PDMDEVHLPR3::pfnIOPortRegister
    40684068 */
    4069 DECLINLINE(int) PDMDevHlpIOPortRegister(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTHCPTR pvUser,
     4069DECLINLINE(int) PDMDevHlpIOPortRegister(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts, RTHCPTR pvUser,
    40704070                                        PFNIOMIOPORTOUT pfnOut, PFNIOMIOPORTIN pfnIn,
    40714071                                        PFNIOMIOPORTOUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, const char *pszDesc)
     
    40774077 * @copydoc PDMDEVHLPR3::pfnIOPortRegisterRC
    40784078 */
    4079 DECLINLINE(int) PDMDevHlpIOPortRegisterRC(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTRCPTR pvUser,
     4079DECLINLINE(int) PDMDevHlpIOPortRegisterRC(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts, RTRCPTR pvUser,
    40804080                                          const char *pszOut, const char *pszIn, const char *pszOutStr,
    40814081                                          const char *pszInStr, const char *pszDesc)
     
    40874087 * @copydoc PDMDEVHLPR3::pfnIOPortRegisterR0
    40884088 */
    4089 DECLINLINE(int) PDMDevHlpIOPortRegisterR0(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTR0PTR pvUser,
     4089DECLINLINE(int) PDMDevHlpIOPortRegisterR0(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts, RTR0PTR pvUser,
    40904090                                          const char *pszOut, const char *pszIn, const char *pszOutStr,
    40914091                                          const char *pszInStr, const char *pszDesc)
     
    40974097 * @copydoc PDMDEVHLPR3::pfnIOPortDeregister
    40984098 */
    4099 DECLINLINE(int) PDMDevHlpIOPortDeregister(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts)
     4099DECLINLINE(int) PDMDevHlpIOPortDeregister(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts)
    41004100{
    41014101    return pDevIns->pHlpR3->pfnIOPortDeregister(pDevIns, Port, cPorts);
     
    41034103
    41044104/**
    4105  * @copydoc PDMDEVHLPR3::pfnMMIORegister
    4106  */
    4107 DECLINLINE(int) PDMDevHlpMMIORegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
     4105 * Register a Memory Mapped I/O (MMIO) region.
     4106 *
     4107 * These callbacks are of course for the ring-3 context (R3). Register HC
     4108 * handlers before raw-mode context (RC) and ring-0 context (R0) handlers! There
     4109 * must be a R3 handler for every RC and R0 handler!
     4110 *
     4111 * @returns VBox status.
     4112 * @param   pDevIns             The device instance to register the MMIO with.
     4113 * @param   GCPhysStart         First physical address in the range.
     4114 * @param   cbRange             The size of the range (in bytes).
     4115 * @param   pvUser              User argument.
     4116 * @param   fFlags              Flags, IOMMMIO_FLAGS_XXX.
     4117 * @param   pfnWrite            Pointer to function which is gonna handle Write operations.
     4118 * @param   pfnRead             Pointer to function which is gonna handle Read operations.
     4119 * @param   pszDesc             Pointer to description string. This must not be freed.
     4120 */
     4121DECLINLINE(int) PDMDevHlpMMIORegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTHCPTR pvUser,
    41084122                                      uint32_t fFlags, PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, const char *pszDesc)
    41094123{
     
    41134127
    41144128/**
     4129 * Register a Memory Mapped I/O (MMIO) region for GC.
     4130 *
     4131 * These callbacks are for the raw-mode context (RC). Register ring-3 context
     4132 * (R3) handlers before guest context handlers! There must be a R3 handler for
     4133 * every RC handler!
     4134 *
     4135 * @returns VBox status.
     4136 * @param   pDevIns             The device instance to register the MMIO with.
     4137 * @param   GCPhysStart         First physical address in the range.
     4138 * @param   cbRange             The size of the range (in bytes).
     4139 * @param   pvUser              User argument.
     4140 * @param   pszWrite            Name of the RC function which is gonna handle Write operations.
     4141 * @param   pszRead             Name of the RC function which is gonna handle Read operations.
     4142 */
     4143DECLINLINE(int) PDMDevHlpMMIORegisterRC(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTRCPTR pvUser,
     4144                                        const char *pszWrite, const char *pszRead)
     4145{
     4146    return pDevIns->pHlpR3->pfnMMIORegisterRC(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, NULL /*pszFill*/);
     4147}
     4148
     4149/**
     4150 * @copydoc PDMDEVHLPR3::pfnMMIORegisterR0
     4151 */
     4152DECLINLINE(int) PDMDevHlpMMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTR0PTR pvUser,
     4153                                        const char *pszWrite, const char *pszRead)
     4154{
     4155    return pDevIns->pHlpR3->pfnMMIORegisterR0(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, NULL /*pszFill*/);
     4156}
     4157
     4158/**
    41154159 * @copydoc PDMDEVHLPR3::pfnMMIORegister
    41164160 */
    4117 DECLINLINE(int) PDMDevHlpMMIORegisterEx(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
     4161DECLINLINE(int) PDMDevHlpMMIORegisterEx(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTHCPTR pvUser,
    41184162                                        uint32_t fFlags, PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead,
    41194163                                        PFNIOMMMIOFILL pfnFill, const char *pszDesc)
     
    41264170 * @copydoc PDMDEVHLPR3::pfnMMIORegisterRC
    41274171 */
    4128 DECLINLINE(int) PDMDevHlpMMIORegisterRC(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
     4172DECLINLINE(int) PDMDevHlpMMIORegisterRCEx(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTGCPTR pvUser,
    41294173                                        const char *pszWrite, const char *pszRead, const char *pszFill)
    41304174{
     
    41354179 * @copydoc PDMDEVHLPR3::pfnMMIORegisterR0
    41364180 */
    4137 DECLINLINE(int) PDMDevHlpMMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
     4181DECLINLINE(int) PDMDevHlpMMIORegisterR0Ex(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTR0PTR pvUser,
    41384182                                        const char *pszWrite, const char *pszRead, const char *pszFill)
    41394183{
     
    41444188 * @copydoc PDMDEVHLPR3::pfnMMIODeregister
    41454189 */
    4146 DECLINLINE(int) PDMDevHlpMMIODeregister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange)
     4190DECLINLINE(int) PDMDevHlpMMIODeregister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange)
    41474191{
    41484192    return pDevIns->pHlpR3->pfnMMIODeregister(pDevIns, GCPhysStart, cbRange);
     
    42024246 * @copydoc PDMDEVHLPR3::pfnROMRegister
    42034247 */
    4204 DECLINLINE(int) PDMDevHlpROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange,
     4248DECLINLINE(int) PDMDevHlpROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange,
    42054249                                     const void *pvBinary, uint32_t cbBinary, uint32_t fFlags, const char *pszDesc)
    42064250{
     
    42114255 * @copydoc PDMDEVHLPR3::pfnROMProtectShadow
    42124256 */
    4213 DECLINLINE(int) PDMDevHlpROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, PGMROMPROT enmProt)
     4257DECLINLINE(int) PDMDevHlpROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, PGMROMPROT enmProt)
    42144258{
    42154259    return pDevIns->pHlpR3->pfnROMProtectShadow(pDevIns, GCPhysStart, cbRange, enmProt);
     
    45654609 * @copydoc PDMDEVHLPR3::pfnDriverAttach
    45664610 */
    4567 DECLINLINE(int) PDMDevHlpDriverAttach(PPDMDEVINS pDevIns, RTUINT iLun, PPDMIBASE pBaseInterface, PPDMIBASE *ppBaseInterface, const char *pszDesc)
     4611DECLINLINE(int) PDMDevHlpDriverAttach(PPDMDEVINS pDevIns, uint32_t iLun, PPDMIBASE pBaseInterface, PPDMIBASE *ppBaseInterface, const char *pszDesc)
    45684612{
    45694613    return pDevIns->pHlpR3->pfnDriverAttach(pDevIns, iLun, pBaseInterface, ppBaseInterface, pszDesc);
     
    45734617 * @copydoc PDMDEVHLPR3::pfnQueueCreate
    45744618 */
    4575 DECLINLINE(int) PDMDevHlpQueueCreate(PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
    4576                                      PFNPDMQUEUEDEV pfnCallback, bool fGCEnabled, const char *pszName, PPDMQUEUE *ppQueue)
    4577 {
    4578     return pDevIns->pHlpR3->pfnQueueCreate(pDevIns, cbItem, cItems, cMilliesInterval, pfnCallback, fGCEnabled, pszName, ppQueue);
     4619DECLINLINE(int) PDMDevHlpQueueCreate(PPDMDEVINS pDevIns, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
     4620                                     PFNPDMQUEUEDEV pfnCallback, bool fRZEnabled, const char *pszName, PPDMQUEUE *ppQueue)
     4621{
     4622    return pDevIns->pHlpR3->pfnQueueCreate(pDevIns, cbItem, cItems, cMilliesInterval, pfnCallback, fRZEnabled, pszName, ppQueue);
    45794623}
    45804624
  • trunk/include/VBox/vmm/pdmqueue.h

    r35361 r39136  
    44
    55/*
    6  * Copyright (C) 2006-2010 Oracle Corporation
     6 * Copyright (C) 2006-2011 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    119119typedef FNPDMQUEUEEXT *PFNPDMQUEUEEXT;
    120120
    121 VMMR3DECL(int)  PDMR3QueueCreateDevice(PVM pVM, PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
    122                                        PFNPDMQUEUEDEV pfnCallback, bool fGCEnabled, const char *pszName, PPDMQUEUE *ppQueue);
    123 VMMR3DECL(int)  PDMR3QueueCreateDriver(PVM pVM, PPDMDRVINS pDrvIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
    124                                        PFNPDMQUEUEDRV pfnCallback, const char *pszName, PPDMQUEUE *ppQueue);
    125 VMMR3DECL(int)  PDMR3QueueCreateInternal(PVM pVM, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
    126                                          PFNPDMQUEUEINT pfnCallback, bool fGCEnabled, const char *pszName, PPDMQUEUE *ppQueue);
    127 VMMR3DECL(int)  PDMR3QueueCreateExternal(PVM pVM, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
    128                                          PFNPDMQUEUEEXT pfnCallback, void *pvUser, const char *pszName, PPDMQUEUE *ppQueue);
    129 VMMR3DECL(int)  PDMR3QueueDestroy(PPDMQUEUE pQueue);
    130 VMMR3DECL(int)  PDMR3QueueDestroyDevice(PVM pVM, PPDMDEVINS pDevIns);
    131 VMMR3DECL(int)  PDMR3QueueDestroyDriver(PVM pVM, PPDMDRVINS pDrvIns);
    132 VMMR3DECL(void) PDMR3QueueFlushAll(PVM pVM);
     121#ifdef VBOX_IN_VMM
     122VMMR3_INT_DECL(int)  PDMR3QueueCreateDevice(PVM pVM, PPDMDEVINS pDevIns, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
     123                                            PFNPDMQUEUEDEV pfnCallback, bool fRZEnabled, const char *pszName, PPDMQUEUE *ppQueue);
     124VMMR3_INT_DECL(int)  PDMR3QueueCreateDriver(PVM pVM, PPDMDRVINS pDrvIns, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
     125                                            PFNPDMQUEUEDRV pfnCallback, const char *pszName, PPDMQUEUE *ppQueue);
     126VMMR3_INT_DECL(int)  PDMR3QueueCreateInternal(PVM pVM, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
     127                                              PFNPDMQUEUEINT pfnCallback, bool fGCEnabled, const char *pszName, PPDMQUEUE *ppQueue);
     128VMMR3_INT_DECL(int)  PDMR3QueueCreateExternal(PVM pVM, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
     129                                              PFNPDMQUEUEEXT pfnCallback, void *pvUser, const char *pszName, PPDMQUEUE *ppQueue);
     130VMMR3_INT_DECL(int)  PDMR3QueueDestroy(PPDMQUEUE pQueue);
     131VMMR3_INT_DECL(int)  PDMR3QueueDestroyDevice(PVM pVM, PPDMDEVINS pDevIns);
     132VMMR3_INT_DECL(int)  PDMR3QueueDestroyDriver(PVM pVM, PPDMDRVINS pDrvIns);
     133VMMR3_INT_DECL(void) PDMR3QueueFlushAll(PVM pVM);
     134#endif /* VBOX_IN_VMM */
    133135
    134136VMMDECL(PPDMQUEUEITEMCORE)    PDMQueueAlloc(PPDMQUEUE pQueue);
  • trunk/src/VBox/Devices/Bus/DevPciIch9.cpp

    r39135 r39136  
    25212521        if (fGCEnabled)
    25222522        {
    2523 
    2524             rc = PDMDevHlpMMIORegisterRC(pDevIns,
    2525                                          pGlobals->u64PciConfigMMioAddress,
    2526                                          pGlobals->u64PciConfigMMioLength,
    2527                                          0,
    2528                                          "ich9pciMcfgMMIOWrite",
    2529                                          "ich9pciMcfgMMIORead",
    2530                                          NULL /* fill */);
    2531             if (RT_FAILURE(rc))
    2532             {
    2533                 AssertMsgRC(rc, ("Cannot register MCFG MMIO (GC): %Rrc\n", rc));
    2534                 return rc;
    2535             }
     2523            rc = PDMDevHlpMMIORegisterRC(pDevIns, pGlobals->u64PciConfigMMioAddress, pGlobals->u64PciConfigMMioLength,
     2524                                         NIL_RTRCPTR /*pvUser*/, "ich9pciMcfgMMIOWrite", "ich9pciMcfgMMIORead");
     2525            AssertRCReturn(rc, rc);
    25362526        }
    25372527
     
    25392529        if (fR0Enabled)
    25402530        {
    2541 
    2542             rc = PDMDevHlpMMIORegisterR0(pDevIns,
    2543                                          pGlobals->u64PciConfigMMioAddress,
    2544                                          pGlobals->u64PciConfigMMioLength,
    2545                                          0,
    2546                                          "ich9pciMcfgMMIOWrite",
    2547                                          "ich9pciMcfgMMIORead",
    2548                                          NULL /* fill */);
    2549             if (RT_FAILURE(rc))
    2550             {
    2551                 AssertMsgRC(rc, ("Cannot register MCFG MMIO (R0): %Rrc\n", rc));
    2552                 return rc;
    2553             }
     2531            rc = PDMDevHlpMMIORegisterR0(pDevIns, pGlobals->u64PciConfigMMioAddress, pGlobals->u64PciConfigMMioLength,
     2532                                         NIL_RTR0PTR /*pvUser*/, "ich9pciMcfgMMIOWrite", "ich9pciMcfgMMIORead");
     2533            AssertRCReturn(rc, rc);
    25542534        }
    25552535    }
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r39135 r39136  
    59905990    if (pThis->fGCEnabled)
    59915991    {
    5992         rc = PDMDevHlpMMIORegisterRC(pDevIns, 0x000a0000, 0x00020000, 0, "vgaMMIOWrite", "vgaMMIORead", "vgaMMIOFill");
     5992        rc = PDMDevHlpMMIORegisterRCEx(pDevIns, 0x000a0000, 0x00020000, NIL_RTRCPTR /*pvUser*/,
     5993                                       "vgaMMIOWrite", "vgaMMIORead", "vgaMMIOFill");
    59935994        if (RT_FAILURE(rc))
    59945995            return rc;
     
    59965997    if (pThis->fR0Enabled)
    59975998    {
    5998         rc = PDMDevHlpMMIORegisterR0(pDevIns, 0x000a0000, 0x00020000, 0, "vgaMMIOWrite", "vgaMMIORead", "vgaMMIOFill");
     5999        rc = PDMDevHlpMMIORegisterR0Ex(pDevIns, 0x000a0000, 0x00020000, NIL_RTR0PTR /*pvUser*/,
     6000                                       "vgaMMIOWrite", "vgaMMIORead", "vgaMMIOFill");
    59996001        if (RT_FAILURE(rc))
    60006002            return rc;
  • trunk/src/VBox/Devices/Network/DevE1000.cpp

    r39135 r39136  
    46404640            if (pState->fR0Enabled)
    46414641            {
    4642                 rc = PDMDevHlpMMIORegisterR0(pPciDev->pDevIns, GCPhysAddress, cb, 0,
    4643                                              "e1kMMIOWrite", "e1kMMIORead", NULL);
     4642                rc = PDMDevHlpMMIORegisterR0(pPciDev->pDevIns, GCPhysAddress, cb, NIL_RTR0PTR /*pvUser*/,
     4643                                             "e1kMMIOWrite", "e1kMMIORead");
    46444644                if (RT_FAILURE(rc))
    46454645                    break;
     
    46474647            if (pState->fGCEnabled)
    46484648            {
    4649                 rc = PDMDevHlpMMIORegisterRC(pPciDev->pDevIns, GCPhysAddress, cb, 0,
    4650                                              "e1kMMIOWrite", "e1kMMIORead", NULL);
     4649                rc = PDMDevHlpMMIORegisterRC(pPciDev->pDevIns, GCPhysAddress, cb, NIL_RTRCPTR /*pvUser*/,
     4650                                             "e1kMMIOWrite", "e1kMMIORead");
    46514651            }
    46524652            break;
  • trunk/src/VBox/Devices/PC/DevAPIC.cpp

    r39135 r39136  
    22892289        pDev->pCritSectRC = pDev->pApicHlpR3->pfnGetRCCritSect(pDevIns);
    22902290
    2291         rc = PDMDevHlpMMIORegisterRC(pDevIns, ApicBase, 0x1000, 0,
    2292                                      "apicMMIOWrite", "apicMMIORead", NULL);
     2291        rc = PDMDevHlpMMIORegisterRC(pDevIns, ApicBase, 0x1000, NIL_RTRCPTR /*pvUser*/, "apicMMIOWrite", "apicMMIORead");
    22932292        if (RT_FAILURE(rc))
    22942293            return rc;
     
    22992298        pDev->pCritSectR0 = pDev->pApicHlpR3->pfnGetR0CritSect(pDevIns);
    23002299
    2301         rc = PDMDevHlpMMIORegisterR0(pDevIns, ApicBase, 0x1000, 0,
    2302                                      "apicMMIOWrite", "apicMMIORead", NULL);
     2300        rc = PDMDevHlpMMIORegisterR0(pDevIns, ApicBase, 0x1000, NIL_RTR0PTR /*pvUser*/, "apicMMIOWrite", "apicMMIORead");
    23032301        if (RT_FAILURE(rc))
    23042302            return rc;
  • trunk/src/VBox/Devices/PC/DevHPET.cpp

    r39135 r39136  
    14501450    if (fRCEnabled)
    14511451    {
    1452         rc = PDMDevHlpMMIORegisterRC(pDevIns, HPET_BASE, 0x1000, 0,
    1453                                      "hpetMMIOWrite", "hpetMMIORead", NULL);
     1452        rc = PDMDevHlpMMIORegisterRC(pDevIns, HPET_BASE, 0x1000, NIL_RTRCPTR /*pvUser*/, "hpetMMIOWrite", "hpetMMIORead");
    14541453        AssertRCReturn(rc, rc);
    14551454
     
    14601459    if (fR0Enabled)
    14611460    {
    1462         rc = PDMDevHlpMMIORegisterR0(pDevIns, HPET_BASE, 0x1000, 0,
    1463                                      "hpetMMIOWrite", "hpetMMIORead", NULL);
     1461        rc = PDMDevHlpMMIORegisterR0(pDevIns, HPET_BASE, 0x1000, NIL_RTR0PTR /*pvUser*/,
     1462                                     "hpetMMIOWrite", "hpetMMIORead");
    14641463        AssertRCReturn(rc, rc);
    14651464
  • trunk/src/VBox/Devices/PC/DevIoApic.cpp

    r39135 r39136  
    637637        s->pIoApicHlpRC = s->pIoApicHlpR3->pfnGetRCHelpers(pDevIns);
    638638
    639         rc = PDMDevHlpMMIORegisterRC(pDevIns, 0xfec00000, 0x1000, 0,
    640                                      "ioapicMMIOWrite", "ioapicMMIORead", NULL);
     639        rc = PDMDevHlpMMIORegisterRC(pDevIns, 0xfec00000, 0x1000, NIL_RTRCPTR /*pvUser*/, "ioapicMMIOWrite", "ioapicMMIORead");
    641640        if (RT_FAILURE(rc))
    642641            return rc;
     
    646645        s->pIoApicHlpR0 = s->pIoApicHlpR3->pfnGetR0Helpers(pDevIns);
    647646
    648         rc = PDMDevHlpMMIORegisterR0(pDevIns, 0xfec00000, 0x1000, 0,
    649                                      "ioapicMMIOWrite", "ioapicMMIORead", NULL);
     647        rc = PDMDevHlpMMIORegisterR0(pDevIns, 0xfec00000, 0x1000, NIL_RTR0PTR /*pvUser*/,
     648                                     "ioapicMMIOWrite", "ioapicMMIORead");
    650649        if (RT_FAILURE(rc))
    651650            return rc;
  • trunk/src/VBox/Devices/Storage/DevAHCI.cpp

    r39135 r39136  
    25062506
    25072507    /* We use the assigned size here, because we currently only support page aligned MMIO ranges. */
    2508     rc = PDMDevHlpMMIORegisterEx(pDevIns, GCPhysAddress, cb, NULL /*pvUser*/,
    2509                                  IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
    2510                                  ahciMMIOWrite, ahciMMIORead, NULL, "AHCI");
     2508    rc = PDMDevHlpMMIORegister(pDevIns, GCPhysAddress, cb, NULL /*pvUser*/,
     2509                               IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     2510                               ahciMMIOWrite, ahciMMIORead, "AHCI");
    25112511    if (RT_FAILURE(rc))
    25122512        return rc;
     
    25142514    if (pThis->fR0Enabled)
    25152515    {
    2516         rc = PDMDevHlpMMIORegisterR0(pDevIns, GCPhysAddress, cb, 0,
    2517                                      "ahciMMIOWrite", "ahciMMIORead", NULL);
     2516        rc = PDMDevHlpMMIORegisterR0(pDevIns, GCPhysAddress, cb, NIL_RTR0PTR /*pvUser*/, "ahciMMIOWrite", "ahciMMIORead");
    25182517        if (RT_FAILURE(rc))
    25192518            return rc;
     
    25222521    if (pThis->fGCEnabled)
    25232522    {
    2524         rc = PDMDevHlpMMIORegisterRC(pDevIns, GCPhysAddress, cb, 0,
    2525                                      "ahciMMIOWrite", "ahciMMIORead", NULL);
     2523        rc = PDMDevHlpMMIORegisterRC(pDevIns, GCPhysAddress, cb, NIL_RTRCPTR /*pvUser*/, "ahciMMIOWrite", "ahciMMIORead");
    25262524        if (RT_FAILURE(rc))
    25272525            return rc;
  • trunk/src/VBox/Devices/Storage/DevBusLogic.cpp

    r39135 r39136  
    20822082        if (pThis->fR0Enabled)
    20832083        {
    2084             rc = PDMDevHlpMMIORegisterR0(pDevIns, GCPhysAddress, cb, 0,
    2085                                          "buslogicMMIOWrite", "buslogicMMIORead", NULL);
     2084            rc = PDMDevHlpMMIORegisterR0(pDevIns, GCPhysAddress, cb, NIL_RTR0PTR /*pvUser*/,
     2085                                         "buslogicMMIOWrite", "buslogicMMIORead");
    20862086            if (RT_FAILURE(rc))
    20872087                return rc;
     
    20902090        if (pThis->fGCEnabled)
    20912091        {
    2092             rc = PDMDevHlpMMIORegisterRC(pDevIns, GCPhysAddress, cb, 0,
    2093                                          "buslogicMMIOWrite", "buslogicMMIORead", NULL);
     2092            rc = PDMDevHlpMMIORegisterRC(pDevIns, GCPhysAddress, cb, NIL_RTRCPTR /*pvUser*/,
     2093                                         "buslogicMMIOWrite", "buslogicMMIORead");
    20942094            if (RT_FAILURE(rc))
    20952095                return rc;
  • trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp

    r39135 r39136  
    38493849        if (pThis->fR0Enabled)
    38503850        {
    3851             rc = PDMDevHlpMMIORegisterR0(pDevIns, GCPhysAddress, cb, 0,
    3852                                          "lsilogicMMIOWrite", "lsilogicMMIORead", NULL);
     3851            rc = PDMDevHlpMMIORegisterR0(pDevIns, GCPhysAddress, cb, NIL_RTR0PTR /*pvUser*/,
     3852                                         "lsilogicMMIOWrite", "lsilogicMMIORead");
    38533853            if (RT_FAILURE(rc))
    38543854                return rc;
     
    38573857        if (pThis->fGCEnabled)
    38583858        {
    3859             rc = PDMDevHlpMMIORegisterRC(pDevIns, GCPhysAddress, cb, 0,
    3860                                          "lsilogicMMIOWrite", "lsilogicMMIORead", NULL);
     3859            rc = PDMDevHlpMMIORegisterRC(pDevIns, GCPhysAddress, cb, NIL_RTRCPTR /*pvUser*/,
     3860                                         "lsilogicMMIOWrite", "lsilogicMMIORead");
    38613861            if (RT_FAILURE(rc))
    38623862                return rc;
     
    38763876        if (pThis->fR0Enabled)
    38773877        {
    3878             rc = PDMDevHlpMMIORegisterR0(pDevIns, GCPhysAddress, cb, 0,
    3879                                          "lsilogicDiagnosticWrite", "lsilogicDiagnosticRead", NULL);
     3878            rc = PDMDevHlpMMIORegisterR0(pDevIns, GCPhysAddress, cb, NIL_RTR0PTR /*pvUser*/,
     3879                                         "lsilogicDiagnosticWrite", "lsilogicDiagnosticRead");
    38803880            if (RT_FAILURE(rc))
    38813881                return rc;
     
    38843884        if (pThis->fGCEnabled)
    38853885        {
    3886             rc = PDMDevHlpMMIORegisterRC(pDevIns, GCPhysAddress, cb, 0,
    3887                                          "lsilogicDiagnosticWrite", "lsilogicDiagnosticRead", NULL);
     3886            rc = PDMDevHlpMMIORegisterRC(pDevIns, GCPhysAddress, cb, NIL_RTRCPTR /*pvUser*/,
     3887                                         "lsilogicDiagnosticWrite", "lsilogicDiagnosticRead");
    38883888            if (RT_FAILURE(rc))
    38893889                return rc;
  • trunk/src/VBox/Devices/USB/DevOHCI.cpp

    r39135 r39136  
    48844884
    48854885# if 1 /* this enabled / disabled GC/R0 stuff */
    4886     rc = PDMDevHlpMMIORegisterRC(pOhci->CTX_SUFF(pDevIns),
    4887                                  GCPhysAddress,
    4888                                  cb,
    4889                                  0,
    4890                                  "ohciWrite",
    4891                                  "ohciRead",
    4892                                  NULL);
     4886    rc = PDMDevHlpMMIORegisterRC(pOhci->CTX_SUFF(pDevIns), GCPhysAddress, cb, NIL_RTRCPTR /*pvUser*/, "ohciWrite", "ohciRead");
    48934887    if (RT_FAILURE(rc))
    48944888        return rc;
    48954889
    4896     rc = PDMDevHlpMMIORegisterR0(pOhci->CTX_SUFF(pDevIns),
    4897                                  GCPhysAddress,
    4898                                  cb,
    4899                                  0,
    4900                                  "ohciWrite",
    4901                                  "ohciRead",
    4902                                  NULL);
     4890    rc = PDMDevHlpMMIORegisterR0(pOhci->CTX_SUFF(pDevIns), GCPhysAddress, cb, NIL_RTR0PTR /*pvUser*/,
     4891                                 "ohciWrite", "ohciRead");
    49034892    if (RT_FAILURE(rc))
    49044893        return rc;
  • trunk/src/VBox/Devices/VMMDev/VMMDevTesting.cpp

    r39135 r39136  
    343343    {
    344344        rc = PDMDevHlpMMIORegisterR0(pDevIns, VMMDEV_TESTING_MMIO_BASE, VMMDEV_TESTING_MMIO_SIZE, NIL_RTR0PTR /*pvUser*/,
    345                                      "vmmdevTestingMmioWrite",
    346                                      "vmmdevTestingMmioRead",
    347                                      NULL /*pszFill*/);
     345                                     "vmmdevTestingMmioWrite", "vmmdevTestingMmioRead");
    348346        AssertRCReturn(rc, rc);
    349347        rc = PDMDevHlpMMIORegisterRC(pDevIns, VMMDEV_TESTING_MMIO_BASE, VMMDEV_TESTING_MMIO_SIZE, NIL_RTRCPTR /*pvUser*/,
    350                                      "vmmdevTestingMmioWrite",
    351                                      "vmmdevTestingMmioRead",
    352                                      NULL /*pszFill*/);
     348                                     "vmmdevTestingMmioWrite", "vmmdevTestingMmioRead");
    353349        AssertRCReturn(rc, rc);
    354350    }
  • trunk/src/VBox/VMM/Makefile.kmk

    r39134 r39136  
    2929## DEFS variable that is picked up by all three VMM targets.
    3030# Can be prepended to by setting it in LocalConfig.kmk
    31 VMM_COMMON_DEFS ?=
     31VMM_COMMON_DEFS ?= VBOX_IN_VMM
    3232ifdef VBOX_WITH_RAW_MODE
    3333 VMM_COMMON_DEFS += VBOX_WITH_RAW_MODE
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r39111 r39136  
    8585
    8686/** @interface_method_impl{PDMDEVHLPR3,pfnIOPortRegister} */
    87 static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegister(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTHCPTR pvUser, PFNIOMIOPORTOUT pfnOut, PFNIOMIOPORTIN pfnIn,
     87static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegister(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts, RTHCPTR pvUser, PFNIOMIOPORTOUT pfnOut, PFNIOMIOPORTIN pfnIn,
    8888                                                    PFNIOMIOPORTOUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, const char *pszDesc)
    8989{
     
    111111
    112112/** @interface_method_impl{PDMDEVHLPR3,pfnIOPortRegisterRC} */
    113 static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegisterRC(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTRCPTR pvUser,
     113static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegisterRC(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts, RTRCPTR pvUser,
    114114                                                      const char *pszOut, const char *pszIn,
    115115                                                      const char *pszOutStr, const char *pszInStr, const char *pszDesc)
     
    178178
    179179/** @interface_method_impl{PDMDEVHLPR3,pfnIOPortRegisterR0} */
    180 static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegisterR0(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTR0PTR pvUser,
     180static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegisterR0(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts, RTR0PTR pvUser,
    181181                                                      const char *pszOut, const char *pszIn,
    182182                                                      const char *pszOutStr, const char *pszInStr, const char *pszDesc)
     
    245245
    246246/** @interface_method_impl{PDMDEVHLPR3,pfnIOPortDeregister} */
    247 static DECLCALLBACK(int) pdmR3DevHlp_IOPortDeregister(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts)
     247static DECLCALLBACK(int) pdmR3DevHlp_IOPortDeregister(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts)
    248248{
    249249    PDMDEV_ASSERT_DEVINS(pDevIns);
     
    260260
    261261/** @interface_method_impl{PDMDEVHLPR3,pfnMMIORegister} */
    262 static DECLCALLBACK(int) pdmR3DevHlp_MMIORegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
     262static DECLCALLBACK(int) pdmR3DevHlp_MMIORegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTHCPTR pvUser,
    263263                                                  PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, PFNIOMMMIOFILL pfnFill,
    264264                                                  uint32_t fFlags, const char *pszDesc)
     
    286286
    287287/** @interface_method_impl{PDMDEVHLPR3,pfnMMIORegisterRC} */
    288 static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterRC(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
     288static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterRC(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTRCPTR pvUser,
    289289                                                    const char *pszWrite, const char *pszRead, const char *pszFill)
    290290{
     
    341341
    342342/** @interface_method_impl{PDMDEVHLPR3,pfnMMIORegisterR0} */
    343 static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
     343static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTR0PTR pvUser,
    344344                                                    const char *pszWrite, const char *pszRead, const char *pszFill)
    345345{
     
    393393
    394394/** @interface_method_impl{PDMDEVHLPR3,pfnMMIODeregister} */
    395 static DECLCALLBACK(int) pdmR3DevHlp_MMIODeregister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange)
     395static DECLCALLBACK(int) pdmR3DevHlp_MMIODeregister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange)
    396396{
    397397    PDMDEV_ASSERT_DEVINS(pDevIns);
     
    532532
    533533/** @interface_method_impl{PDMDEVHLPR3,pfnROMRegister} */
    534 static DECLCALLBACK(int) pdmR3DevHlp_ROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange,
     534static DECLCALLBACK(int) pdmR3DevHlp_ROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange,
    535535                                                 const void *pvBinary, uint32_t cbBinary, uint32_t fFlags, const char *pszDesc)
    536536{
     
    549549
    550550/** @interface_method_impl{PDMDEVHLPR3,pfnROMProtectShadow} */
    551 static DECLCALLBACK(int) pdmR3DevHlp_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, PGMROMPROT enmProt)
     551static DECLCALLBACK(int) pdmR3DevHlp_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, PGMROMPROT enmProt)
    552552{
    553553    PDMDEV_ASSERT_DEVINS(pDevIns);
     
    14321432
    14331433/** @interface_method_impl{PDMDEVHLPR3,pfnDriverAttach} */
    1434 static DECLCALLBACK(int) pdmR3DevHlp_DriverAttach(PPDMDEVINS pDevIns, RTUINT iLun, PPDMIBASE pBaseInterface, PPDMIBASE *ppBaseInterface, const char *pszDesc)
     1434static DECLCALLBACK(int) pdmR3DevHlp_DriverAttach(PPDMDEVINS pDevIns, uint32_t iLun, PPDMIBASE pBaseInterface, PPDMIBASE *ppBaseInterface, const char *pszDesc)
    14351435{
    14361436    PDMDEV_ASSERT_DEVINS(pDevIns);
     
    15081508
    15091509/** @interface_method_impl{PDMDEVHLPR3,pfnQueueCreate} */
    1510 static DECLCALLBACK(int) pdmR3DevHlp_QueueCreate(PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
     1510static DECLCALLBACK(int) pdmR3DevHlp_QueueCreate(PPDMDEVINS pDevIns, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
    15111511                                                 PFNPDMQUEUEDEV pfnCallback, bool fGCEnabled, const char *pszName, PPDMQUEUE *ppQueue)
    15121512{
  • trunk/src/VBox/VMM/VMMR3/PDMQueue.cpp

    r39078 r39136  
    5757 * @param   ppQueue             Where to store the queue handle.
    5858 */
    59 static int pdmR3QueueCreate(PVM pVM, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, bool fRZEnabled,
     59static int pdmR3QueueCreate(PVM pVM, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval, bool fRZEnabled,
    6060                            const char *pszName, PPDMQUEUE *ppQueue)
    6161{
     
    6565     * Validate input.
    6666     */
    67     if (cbItem < sizeof(PDMQUEUEITEMCORE))
    68     {
    69         AssertMsgFailed(("cbItem=%d\n", cbItem));
    70         return VERR_INVALID_PARAMETER;
    71     }
    72     if (cItems < 1 || cItems >= 0x10000)
    73     {
    74         AssertMsgFailed(("cItems=%d valid:[1-65535]\n", cItems));
    75         return VERR_INVALID_PARAMETER;
    76     }
     67    AssertMsgReturn(cbItem >= sizeof(PDMQUEUEITEMCORE) && cbItem < _1M, ("cbItem=%zu\n", cbItem), VERR_OUT_OF_RANGE);
     68    AssertMsgReturn(cItems >= 1 && cItems <= _64K, ("cItems=%u\n", cItems), VERR_OUT_OF_RANGE);
    7769
    7870    /*
     
    211203 * @thread  Emulation thread only.
    212204 */
    213 VMMR3DECL(int) PDMR3QueueCreateDevice(PVM pVM, PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
    214                                       PFNPDMQUEUEDEV pfnCallback, bool fRZEnabled, const char *pszName, PPDMQUEUE *ppQueue)
     205VMMR3_INT_DECL(int) PDMR3QueueCreateDevice(PVM pVM, PPDMDEVINS pDevIns, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
     206                                           PFNPDMQUEUEDEV pfnCallback, bool fRZEnabled, const char *pszName, PPDMQUEUE *ppQueue)
    215207{
    216208    LogFlow(("PDMR3QueueCreateDevice: pDevIns=%p cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p fRZEnabled=%RTbool pszName=%s\n",
     
    261253 * @thread  Emulation thread only.
    262254 */
    263 VMMR3DECL(int) PDMR3QueueCreateDriver(PVM pVM, PPDMDRVINS pDrvIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
    264                                       PFNPDMQUEUEDRV pfnCallback, const char *pszName, PPDMQUEUE *ppQueue)
     255VMMR3_INT_DECL(int) PDMR3QueueCreateDriver(PVM pVM, PPDMDRVINS pDrvIns, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
     256                                           PFNPDMQUEUEDRV pfnCallback, const char *pszName, PPDMQUEUE *ppQueue)
    265257{
    266258    LogFlow(("PDMR3QueueCreateDriver: pDrvIns=%p cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p pszName=%s\n",
     
    311303 * @thread  Emulation thread only.
    312304 */
    313 VMMR3DECL(int) PDMR3QueueCreateInternal(PVM pVM, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
    314                                         PFNPDMQUEUEINT pfnCallback, bool fRZEnabled, const char *pszName, PPDMQUEUE *ppQueue)
     305VMMR3_INT_DECL(int) PDMR3QueueCreateInternal(PVM pVM, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
     306                                             PFNPDMQUEUEINT pfnCallback, bool fRZEnabled, const char *pszName, PPDMQUEUE *ppQueue)
    315307{
    316308    LogFlow(("PDMR3QueueCreateInternal: cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p fRZEnabled=%RTbool pszName=%s\n",
     
    360352 * @thread  Emulation thread only.
    361353 */
    362 VMMR3DECL(int) PDMR3QueueCreateExternal(PVM pVM, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, PFNPDMQUEUEEXT pfnCallback, void *pvUser, const char *pszName, PPDMQUEUE *ppQueue)
     354VMMR3_INT_DECL(int) PDMR3QueueCreateExternal(PVM pVM, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
     355                                             PFNPDMQUEUEEXT pfnCallback, void *pvUser, const char *pszName, PPDMQUEUE *ppQueue)
    363356{
    364357    LogFlow(("PDMR3QueueCreateExternal: cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p pszName=%s\n", cbItem, cItems, cMilliesInterval, pfnCallback, pszName));
     
    400393 * @thread  Emulation thread only.
    401394 */
    402 VMMR3DECL(int) PDMR3QueueDestroy(PPDMQUEUE pQueue)
     395VMMR3_INT_DECL(int) PDMR3QueueDestroy(PPDMQUEUE pQueue)
    403396{
    404397    LogFlow(("PDMR3QueueDestroy: pQueue=%p\n", pQueue));
     
    503496 * @thread  Emulation thread only.
    504497 */
    505 VMMR3DECL(int) PDMR3QueueDestroyDevice(PVM pVM, PPDMDEVINS pDevIns)
     498VMMR3_INT_DECL(int) PDMR3QueueDestroyDevice(PVM pVM, PPDMDEVINS pDevIns)
    506499{
    507500    LogFlow(("PDMR3QueueDestroyDevice: pDevIns=%p\n", pDevIns));
     
    555548 * @thread  Emulation thread only.
    556549 */
    557 VMMR3DECL(int) PDMR3QueueDestroyDriver(PVM pVM, PPDMDRVINS pDrvIns)
     550VMMR3_INT_DECL(int) PDMR3QueueDestroyDriver(PVM pVM, PPDMDRVINS pDrvIns)
    558551{
    559552    LogFlow(("PDMR3QueueDestroyDriver: pDrvIns=%p\n", pDrvIns));
     
    660653 * @thread  Emulation thread only.
    661654 */
    662 VMMR3DECL(void) PDMR3QueueFlushAll(PVM pVM)
     655VMMR3_INT_DECL(void) PDMR3QueueFlushAll(PVM pVM)
    663656{
    664657    VM_ASSERT_EMT(pVM);
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