static DECLCALLBACK(int) msixMap (PPCIDEVICE pPciDev, int iRegion,
                                  RTGCPHYS GCPhysAddress, uint32_t cb,
                                  PCIADDRESSSPACE enmType)
{
    Assert(enmType == PCI_ADDRESS_SPACE_MEM);
    NOREF(iRegion); NOREF(enmType);

    int rc = PDMDevHlpMMIORegister(pPciDev->pDevIns, GCPhysAddress, cb, pPciDev,
                                   IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
                                   msixMMIOWrite, msixMMIORead, "MSI-X tables");

    if (RT_FAILURE(rc))
        return rc;

    return VINF_SUCCESS;
}
/**
 * @callback_method_impl{FNPCIIOREGIONMAP}
 */
static DECLCALLBACK(int) ox958R3Map(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion,
                                    RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType)
{
    RT_NOREF(enmType);
    PDEVOX958 pThis = (PDEVOX958)pPciDev;
    int       rc = VINF_SUCCESS;

    if (iRegion == 0)
    {
        Assert(enmType == PCI_ADDRESS_SPACE_MEM);

        rc = PDMDevHlpMMIORegister(pDevIns, GCPhysAddress, cb, NULL /*pvUser*/,
                                   IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
                                   ox958MmioWrite, ox958MmioRead, "OxPCIe958");
        if (RT_FAILURE(rc))
            return rc;

        /* Enable (or not) RC/R0 support. */
        if (pThis->fRCEnabled)
        {
            rc = PDMDevHlpMMIORegisterRC(pDevIns, GCPhysAddress, cb, NIL_RTRCPTR /*pvUser*/,
                                         "ox958MmioWrite", "ox958MmioRead");
            if (RT_FAILURE(rc))
                return rc;
        }

        if (pThis->fR0Enabled)
        {
            rc = PDMDevHlpMMIORegisterR0(pDevIns, GCPhysAddress, cb, NIL_RTR0PTR /*pvUser*/,
                                         "ox958MmioWrite", "ox958MmioRead");
            if (RT_FAILURE(rc))
                return rc;
        }

        pThis->GCPhysMMIO = GCPhysAddress;
    }

    return VINF_SUCCESS;
}