VirtualBox

Changeset 81624 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Nov 1, 2019 8:46:49 PM (5 years ago)
Author:
vboxsync
Message:

PDM,PGM: Added handled based MMIO2 interface. Made some adjustments to the PCI I/O region registrations. (Preps for VMMDev.) bugref:9218

Location:
trunk/include/VBox
Files:
6 edited

Legend:

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

    r81369 r81624  
    378378/** A NIL MMIO handle. */
    379379#define NIL_IOMMMIOHANDLE       ((uint64_t)UINT64_MAX)
     380
     381/** A cross context MMIO2 range handle. */
     382typedef uint64_t                PGMMMIO2HANDLE;
     383/** Pointer to a cross context MMIO2 handle. */
     384typedef PGMMMIO2HANDLE         *PPGMMMIO2HANDLE;
     385/** A NIL MMIO2 handle. */
     386#define NIL_PGMMMIO2HANDLE      ((uint64_t)UINT64_MAX)
    380387
    381388/** Pointer to a PDM Base Interface. */
  • trunk/include/VBox/vmm/iom.h

    r81564 r81624  
    539539#endif
    540540VMMR3_INT_DECL(int)  IOMR3MmioDeregister(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTGCPHYS cbRange);
    541 VMMR3_INT_DECL(int)  IOMR3MmioExPreRegister(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion, RTGCPHYS cbRange,
    542                                             uint32_t fFlags, const char *pszDesc,
    543                                             RTR3PTR pvUserR3,
    544                                             R3PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallbackR3,
    545                                             R3PTRTYPE(PFNIOMMMIOREAD)  pfnReadCallbackR3,
    546                                             R3PTRTYPE(PFNIOMMMIOFILL)  pfnFillCallbackR3,
    547                                             RTR0PTR pvUserR0,
    548                                             R0PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallbackR0,
    549                                             R0PTRTYPE(PFNIOMMMIOREAD)  pfnReadCallbackR0,
    550                                             R0PTRTYPE(PFNIOMMMIOFILL)  pfnFillCallbackR0,
    551                                             RTRCPTR pvUserRC,
    552                                             RCPTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallbackRC,
    553                                             RCPTRTYPE(PFNIOMMMIOREAD)  pfnReadCallbackRC,
    554                                             RCPTRTYPE(PFNIOMMMIOFILL)  pfnFillCallbackRC);
    555541VMMR3_INT_DECL(int)  IOMR3MmioExNotifyMapped(PVM pVM, void *pvUser, RTGCPHYS GCPhys);
    556542VMMR3_INT_DECL(void) IOMR3MmioExNotifyUnmapped(PVM pVM, void *pvUser, RTGCPHYS GCPhys);
  • trunk/include/VBox/vmm/pdmdev.h

    r81616 r81624  
    868868     *                          @a fFlags, UINT64_MAX if no handle is passed
    869869     *                          (old style).
    870      * @param   pfnCallback     Callback for doing the mapping. Optional if a handle
     870     * @param   pfnMapUnmap     Callback for doing the mapping. Optional if a handle
    871871     *                          is given.
    872872     * @remarks Caller enters the PDM critical section.
     
    874874    DECLR3CALLBACKMEMBER(int, pfnIORegionRegisterR3,(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion,
    875875                                                     RTGCPHYS cbRegion, PCIADDRESSSPACE enmType, uint32_t fFlags,
    876                                                      uint64_t hHandle, PFNPCIIOREGIONMAP pfnCallback));
     876                                                     uint64_t hHandle, PFNPCIIOREGIONMAP pfnMapUnmap));
    877877
    878878    /**
     
    22472247/** Handle type mask.  */
    22482248#define PDMPCIDEV_IORGN_F_HANDLE_MASK       UINT32_C(0x00000003)
     2249/** New-style (mostly wrt callbacks).  */
     2250#define PDMPCIDEV_IORGN_F_NEW_STYLE         UINT32_C(0x00000004)
    22492251/** Mask of valid flags.   */
    2250 #define PDMPCIDEV_IORGN_F_VALID_MASK        UINT32_C(0x00000003)
     2252#define PDMPCIDEV_IORGN_F_VALID_MASK        UINT32_C(0x00000007)
    22512253/** @} */
    22522254
     
    22762278
    22772279/** Current PDMDEVHLPR3 version number. */
    2278 #define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 30, 0)
     2280#define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 31, 0)
    22792281
    22802282/**
     
    22862288    uint32_t                        u32Version;
    22872289
     2290    /** @name I/O ports
     2291     * @{ */
    22882292    /**
    22892293     * Creates a range of I/O ports for a device.
     
    23582362     */
    23592363    DECLR3CALLBACKMEMBER(uint32_t, pfnIoPortGetMappingAddress,(PPDMDEVINS pDevIns, IOMIOPORTHANDLE hIoPorts));
     2364    /** @}  */
    23602365
    23612366    /**
     
    24472452    DECLR3CALLBACKMEMBER(int, pfnIOPortDeregister,(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts));
    24482453
     2454    /** @name MMIO
     2455     * @{ */
    24492456    /**
    24502457     * Creates a memory mapped I/O (MMIO) region for a device.
     
    24832490
    24842491    /**
    2485      * Maps a memory mapped I/O (MMIO) region.
     2492     * Maps a memory mapped I/O (MMIO) region (into the guest physical address space).
    24862493     *
    24872494     * @returns VBox status.
     
    24892496     * @param   hRegion     The MMIO region handle.
    24902497     * @param   GCPhys       Where to map the region.
     2498     * @note    An MMIO range may overlap with base memory if a lot of RAM is
     2499     *          configured for the VM, in  which case we'll drop the base memory
     2500     *          pages.  Presently we will make no attempt to preserve anything that
     2501     *          happens to be present in the base memory that is replaced, this is
     2502     *          technically incorrect but it's just not worth the effort to do
     2503     *          right, at least not at this point.
    24912504     * @sa      PDMDevHlpMmioUnmap, PDMDevHlpMmioCreate, PDMDevHlpMmioCreateEx,
    24922505     *          PDMDevHlpMmioSetUpContext
     
    24952508
    24962509    /**
    2497      * Maps a memory mapped I/O (MMIO) region.
     2510     * Unmaps a memory mapped I/O (MMIO) region.
    24982511     *
    24992512     * @returns VBox status.
     
    25312544     */
    25322545    DECLR3CALLBACKMEMBER(RTGCPHYS, pfnMmioGetMappingAddress,(PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion));
     2546    /** @} */
    25332547
    25342548    /**
     
    26142628    DECLR3CALLBACKMEMBER(int, pfnMMIODeregister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTGCPHYS cbRange));
    26152629
     2630    /** @name MMIO2
     2631     * @{ */
     2632    /**
     2633     * Creates a MMIO2 region.
     2634     *
     2635     * As mentioned elsewhere, MMIO2 is just RAM spelled differently.  It's RAM
     2636     * associated with a device.  It is also non-shared memory with a permanent
     2637     * ring-3 mapping and page backing (presently).
     2638     *
     2639     * @returns VBox status.
     2640     * @param   pDevIns             The device instance.
     2641     * @param   pPciDev             The PCI device the region is associated with, or
     2642     *                              NULL if no PCI device association.
     2643     * @param   iPciRegion          The region number. Use the PCI region number as
     2644     *                              this must be known to the PCI bus device too. If
     2645     *                              it's not associated with the PCI device, then
     2646     *                              any number up to UINT8_MAX is fine.
     2647     * @param   cb                  The size (in bytes) of the region.
     2648     * @param   fFlags              Reserved for future use, must be zero.
     2649     * @param   ppvMapping          Where to store the address of the ring-3 mapping
     2650     *                              of the memory.
     2651     * @param   pszDesc             Pointer to description string. This must not be
     2652     *                              freed.
     2653     * @param   phRegion            Where to return the MMIO2 region handle.
     2654     *
     2655     * @thread  EMT(0)
     2656     */
     2657    DECLR3CALLBACKMEMBER(int, pfnMmio2Create,(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iPciRegion, RTGCPHYS cbRegion,
     2658                                              uint32_t fFlags, const char *pszDesc, void **ppvMapping, PPGMMMIO2HANDLE phRegion));
     2659
     2660    /**
     2661     * Destroys a MMIO2 region, unmapping it and freeing the memory.
     2662     *
     2663     * Any physical access handlers registered for the region must be deregistered
     2664     * before calling this function.
     2665     *
     2666     * @returns VBox status code.
     2667     * @param   pDevIns             The device instance.
     2668     * @param   hRegion             The MMIO2 region handle.
     2669     * @thread  EMT.
     2670     */
     2671    DECLR3CALLBACKMEMBER(int, pfnMmio2Destroy,(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion));
     2672
     2673    /**
     2674     * Maps a MMIO2 region (into the guest physical address space).
     2675     *
     2676     * @returns VBox status.
     2677     * @param   pDevIns     The device instance the region is associated with.
     2678     * @param   hRegion     The MMIO2 region handle.
     2679     * @param   GCPhys       Where to map the region.
     2680     * @note    A MMIO2 region overlap with base memory if a lot of RAM is
     2681     *          configured for the VM, in  which case we'll drop the base memory
     2682     *          pages.  Presently we will make no attempt to preserve anything that
     2683     *          happens to be present in the base memory that is replaced, this is
     2684     *          technically incorrect but it's just not worth the effort to do
     2685     *          right, at least not at this point.
     2686     * @sa      PDMDevHlpMmio2Unmap, PDMDevHlpMmio2Create, PDMDevHlpMmio2SetUpContext
     2687     */
     2688    DECLR3CALLBACKMEMBER(int, pfnMmio2Map,(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion, RTGCPHYS GCPhys));
     2689
     2690    /**
     2691     * Unmaps a MMIO2 region.
     2692     *
     2693     * @returns VBox status.
     2694     * @param   pDevIns     The device instance the region is associated with.
     2695     * @param   hRegion     The MMIO2 region handle.
     2696     * @sa      PDMDevHlpMmio2Map, PDMDevHlpMmio2Create, PDMDevHlpMmio2SetUpContext
     2697     */
     2698    DECLR3CALLBACKMEMBER(int, pfnMmio2Unmap,(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion));
     2699
     2700    /**
     2701     * Reduces the length of a MMIO range.
     2702     *
     2703     * This is for implementations of PDMPCIDEV::pfnRegionLoadChangeHookR3 and will
     2704     * only work during saved state restore.  It will not call the PCI bus code, as
     2705     * that is expected to restore the saved resource configuration.
     2706     *
     2707     * It just adjusts the mapping length of the region so that when pfnMmioMap is
     2708     * called it will only map @a cbRegion bytes and not the value set during
     2709     * registration.
     2710     *
     2711     * @return VBox status code.
     2712     * @param   pDevIns     The device owning the range.
     2713     * @param   hRegion     The MMIO2 region handle.
     2714     * @param   cbRegion    The new size, must be smaller.
     2715     */
     2716    DECLR3CALLBACKMEMBER(int, pfnMmio2Reduce,(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion, RTGCPHYS cbRegion));
     2717
     2718    /**
     2719     * Gets the mapping address of the MMIO region @a hRegion.
     2720     *
     2721     * @returns Mapping address, NIL_RTGCPHYS if not mapped (or invalid parameters).
     2722     * @param   pDevIns     The device instance to register the ports with.
     2723     * @param   hRegion     The MMIO2 region handle.
     2724     */
     2725    DECLR3CALLBACKMEMBER(RTGCPHYS, pfnMmio2GetMappingAddress,(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion));
     2726
     2727    /**
     2728     * Changes the number of an MMIO2 or pre-registered MMIO region.
     2729     *
     2730     * This should only be used to deal with saved state problems, so there is no
     2731     * convenience inline wrapper for this method.
     2732     *
     2733     * @returns VBox status code.
     2734     * @param   pDevIns     The device instance.
     2735     * @param   hRegion     The MMIO2 region handle.
     2736     * @param   iNewRegion  The new region index.
     2737     *
     2738     * @sa      @bugref{9359}
     2739     */
     2740    DECLR3CALLBACKMEMBER(int, pfnMmio2ChangeRegionNo,(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion, uint32_t iNewRegion));
     2741    /** @} */
     2742
    26162743    /**
    26172744     * Allocate and register a MMIO2 region.
     
    26362763     *                              freed.
    26372764     * @thread  EMT.
     2765     * @deprecated
    26382766     */
    26392767    DECLR3CALLBACKMEMBER(int, pfnMMIO2Register,(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion, RTGCPHYS cb,
    26402768                                                uint32_t fFlags, void **ppv, const char *pszDesc));
    2641 
    2642     /**
    2643      * Pre-register a Memory Mapped I/O (MMIO) region.
    2644      *
    2645      * This API must be used for large PCI MMIO regions, as it handles these much
    2646      * more efficiently and with greater flexibility when it comes to heap usage.
    2647      * It is only available during device construction.
    2648      *
    2649      * To map and unmap the pre-registered region into and our of guest address
    2650      * space, use the PDMDevHlpMMIOExMap and PDMDevHlpMMIOExUnmap helpers.
    2651      *
    2652      * You may call PDMDevHlpMMIOExDeregister from the destructor to free the region
    2653      * for reasons of symmetry, but it will be automatically deregistered by PDM
    2654      * once the destructor returns.
    2655      *
    2656      * @returns VBox status.
    2657      * @param   pDevIns             The device instance to register the MMIO with.
    2658      * @param   pPciDev             The PCI device to associate the region with, use
    2659      *                              NULL to not associate it with any device.
    2660      * @param   iRegion             The PCI region number.  When @a pPciDev is NULL,
    2661      *                              this is a unique number between 0 and UINT8_MAX.
    2662      * @param   cbRegion            The size of the range (in bytes).
    2663      * @param   fFlags              Flags, IOMMMIO_FLAGS_XXX.
    2664      * @param   pszDesc             Pointer to description string. This must not be freed.
    2665      * @param   pvUser              Ring-3 user argument.
    2666      * @param   pfnWrite            Pointer to function which is gonna handle Write operations.
    2667      * @param   pfnRead             Pointer to function which is gonna handle Read operations.
    2668      * @param   pfnFill             Pointer to function which is gonna handle Fill/memset operations. (optional)
    2669      * @param   pvUserR0            Ring-0 user argument. Optional.
    2670      * @param   pszWriteR0          The name of the ring-0 write handler method. Optional.
    2671      * @param   pszReadR0           The name of the ring-0 read handler method. Optional.
    2672      * @param   pszFillR0           The name of the ring-0 fill/memset handler method. Optional.
    2673      * @param   pvUserRC            Raw-mode context user argument. Optional.  If
    2674      *                              unsigned value is 0x10000 or higher, it will be
    2675      *                              automatically relocated with the hypervisor
    2676      *                              guest mapping.
    2677      * @param   pszWriteRC          The name of the raw-mode context write handler method. Optional.
    2678      * @param   pszReadRC           The name of the raw-mode context read handler method. Optional.
    2679      * @param   pszFillRC           The name of the raw-mode context fill/memset handler method. Optional.
    2680      * @thread  EMT
    2681      *
    2682      * @remarks Caller enters the device critical section prior to invoking the
    2683      *          registered callback methods.
    2684      * @sa      PDMDevHlpMMIOExMap, PDMDevHlpMMIOExUnmap, PDMDevHlpMMIOExDeregister,
    2685      *          PDMDevHlpMMIORegisterEx
    2686      * @deprecated
    2687      */
    2688     DECLR3CALLBACKMEMBER(int, pfnMMIOExPreRegister,(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion, RTGCPHYS cbRegion,
    2689                                                     uint32_t fFlags, const char *pszDesc, RTHCPTR pvUser,
    2690                                                     PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, PFNIOMMMIOFILL pfnFill,
    2691                                                     RTR0PTR pvUserR0, const char *pszWriteR0, const char *pszReadR0, const char *pszFillR0,
    2692                                                     RTRCPTR pvUserRC, const char *pszWriteRC, const char *pszReadRC, const char *pszFillRC));
    26932769
    26942770    /**
     
    27042780     * @param   iRegion             The region number used during registration.
    27052781     * @thread  EMT.
    2706      * @deprecated for MMIO
     2782     * @deprecated
    27072783     */
    27082784    DECLR3CALLBACKMEMBER(int, pfnMMIOExDeregister,(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion));
     
    35023578     *                              @a fFlags, UINT64_MAX if no handle is passed
    35033579     *                              (old style).
    3504      * @param   pfnCallback         Callback for doing the mapping, optional when a
     3580     * @param   pfnMapUnmap         Callback for doing the mapping, optional when a
    35053581     *                              handle is specified.  The callback will be
    35063582     *                              invoked holding only the PDM lock.  The device
     
    35093585    DECLR3CALLBACKMEMBER(int, pfnPCIIORegionRegister,(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion,
    35103586                                                      RTGCPHYS cbRegion, PCIADDRESSSPACE enmType, uint32_t fFlags,
    3511                                                       uint64_t hHandle, PFNPCIIOREGIONMAP pfnCallback));
     3587                                                      uint64_t hHandle, PFNPCIIOREGIONMAP pfnMapUnmap));
    35123588
    35133589    /**
     
    45134589    uint32_t                        u32TheEnd;
    45144590} PDMDEVHLPR3;
    4515 #endif /* !IN_RING3 */
     4591#endif /* !IN_RING3 || DOXYGEN_RUNNING */
    45164592/** Pointer to the R3 PDM Device API. */
    45174593typedef R3PTRTYPE(struct PDMDEVHLPR3 *) PPDMDEVHLPR3;
     
    45834659    DECLRCCALLBACKMEMBER(int, pfnMmioSetUpContextEx,(PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion, PFNIOMMMIONEWWRITE pfnWrite,
    45844660                                                     PFNIOMMMIONEWREAD pfnRead, PFNIOMMMIONEWFILL pfnFill, void *pvUser));
     4661
     4662    /**
     4663     * Sets up a raw-mode mapping for an MMIO2 region.
     4664     *
     4665     * The region must have been created in ring-3 first using
     4666     * PDMDevHlpMmio2Create().
     4667     *
     4668     * @returns VBox status.
     4669     * @param   pDevIns     The device instance to register the ports with.
     4670     * @param   hRegion     The MMIO2 region handle.
     4671     * @param   offSub      Start of what to map into raw-mode.  Must be page aligned.
     4672     * @param   cbSub       Number of bytes to map into raw-mode.  Must be page
     4673     *                      aligned.  Zero is an alias for everything.
     4674     * @param   ppvMapping  Where to return the mapping corresponding to @a offSub.
     4675     * @thread  EMT(0)
     4676     * @note    Only available at VM creation time.
     4677     *
     4678     * @sa      PDMDevHlpMmio2Create().
     4679     */
     4680    DECLRCCALLBACKMEMBER(int, pfnMmio2SetUpContext,(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion,
     4681                                                    size_t offSub, size_t cbSub, void **ppvMapping));
    45854682
    45864683    /**
     
    48734970
    48744971/** Current PDMDEVHLP version number. */
    4875 #define PDM_DEVHLPRC_VERSION                    PDM_VERSION_MAKE(0xffe6, 8, 0)
     4972#define PDM_DEVHLPRC_VERSION                    PDM_VERSION_MAKE(0xffe6, 9, 0)
    48764973
    48774974
     
    48874984     * Sets up ring-0 callback handlers for an I/O port range.
    48884985     *
    4889      * The range must have been registered in ring-3 first using
     4986     * The range must have been created in ring-3 first using
    48904987     * PDMDevHlpIoPortCreate() or PDMDevHlpIoPortCreateEx().
    48914988     *
     
    49065003     *          registered callback methods.
    49075004     *
    4908      * @sa      PDMDevHlpIoPortCreate, PDMDevHlpIoPortCreateEx, PDMDevHlpIoPortMap,
    4909      *          PDMDevHlpIoPortUnmap.
     5005     * @sa      PDMDevHlpIoPortCreate(), PDMDevHlpIoPortCreateEx(),
     5006     *          PDMDevHlpIoPortMap(), PDMDevHlpIoPortUnmap().
    49105007     */
    49115008    DECLR0CALLBACKMEMBER(int, pfnIoPortSetUpContextEx,(PPDMDEVINS pDevIns, IOMIOPORTHANDLE hIoPorts,
     
    49175014     * Sets up ring-0 callback handlers for an MMIO region.
    49185015     *
    4919      * The region must have been registered in ring-3 first using
    4920      * PDMDevHlpMmioCreate() or PDMDevHlpMmioCreateEx().
     5016     * The region must have been created in ring-3 first using
     5017     * PDMDevHlpMmioCreate(), PDMDevHlpMmioCreateEx(), PDMDevHlpMmioCreateAndMap(),
     5018     * PDMDevHlpMmioCreateExAndMap() or PDMDevHlpPCIIORegionCreateMmio().
    49215019     *
    49225020     * @returns VBox status.
     
    49345032     *          registered callback methods.
    49355033     *
    4936      * @sa      PDMDevHlpMmioCreate, PDMDevHlpMmioCreateEx, PDMDevHlpMmioMap,
    4937      *          PDMDevHlpMmioUnmap.
     5034     * @sa      PDMDevHlpMmioCreate(), PDMDevHlpMmioCreateEx(), PDMDevHlpMmioMap(),
     5035     *          PDMDevHlpMmioUnmap().
    49385036     */
    49395037    DECLR0CALLBACKMEMBER(int, pfnMmioSetUpContextEx,(PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion, PFNIOMMMIONEWWRITE pfnWrite,
    49405038                                                     PFNIOMMMIONEWREAD pfnRead, PFNIOMMMIONEWFILL pfnFill, void *pvUser));
     5039
     5040    /**
     5041     * Sets up a ring-0 mapping for an MMIO2 region.
     5042     *
     5043     * The region must have been created in ring-3 first using
     5044     * PDMDevHlpMmio2Create().
     5045     *
     5046     * @returns VBox status.
     5047     * @param   pDevIns     The device instance to register the ports with.
     5048     * @param   hRegion     The MMIO2 region handle.
     5049     * @param   offSub      Start of what to map into ring-0.  Must be page aligned.
     5050     * @param   cbSub       Number of bytes to map into ring-0.  Must be page
     5051     *                      aligned.  Zero is an alias for everything.
     5052     * @param   ppvMapping  Where to return the mapping corresponding to @a offSub.
     5053     *
     5054     * @thread  EMT(0)
     5055     * @note    Only available at VM creation time.
     5056     *
     5057     * @sa      PDMDevHlpMmio2Create().
     5058     */
     5059    DECLR0CALLBACKMEMBER(int, pfnMmio2SetUpContext,(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion, size_t offSub, size_t cbSub,
     5060                                                    void **ppvMapping));
    49415061
    49425062    /**
     
    53145434
    53155435/** Current PDMDEVHLP version number. */
    5316 #define PDM_DEVHLPR0_VERSION                    PDM_VERSION_MAKE(0xffe5, 10, 0)
     5436#define PDM_DEVHLPR0_VERSION                    PDM_VERSION_MAKE(0xffe5, 11, 0)
    53175437
    53185438
     
    58675987
    58685988#endif /* IN_RING3 */
    5869 #ifndef IN_RING3
     5989#if !defined(IN_RING3) || defined(DOXYGEN_RUNNING)
    58705990
    58715991/**
     
    58886008}
    58896009
    5890 #endif /* !IN_RING3 */
     6010#endif /* !IN_RING3 || DOXYGEN_RUNNING */
    58916011#ifdef IN_RING3
    5892 
    58936012
    58946013/**
     
    59196038 */
    59206039DECLINLINE(int) PDMDevHlpMmioCreateAndMap(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTGCPHYS cbRegion,
    5921                                           PPDMPCIDEV pPciDev, uint32_t iPciRegion, PFNIOMMMIONEWWRITE pfnWrite,
    5922                                           PFNIOMMMIONEWREAD pfnRead, void *pvUser, const char *pszDesc, PIOMMMIOHANDLE phRegion)
    5923 {
    5924     int rc = pDevIns->pHlpR3->pfnMmioCreateEx(pDevIns, cbRegion, 0, pPciDev, iPciRegion,
    5925                                               pfnWrite, pfnRead, NULL, pvUser, pszDesc, phRegion);
     6040                                          PFNIOMMMIONEWWRITE pfnWrite, PFNIOMMMIONEWREAD pfnRead,
     6041                                          uint32_t fFlags, const char *pszDesc, PIOMMMIOHANDLE phRegion)
     6042{
     6043    int rc = pDevIns->pHlpR3->pfnMmioCreateEx(pDevIns, cbRegion, fFlags, NULL /*pPciDev*/, UINT32_MAX /*iPciRegion*/,
     6044                                              pfnWrite, pfnRead, NULL /*pfnFill*/, NULL /*pvUser*/, pszDesc, phRegion);
    59266045    if (RT_SUCCESS(rc))
    59276046        rc = pDevIns->pHlpR3->pfnMmioMap(pDevIns, *phRegion, GCPhys);
     
    59776096
    59786097#endif /* IN_RING3 */
    5979 #ifndef IN_RING3
     6098#if !defined(IN_RING3) || defined(DOXYGEN_RUNNING)
    59806099
    59816100/**
     
    59976116}
    59986117
    5999 #endif /* !IN_RING3 */
     6118#endif /* !IN_RING3 || DOXYGEN_RUNNING */
    60006119#ifdef IN_RING3
    60016120
     
    61066225
    61076226/**
     6227 * @copydoc PDMDEVHLPR3::pfnMmio2Create
     6228 */
     6229DECLINLINE(int) PDMDevHlpMmio2Create(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iPciRegion, RTGCPHYS cbRegion,
     6230                                     uint32_t fFlags, const char *pszDesc, void **ppvMapping, PPGMMMIO2HANDLE phRegion)
     6231{
     6232    return pDevIns->pHlpR3->pfnMmio2Create(pDevIns, pPciDev, iPciRegion, cbRegion, fFlags, pszDesc, ppvMapping, phRegion);
     6233}
     6234
     6235/**
     6236 * @copydoc PDMDEVHLPR3::pfnMmio2Map
     6237 */
     6238DECLINLINE(int) PDMDevHlpMmio2Map(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion, RTGCPHYS GCPhys)
     6239{
     6240    return pDevIns->pHlpR3->pfnMmio2Map(pDevIns, hRegion, GCPhys);
     6241}
     6242
     6243/**
     6244 * @copydoc PDMDEVHLPR3::pfnMmio2Unmap
     6245 */
     6246DECLINLINE(int) PDMDevHlpMmio2Unmap(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion)
     6247{
     6248    return pDevIns->pHlpR3->pfnMmio2Unmap(pDevIns, hRegion);
     6249}
     6250
     6251/**
     6252 * @copydoc PDMDEVHLPR3::pfnMmio2Reduce
     6253 */
     6254DECLINLINE(int) PDMDevHlpMmio2Reduce(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion, RTGCPHYS cbRegion)
     6255{
     6256    return pDevIns->pHlpR3->pfnMmio2Reduce(pDevIns, hRegion, cbRegion);
     6257}
     6258
     6259/**
     6260 * @copydoc PDMDEVHLPR3::pfnMmio2GetMappingAddress
     6261 */
     6262DECLINLINE(RTGCPHYS) PDMDevHlpMmio2GetMappingAddress(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion)
     6263{
     6264    return pDevIns->pHlpR3->pfnMmio2GetMappingAddress(pDevIns, hRegion);
     6265}
     6266
     6267#endif /* IN_RING3 */
     6268#if !defined(IN_RING3) || defined(DOXYGEN_RUNNING)
     6269
     6270/**
     6271 * @copydoc PDMDEVHLPR0::pfnMmio2SetUpContext
     6272 */
     6273DECLINLINE(int) PDMDevHlpMmio2SetUpContext(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion,
     6274                                           size_t offSub, size_t cbSub, void **ppvMapping)
     6275{
     6276    return pDevIns->CTX_SUFF(pHlp)->pfnMmio2SetUpContext(pDevIns, hRegion, offSub, cbSub, ppvMapping);
     6277}
     6278
     6279#endif /* !IN_RING3 || DOXYGEN_RUNNING */
     6280#ifdef IN_RING3
     6281
     6282/**
    61086283 * @copydoc PDMDEVHLPR3::pfnMMIO2Register
    61096284 */
     
    61126287{
    61136288    return pDevIns->pHlpR3->pfnMMIO2Register(pDevIns, pPciDev, iRegion, cb, fFlags, ppv, pszDesc);
    6114 }
    6115 
    6116 /**
    6117  * @copydoc PDMDEVHLPR3::pfnMMIOExPreRegister
    6118  */
    6119 DECLINLINE(int) PDMDevHlpMMIOExPreRegister(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion, RTGCPHYS cbRegion,
    6120                                            uint32_t fFlags, const char *pszDesc, RTHCPTR pvUser,
    6121                                            PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, PFNIOMMMIOFILL pfnFill,
    6122                                            RTR0PTR pvUserR0, const char *pszWriteR0, const char *pszReadR0, const char *pszFillR0,
    6123                                            RTRCPTR pvUserRC, const char *pszWriteRC, const char *pszReadRC, const char *pszFillRC)
    6124 {
    6125     return pDevIns->pHlpR3->pfnMMIOExPreRegister(pDevIns, pPciDev, iRegion, cbRegion, fFlags, pszDesc,
    6126                                                  pvUser, pfnWrite, pfnRead, pfnFill,
    6127                                                  pvUserR0, pszWriteR0, pszReadR0, pszFillR0,
    6128                                                  pvUserRC, pszWriteRC, pszReadRC, pszFillRC);
    61296289}
    61306290
     
    67686928 * @param   cbRegion            Size of the region.
    67696929 * @param   enmType             PCI_ADDRESS_SPACE_MEM, PCI_ADDRESS_SPACE_IO or PCI_ADDRESS_SPACE_MEM_PREFETCH.
    6770  * @param   pfnCallback         Callback for doing the mapping.
     6930 * @param   pfnMapUnmap         Callback for doing the mapping.
    67716931 * @remarks The callback will be invoked holding the PDM lock. The device lock
    67726932 *          is NOT take because that is very likely be a lock order violation.
     6933 * @remarks Old callback style, won't get unmap calls.
    67736934 */
    67746935DECLINLINE(int) PDMDevHlpPCIIORegionRegister(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cbRegion,
    6775                                              PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback)
     6936                                             PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnMapUnmap)
    67766937{
    67776938    return pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, NULL, iRegion, cbRegion, enmType,
    6778                                                    PDMPCIDEV_IORGN_F_NO_HANDLE, UINT64_MAX, pfnCallback);
     6939                                                   PDMPCIDEV_IORGN_F_NO_HANDLE, UINT64_MAX, pfnMapUnmap);
    67796940}
    67806941
    67816942/**
    67826943 * @sa PDMDEVHLPR3::pfnPCIIORegionRegister
     6944 * @remarks Old callback style, won't get unmap calls.
    67836945 */
    67846946DECLINLINE(int) PDMDevHlpPCIIORegionRegisterEx(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion, RTGCPHYS cbRegion,
    6785                                                PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback)
     6947                                               PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnMapUnmap)
    67866948{
    67876949    return pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, pPciDev, iRegion, cbRegion, enmType,
    6788                                                    PDMPCIDEV_IORGN_F_NO_HANDLE, UINT64_MAX, pfnCallback);
     6950                                                   PDMPCIDEV_IORGN_F_NO_HANDLE, UINT64_MAX, pfnMapUnmap);
    67896951}
    67906952
     
    67976959 * @param   cbRegion        Size of the region.
    67986960 * @param   hIoPorts        Handle to the I/O port region.
    6799  * @param   pfnCallback     Callback for doing the mapping, optional.  The
     6961 */
     6962DECLINLINE(int) PDMDevHlpPCIIORegionRegisterIo(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cbRegion, IOMIOPORTHANDLE hIoPorts)
     6963{
     6964    return pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, NULL, iRegion, cbRegion, PCI_ADDRESS_SPACE_IO,
     6965                                                   PDMPCIDEV_IORGN_F_IOPORT_HANDLE | PDMPCIDEV_IORGN_F_NEW_STYLE, hIoPorts, NULL);
     6966}
     6967
     6968/**
     6969 * Registers a I/O port region for the default PCI device, custom map/unmap.
     6970 *
     6971 * @returns VBox status code.
     6972 * @param   pDevIns         The device instance.
     6973 * @param   iRegion         The region number.
     6974 * @param   cbRegion        Size of the region.
     6975 * @param   hIoPorts        Handle to the I/O port region.
     6976 * @param   pfnMapUnmap     Callback for doing the mapping, optional.  The
    68006977 *                          callback will be invoked holding only the PDM lock.
    68016978 *                          The device lock will _not_ be taken (due to lock
    68026979 *                          order).
    68036980 */
    6804 DECLINLINE(int) PDMDevHlpPCIIORegionRegisterIo(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cbRegion,
    6805                                                IOMIOPORTHANDLE hIoPorts, PFNPCIIOREGIONMAP pfnCallback)
     6981DECLINLINE(int) PDMDevHlpPCIIORegionRegisterIoCustom(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cbRegion,
     6982                                                     PFNPCIIOREGIONMAP pfnMapUnmap)
    68066983{
    68076984    return pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, NULL, iRegion, cbRegion, PCI_ADDRESS_SPACE_IO,
    6808                                                    PDMPCIDEV_IORGN_F_IOPORT_HANDLE, hIoPorts, pfnCallback);
    6809 }
    6810 
     6985                                                   PDMPCIDEV_IORGN_F_NO_HANDLE | PDMPCIDEV_IORGN_F_NEW_STYLE,
     6986                                                   UINT64_MAX, pfnMapUnmap);
     6987}
    68116988
    68126989/**
     
    68387015    if (RT_SUCCESS(rc))
    68397016        rc = pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, pDevIns->apPciDevs[0], iPciRegion, cbPorts, PCI_ADDRESS_SPACE_IO,
    6840                                                      PDMPCIDEV_IORGN_F_IOPORT_HANDLE, *phIoPorts, NULL /*pfnCallback*/);
     7017                                                     PDMPCIDEV_IORGN_F_IOPORT_HANDLE | PDMPCIDEV_IORGN_F_NEW_STYLE,
     7018                                                     *phIoPorts, NULL /*pfnMapUnmap*/);
    68417019    return rc;
    68427020}
    6843 
    68447021
    68457022/**
     
    68547031 *                          PCI_ADDRESS_SPACE_BAR64 or PCI_ADDRESS_SPACE_BAR32.
    68557032 * @param   hMmioRegion     Handle to the MMIO region.
    6856  * @param   pfnCallback     Callback for doing the mapping, optional.  The
     7033 * @param   pfnMapUnmap     Callback for doing the mapping, optional.  The
    68577034 *                          callback will be invoked holding only the PDM lock.
    68587035 *                          The device lock will _not_ be taken (due to lock
     
    68607037 */
    68617038DECLINLINE(int) PDMDevHlpPCIIORegionRegisterMmio(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cbRegion, PCIADDRESSSPACE enmType,
    6862                                                  IOMMMIOHANDLE hMmioRegion, PFNPCIIOREGIONMAP pfnCallback)
     7039                                                 IOMMMIOHANDLE hMmioRegion, PFNPCIIOREGIONMAP pfnMapUnmap)
    68637040{
    68647041    return pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, NULL, iRegion, cbRegion, enmType,
    6865                                                    PDMPCIDEV_IORGN_F_MMIO_HANDLE, hMmioRegion, pfnCallback);
     7042                                                   PDMPCIDEV_IORGN_F_MMIO_HANDLE | PDMPCIDEV_IORGN_F_NEW_STYLE,
     7043                                                   hMmioRegion, pfnMapUnmap);
    68667044}
    68677045
     
    68787056 *                          PCI_ADDRESS_SPACE_BAR64 or PCI_ADDRESS_SPACE_BAR32.
    68797057 * @param   hMmioRegion     Handle to the MMIO region.
    6880  * @param   pfnCallback     Callback for doing the mapping, optional.  The
     7058 * @param   pfnMapUnmap     Callback for doing the mapping, optional.  The
    68817059 *                          callback will be invoked holding only the PDM lock.
    68827060 *                          The device lock will _not_ be taken (due to lock
     
    68857063DECLINLINE(int) PDMDevHlpPCIIORegionRegisterMmioEx(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion,
    68867064                                                   RTGCPHYS cbRegion, PCIADDRESSSPACE enmType, IOMMMIOHANDLE hMmioRegion,
    6887                                                    PFNPCIIOREGIONMAP pfnCallback)
     7065                                                   PFNPCIIOREGIONMAP pfnMapUnmap)
    68887066{
    68897067    return pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, pPciDev, iRegion, cbRegion, enmType,
    6890                                                    PDMPCIDEV_IORGN_F_MMIO_HANDLE, hMmioRegion, pfnCallback);
     7068                                                   PDMPCIDEV_IORGN_F_MMIO_HANDLE | PDMPCIDEV_IORGN_F_NEW_STYLE,
     7069                                                   hMmioRegion, pfnMapUnmap);
    68917070}
    68927071
     
    69217100    if (RT_SUCCESS(rc))
    69227101        rc = pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, pDevIns->apPciDevs[0], iPciRegion, cbRegion, enmType,
    6923                                                      PDMPCIDEV_IORGN_F_MMIO_HANDLE, *phRegion, NULL /*pfnCallback*/);
     7102                                                     PDMPCIDEV_IORGN_F_MMIO_HANDLE | PDMPCIDEV_IORGN_F_NEW_STYLE,
     7103                                                     *phRegion, NULL /*pfnMapUnmap*/);
    69247104    return rc;
    69257105}
    69267106
     7107
     7108/**
     7109 * Registers an MMIO2 region for the default PCI device.
     7110 *
     7111 * @returns VBox status code.
     7112 * @param   pDevIns         The device instance.
     7113 * @param   iRegion         The region number.
     7114 * @param   cbRegion        Size of the region.
     7115 * @param   enmType         PCI_ADDRESS_SPACE_MEM or
     7116 *                          PCI_ADDRESS_SPACE_MEM_PREFETCH, optionally or-ing in
     7117 *                          PCI_ADDRESS_SPACE_BAR64 or PCI_ADDRESS_SPACE_BAR32.
     7118 * @param   hMmio2Region    Handle to the MMIO2 region.
     7119 */
     7120DECLINLINE(int) PDMDevHlpPCIIORegionRegisterMmio2(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cbRegion,
     7121                                                  PCIADDRESSSPACE enmType, PGMMMIO2HANDLE hMmio2Region)
     7122{
     7123    return pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, NULL, iRegion, cbRegion, enmType,
     7124                                                   PDMPCIDEV_IORGN_F_MMIO2_HANDLE | PDMPCIDEV_IORGN_F_NEW_STYLE,
     7125                                                   hMmio2Region, NULL);
     7126}
     7127
     7128/**
     7129 * Combines PDMDevHlpMmio2Create and PDMDevHlpPCIIORegionRegisterMmio2, creating
     7130 * and registering an MMIO2 region for the default PCI device, extended edition.
     7131 *
     7132 * @returns VBox status code.
     7133 * @param   pDevIns         The device instance to register the ports with.
     7134 * @param   cbRegion        The size of the region in bytes.
     7135 * @param   iPciRegion      The PCI device region.
     7136 * @param   enmType         PCI_ADDRESS_SPACE_MEM or
     7137 *                          PCI_ADDRESS_SPACE_MEM_PREFETCH, optionally or-ing in
     7138 *                          PCI_ADDRESS_SPACE_BAR64 or PCI_ADDRESS_SPACE_BAR32.
     7139 * @param   pszDesc         Pointer to description string. This must not be freed.
     7140 * @param   ppvMapping      Where to store the address of the ring-3 mapping of
     7141 *                          the memory.
     7142 * @param   phRegion        Where to return the MMIO2 region handle.
     7143 *
     7144 */
     7145DECLINLINE(int) PDMDevHlpPCIIORegionCreateMmio2(PPDMDEVINS pDevIns, uint32_t iPciRegion, RTGCPHYS cbRegion,
     7146                                                PCIADDRESSSPACE enmType, const char *pszDesc,
     7147                                                void **ppvMapping, PPGMMMIO2HANDLE phRegion)
     7148
     7149{
     7150    int rc = pDevIns->pHlpR3->pfnMmio2Create(pDevIns, pDevIns->apPciDevs[0], iPciRegion << 16, cbRegion, 0 /*fFlags*/,
     7151                                             pszDesc, ppvMapping, phRegion);
     7152    if (RT_SUCCESS(rc))
     7153        rc = pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, pDevIns->apPciDevs[0], iPciRegion, cbRegion, enmType,
     7154                                                     PDMPCIDEV_IORGN_F_MMIO2_HANDLE, *phRegion, NULL /*pfnCallback*/);
     7155    return rc;
     7156}
     7157
     7158/**
     7159 * Combines PDMDevHlpMmio2Create and PDMDevHlpPCIIORegionRegisterMmio2, creating
     7160 * and registering an MMIO2 region for the default PCI device.
     7161 *
     7162 * @returns VBox status code.
     7163 * @param   pDevIns         The device instance to register the ports with.
     7164 * @param   cbRegion        The size of the region in bytes.
     7165 * @param   iPciRegion      The PCI device region.
     7166 * @param   enmType         PCI_ADDRESS_SPACE_MEM or
     7167 *                          PCI_ADDRESS_SPACE_MEM_PREFETCH, optionally or-ing in
     7168 *                          PCI_ADDRESS_SPACE_BAR64 or PCI_ADDRESS_SPACE_BAR32.
     7169 * @param   fMmio2Flags     To be defined, must be zero.
     7170 * @param   pfnMapUnmap     Callback for doing the mapping, optional.  The
     7171 *                          callback will be invoked holding only the PDM lock.
     7172 *                          The device lock will _not_ be taken (due to lock
     7173 *                          order).
     7174 * @param   pszDesc         Pointer to description string. This must not be freed.
     7175 * @param   ppvMapping      Where to store the address of the ring-3 mapping of
     7176 *                          the memory.
     7177 * @param   phRegion        Where to return the MMIO2 region handle.
     7178 *
     7179 */
     7180DECLINLINE(int) PDMDevHlpPCIIORegionCreateMmio2Ex(PPDMDEVINS pDevIns, uint32_t iPciRegion, RTGCPHYS cbRegion,
     7181                                                  PCIADDRESSSPACE enmType, uint32_t fMmio2Flags, PFNPCIIOREGIONMAP pfnMapUnmap,
     7182                                                  const char *pszDesc, void **ppvMapping, PPGMMMIO2HANDLE phRegion)
     7183
     7184{
     7185    int rc = pDevIns->pHlpR3->pfnMmio2Create(pDevIns, pDevIns->apPciDevs[0], iPciRegion << 16, cbRegion, fMmio2Flags,
     7186                                             pszDesc, ppvMapping, phRegion);
     7187    if (RT_SUCCESS(rc))
     7188        rc = pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, pDevIns->apPciDevs[0], iPciRegion, cbRegion, enmType,
     7189                                                     PDMPCIDEV_IORGN_F_MMIO2_HANDLE, *phRegion, pfnMapUnmap);
     7190    return rc;
     7191}
    69277192
    69287193/**
     
    76587923}
    76597924
    7660 #endif /* !IN_RING3 */
     7925#endif /* !IN_RING3 || DOXYGEN_RUNNING */
    76617926
    76627927/**
  • trunk/include/VBox/vmm/pgm.h

    r81475 r81624  
    677677VMMR0_INT_DECL(int) PGMR0PhysFlushHandyPages(PGVM pGVM, VMCPUID idCpu);
    678678VMMR0_INT_DECL(int) PGMR0PhysAllocateLargeHandyPage(PGVM pGVM, VMCPUID idCpu);
     679VMMR0_INT_DECL(int) PGMR0PhysMMIO2MapKernel(PGVM pGVM, PPDMDEVINS pDevIns, PGMMMIO2HANDLE hMmio2,
     680                                            size_t offSub, size_t cbSub, void **ppvMapping);
    679681VMMR0_INT_DECL(int) PGMR0PhysSetupIoMmu(PGVM pGVM);
    680682VMMR0DECL(int)      PGMR0SharedModuleCheck(PVMCC pVM, PGVM pGVM, VMCPUID idCpu, PGMMSHAREDMODULE pModule, PCRTGCPTR64 paRegionsGCPtrs);
     
    723725                                          RTR3PTR pvUserR3, RTR0PTR pvUserR0, RTRCPTR pvUserRC, const char *pszDesc);
    724726VMMR3DECL(int)      PGMR3PhysMMIODeregister(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb);
    725 VMMR3DECL(int)      PGMR3PhysMMIO2Register(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion, RTGCPHYS cb, uint32_t fFlags, void **ppv, const char *pszDesc);
    726 VMMR3DECL(int)      PGMR3PhysMMIOExPreRegister(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion, RTGCPHYS cbRegion, PGMPHYSHANDLERTYPE hType,
    727                                                RTR3PTR pvUserR3, RTR0PTR pvUserR0, RTRCPTR pvUserRC, const char *pszDesc);
    728 VMMR3DECL(int)      PGMR3PhysMMIOExDeregister(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion);
    729 VMMR3DECL(int)      PGMR3PhysMMIOExMap(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion, RTGCPHYS GCPhys);
    730 VMMR3DECL(int)      PGMR3PhysMMIOExUnmap(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion, RTGCPHYS GCPhys);
    731 VMMR3_INT_DECL(int) PGMR3PhysMMIOExReduce(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion, RTGCPHYS cbRegion);
     727VMMR3_INT_DECL(int) PGMR3PhysMMIO2Register(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion, RTGCPHYS cb,
     728                                           uint32_t fFlags, const char *pszDesc, void **ppv, PGMMMIO2HANDLE *phRegion);
     729VMMR3_INT_DECL(int) PGMR3PhysMMIOExDeregister(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion, PGMMMIO2HANDLE hMmio2);
     730VMMR3_INT_DECL(int) PGMR3PhysMMIOExMap(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion, PGMMMIO2HANDLE hMmio2, RTGCPHYS GCPhys);
     731VMMR3_INT_DECL(int) PGMR3PhysMMIOExUnmap(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion, PGMMMIO2HANDLE hMmio2, RTGCPHYS GCPhys);
     732VMMR3_INT_DECL(int) PGMR3PhysMMIOExReduce(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion, PGMMMIO2HANDLE hMmio2, RTGCPHYS cbRegion);
     733VMMR3_INT_DECL(int) PGMR3PhysMmio2ValidateHandle(PVM pVM, PPDMDEVINS pDevIns, PGMMMIO2HANDLE hMmio2);
     734VMMR3_INT_DECL(RTGCPHYS) PGMR3PhysMMIOExGetMappingAddress(PVM pVM, PPDMDEVINS pDevIns, PGMMMIO2HANDLE hMmio2);
     735VMMR3_INT_DECL(int) PGMR3PhysMMIOExChangeRegionNo(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion, PGMMMIO2HANDLE hMmio2, uint32_t iNewRegion);
    732736VMMR3DECL(bool)     PGMR3PhysMMIOExIsBase(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhys);
    733737VMMR3_INT_DECL(int) PGMR3PhysMMIO2GetHCPhys(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion, RTGCPHYS off, PRTHCPHYS pHCPhys);
    734738VMMR3_INT_DECL(int) PGMR3PhysMMIO2MapKernel(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, const char *pszDesc, PRTR0PTR pR0Ptr);
    735 VMMR3_INT_DECL(int) PGMR3PhysMMIOExChangeRegionNo(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion, uint32_t iNewRegion);
    736739
    737740
  • trunk/include/VBox/vmm/vm.h

    r81391 r81624  
    12661266        struct PGM  s;
    12671267#endif
    1268         uint8_t     padding[20800];      /* multiple of 64 */
     1268        uint8_t     padding[21120];      /* multiple of 64 */
    12691269    } pgm;
    12701270
     
    14321432
    14331433    /** Padding for aligning the structure size on a page boundrary. */
    1434     uint8_t         abAlignment2[984 + 256 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT];
     1434    uint8_t         abAlignment2[664 + 256 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT];
    14351435
    14361436    /* ---- end small stuff ---- */
  • trunk/include/VBox/vmm/vm.mac

    r81391 r81624  
    121121    .cpum                   resb 1536
    122122    .vmm                    resb 1600
    123     .pgm                    resb 20800
     123    .pgm                    resb 21120
    124124    .hm                     resb 5440
    125125    .trpm                   resb 5248
     
    138138    .cfgm                   resb 8
    139139
    140     .abAlignment2           resb 984 + 256 - RTR0PTR_CB * VMM_MAX_CPU_COUNT
     140    .abAlignment2           resb 664 + 256 - RTR0PTR_CB * VMM_MAX_CPU_COUNT
    141141
    142142    alignb RTR0PTR_CB * VMM_MAX_CPU_COUNT ; ASSUMES VMM_MAX_CPU_COUNT is a power of two.
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