VirtualBox

Changeset 81616 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Oct 31, 2019 7:43:07 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134373
Message:

DevPlayground,pdmdev.h: Converted the playground sample device. (untested) bugref:9218

File:
1 edited

Legend:

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

    r81590 r81616  
    58975897DECLINLINE(int) PDMDevHlpMmioCreate(PPDMDEVINS pDevIns, RTGCPHYS cbRegion, PPDMPCIDEV pPciDev, uint32_t iPciRegion,
    58985898                                    PFNIOMMMIONEWWRITE pfnWrite, PFNIOMMMIONEWREAD pfnRead, void *pvUser,
    5899                                     const char *pszDesc, PIOMMMIOHANDLE phRegion)
    5900 {
    5901     return pDevIns->pHlpR3->pfnMmioCreateEx(pDevIns, cbRegion, 0, pPciDev, iPciRegion,
     5899                                    uint32_t fFlags, const char *pszDesc, PIOMMMIOHANDLE phRegion)
     5900{
     5901    return pDevIns->pHlpR3->pfnMmioCreateEx(pDevIns, cbRegion, fFlags, pPciDev, iPciRegion,
    59025902                                            pfnWrite, pfnRead, NULL, pvUser, pszDesc, phRegion);
    59035903}
     
    68176817 * @param   pDevIns         The device instance to register the ports with.
    68186818 * @param   cbPorts         The size of the region in I/O ports.
    6819  * @param   iPciRegion      The PCI device region in the high 16-bit word and
    6820  *                          sub-region in the low 16-bit word.  UINT32_MAX if NA.
     6819 * @param   iPciRegion      The PCI device region.
    68216820 * @param   pfnOut          Pointer to function which is gonna handle OUT
    68226821 *                          operations. Optional.
     
    68356834
    68366835{
    6837     int rc = pDevIns->pHlpR3->pfnIoPortCreateEx(pDevIns, cbPorts, 0 /*fFlags*/, pDevIns->apPciDevs[0], iPciRegion,
     6836    int rc = pDevIns->pHlpR3->pfnIoPortCreateEx(pDevIns, cbPorts, 0 /*fFlags*/, pDevIns->apPciDevs[0], iPciRegion << 16,
    68386837                                                pfnOut, pfnIn, NULL, NULL, pvUser, pszDesc, paExtDescs, phIoPorts);
    68396838    if (RT_SUCCESS(rc))
     
    68686867
    68696868/**
     6869 * Registers an MMIO region for the default PCI device, extended version.
     6870 *
     6871 * @returns VBox status code.
     6872 * @param   pDevIns         The device instance.
     6873 * @param   pPciDev         The PCI device structure.
     6874 * @param   iRegion         The region number.
     6875 * @param   cbRegion        Size of the region.
     6876 * @param   enmType         PCI_ADDRESS_SPACE_MEM or
     6877 *                          PCI_ADDRESS_SPACE_MEM_PREFETCH, optionally or-ing in
     6878 *                          PCI_ADDRESS_SPACE_BAR64 or PCI_ADDRESS_SPACE_BAR32.
     6879 * @param   hMmioRegion     Handle to the MMIO region.
     6880 * @param   pfnCallback     Callback for doing the mapping, optional.  The
     6881 *                          callback will be invoked holding only the PDM lock.
     6882 *                          The device lock will _not_ be taken (due to lock
     6883 *                          order).
     6884 */
     6885DECLINLINE(int) PDMDevHlpPCIIORegionRegisterMmioEx(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion,
     6886                                                   RTGCPHYS cbRegion, PCIADDRESSSPACE enmType, IOMMMIOHANDLE hMmioRegion,
     6887                                                   PFNPCIIOREGIONMAP pfnCallback)
     6888{
     6889    return pDevIns->pHlpR3->pfnPCIIORegionRegister(pDevIns, pPciDev, iRegion, cbRegion, enmType,
     6890                                                   PDMPCIDEV_IORGN_F_MMIO_HANDLE, hMmioRegion, pfnCallback);
     6891}
     6892
     6893/**
    68706894 * Combines PDMDevHlpMmioCreate and PDMDevHlpPCIIORegionRegisterMmio, creating
    68716895 * and registering an MMIO region for the default PCI device.
     
    68746898 * @param   pDevIns         The device instance to register the ports with.
    68756899 * @param   cbRegion        The size of the region in bytes.
    6876  * @param   iPciRegion      The PCI device region in the high 16-bit word and
    6877  *                          sub-region in the low 16-bit word.  UINT32_MAX if NA.
     6900 * @param   iPciRegion      The PCI device region.
    68786901 * @param   enmType         PCI_ADDRESS_SPACE_MEM or
    68796902 *                          PCI_ADDRESS_SPACE_MEM_PREFETCH, optionally or-ing in
     
    68946917
    68956918{
    6896     int rc = pDevIns->pHlpR3->pfnMmioCreateEx(pDevIns, cbRegion, fFlags, pDevIns->apPciDevs[0], iPciRegion,
     6919    int rc = pDevIns->pHlpR3->pfnMmioCreateEx(pDevIns, cbRegion, fFlags, pDevIns->apPciDevs[0], iPciRegion << 16,
    68976920                                              pfnWrite, pfnRead, NULL /*pfnFill*/, pvUser, pszDesc, phRegion);
    68986921    if (RT_SUCCESS(rc))
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette