Changeset 80679 in vbox
- Timestamp:
- Sep 9, 2019 6:26:59 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 133216
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/iom.h
r80649 r80679 243 243 typedef FNIOMIOPORTOUTSTRING *PFNIOMIOPORTOUTSTRING; 244 244 245 /** 246 * I/O port description. 247 * 248 * If both pszIn and pszOut are NULL, the entry is considered a terminator. 249 */ 250 typedef struct IOMIOPORTDESC 251 { 252 /** Brief description / name of the IN port. */ 253 const char *pszIn; 254 /** Brief description / name of the OUT port. */ 255 const char *pszOut; 256 /** Detailed description of the IN port, optional. */ 257 const char *pszInDetail; 258 /** Detialed description of the OUT port, optional. */ 259 const char *pszOutDetail; 260 } IOMIOPORTDESC; 261 /** Pointer to an I/O port description. */ 262 typedef IOMIOPORTDESC const *PCIOMIOPORTDESC; 263 245 264 246 265 /** … … 321 340 uint32_t iPciRegion, PFNIOMIOPORTOUT pfnOut, PFNIOMIOPORTIN pfnIn, 322 341 PFNIOMIOPORTOUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, RTR3PTR pvUser, 323 const char *pszDesc, P IOMIOPORTHANDLE phIoPorts);342 const char *pszDesc, PCIOMIOPORTDESC paExtDescs, PIOMIOPORTHANDLE phIoPorts); 324 343 VMMR3_INT_DECL(int) IOMR3IoPortMap(PVM pVM, PPDMDEVINS pDevIns, IOMIOPORTHANDLE hIoPorts, RTIOPORT Port); 325 344 VMMR3_INT_DECL(int) IOMR3IoPortUnmap(PVM pVM, PPDMDEVINS pDevIns, IOMIOPORTHANDLE hIoPorts); -
trunk/include/VBox/vmm/pdmdev.h
r80673 r80679 2190 2190 * @param pvUser User argument to pass to the callbacks. 2191 2191 * @param pszDesc Pointer to description string. This must not be freed. 2192 * @param paExtDescs Extended per-port descriptions, optional. Partial range 2193 * coverage is allowed. This must not be freed. 2192 2194 * @param phIoPorts Where to return the I/O port range handle. 2193 2195 * … … 2198 2200 * PDMDevHlpIoPortUnmap. 2199 2201 */ 2200 DECLR3CALLBACKMEMBER(int, pfnIoPortCreateEx,(PPDMDEVINS pDevIns, RTIOPORT cPorts, 2201 uint32_t fFlags, PPDMPCIDEV pPciDev, uint32_t iPciRegion, 2202 PFNIOMIOPORTOUT pfnOut, PFNIOMIOPORTIN pfnIn, 2203 PFNIOMIOPORTOUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, 2204 RTR3PTR pvUser, const char *pszDesc, PIOMIOPORTHANDLE phIoPorts)); 2202 DECLR3CALLBACKMEMBER(int, pfnIoPortCreateEx,(PPDMDEVINS pDevIns, RTIOPORT cPorts, uint32_t fFlags, PPDMPCIDEV pPciDev, 2203 uint32_t iPciRegion, PFNIOMIOPORTOUT pfnOut, PFNIOMIOPORTIN pfnIn, 2204 PFNIOMIOPORTOUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, RTR3PTR pvUser, 2205 const char *pszDesc, PCIOMIOPORTDESC paExtDescs, PIOMIOPORTHANDLE phIoPorts)); 2205 2206 2206 2207 /** … … 5370 5371 */ 5371 5372 DECLINLINE(int) PDMDevHlpIoPortCreateAndMap(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts, PFNIOMIOPORTOUT pfnOut, 5372 PFNIOMIOPORTIN pfnIn, const char *pszDesc, PIOMIOPORTHANDLE phIoPorts) 5373 PFNIOMIOPORTIN pfnIn, const char *pszDesc, PCIOMIOPORTDESC paExtDescs, 5374 PIOMIOPORTHANDLE phIoPorts) 5373 5375 { 5374 5376 int rc = pDevIns->pHlpR3->pfnIoPortCreateEx(pDevIns, cPorts, 0, NULL, UINT32_MAX, 5375 pfnOut, pfnIn, NULL, NULL, NULL, pszDesc, p hIoPorts);5377 pfnOut, pfnIn, NULL, NULL, NULL, pszDesc, paExtDescs, phIoPorts); 5376 5378 if (RT_SUCCESS(rc)) 5377 5379 rc = pDevIns->pHlpR3->pfnIoPortMap(pDevIns, *phIoPorts, Port); … … 5384 5386 DECLINLINE(int) PDMDevHlpIoPortCreate(PPDMDEVINS pDevIns, RTIOPORT cPorts, PPDMPCIDEV pPciDev, uint32_t iPciRegion, 5385 5387 PFNIOMIOPORTOUT pfnOut, PFNIOMIOPORTIN pfnIn, void *pvUser, const char *pszDesc, 5386 P IOMIOPORTHANDLE phIoPorts)5388 PCIOMIOPORTDESC paExtDescs, PIOMIOPORTHANDLE phIoPorts) 5387 5389 { 5388 5390 return pDevIns->pHlpR3->pfnIoPortCreateEx(pDevIns, cPorts, 0, pPciDev, iPciRegion, 5389 pfnOut, pfnIn, NULL, NULL, pvUser, pszDesc, p hIoPorts);5391 pfnOut, pfnIn, NULL, NULL, pvUser, pszDesc, paExtDescs, phIoPorts); 5390 5392 } 5391 5393 … … 5395 5397 DECLINLINE(int) PDMDevHlpIoPortCreateEx(PPDMDEVINS pDevIns, RTIOPORT cPorts, uint32_t fFlags, PPDMPCIDEV pPciDev, 5396 5398 uint32_t iPciRegion, PFNIOMIOPORTOUT pfnOut, PFNIOMIOPORTIN pfnIn, 5397 PFNIOMIOPORTOUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, 5398 void *pvUser, const char *pszDesc, PIOMIOPORTHANDLE phIoPorts)5399 PFNIOMIOPORTOUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, void *pvUser, 5400 const char *pszDesc, PCIOMIOPORTDESC paExtDescs, PIOMIOPORTHANDLE phIoPorts) 5399 5401 { 5400 5402 return pDevIns->pHlpR3->pfnIoPortCreateEx(pDevIns, cPorts, fFlags, pPciDev, iPciRegion, 5401 pfnOut, pfnIn, pfnOutStr, pfnInStr, pvUser, pszDesc, p hIoPorts);5403 pfnOut, pfnIn, pfnOutStr, pfnInStr, pvUser, pszDesc, paExtDescs, phIoPorts); 5402 5404 } 5403 5405 -
trunk/src/VBox/Devices/PC/DevRTC.cpp
r80672 r80679 1204 1204 * Register I/O ports. 1205 1205 */ 1206 static const IOMIOPORTDESC g_aIoPortDescs[] = 1207 { 1208 { NULL, "ADDR - CMOS Bank #1", NULL, NULL }, 1209 { "DATA - CMOS Bank #1", "DATA - CMOS Bank #1", NULL, NULL }, 1210 { NULL, "ADDR - CMOS Bank #2", NULL, NULL }, 1211 { "DATA - CMOS Bank #2", "DATA - CMOS Bank #2", NULL, NULL }, 1212 { NULL, NULL, NULL, NULL } 1213 }; 1206 1214 rc = PDMDevHlpIoPortCreateAndMap(pDevIns, pThis->IOPortBase, 4, rtcIOPortWrite, rtcIOPortRead, 1207 "MC146818 RTC/CMOS", &pThis->hIoPorts);1215 "MC146818 RTC/CMOS", g_aIoPortDescs, &pThis->hIoPorts); 1208 1216 AssertRCReturn(rc, rc); 1209 1217 -
trunk/src/VBox/VMM/VMMAll/IOMAll.cpp
r80641 r80679 93 93 * Get the entry for the current context. 94 94 */ 95 CTX_SUFF(PIOMIOPORTENTRY) pRegEntry = iomIoPortGetEntry(pVM, Port, &pVCpu->iom.s.idxIoPortLastRead); 95 uint16_t offPort; 96 CTX_SUFF(PIOMIOPORTENTRY) pRegEntry = iomIoPortGetEntry(pVM, Port, &offPort, &pVCpu->iom.s.idxIoPortLastRead); 96 97 if (pRegEntry) 97 98 { 98 99 #ifdef VBOX_WITH_STATISTICS 99 PIOMIOPORTSTATSENTRY pStats = iomIoPortGetStats(pVM, pRegEntry );100 PIOMIOPORTSTATSENTRY pStats = iomIoPortGetStats(pVM, pRegEntry, offPort); 100 101 #endif 101 102 … … 337 338 * Get the entry for the current context. 338 339 */ 339 CTX_SUFF(PIOMIOPORTENTRY) pRegEntry = iomIoPortGetEntry(pVM, uPort, &pVCpu->iom.s.idxIoPortLastReadStr); 340 uint16_t offPort; 341 CTX_SUFF(PIOMIOPORTENTRY) pRegEntry = iomIoPortGetEntry(pVM, uPort, &offPort, &pVCpu->iom.s.idxIoPortLastReadStr); 340 342 if (pRegEntry) 341 343 { 342 344 #ifdef VBOX_WITH_STATISTICS 343 PIOMIOPORTSTATSENTRY pStats = iomIoPortGetStats(pVM, pRegEntry );345 PIOMIOPORTSTATSENTRY pStats = iomIoPortGetStats(pVM, pRegEntry, offPort); 344 346 #endif 345 347 … … 658 660 * Get the entry for the current context. 659 661 */ 660 CTX_SUFF(PIOMIOPORTENTRY) pRegEntry = iomIoPortGetEntry(pVM, Port, &pVCpu->iom.s.idxIoPortLastWrite); 662 uint16_t offPort; 663 CTX_SUFF(PIOMIOPORTENTRY) pRegEntry = iomIoPortGetEntry(pVM, Port, &offPort, &pVCpu->iom.s.idxIoPortLastWrite); 661 664 if (pRegEntry) 662 665 { 663 666 #ifdef VBOX_WITH_STATISTICS 664 PIOMIOPORTSTATSENTRY pStats = iomIoPortGetStats(pVM, pRegEntry );667 PIOMIOPORTSTATSENTRY pStats = iomIoPortGetStats(pVM, pRegEntry, offPort); 665 668 #endif 666 669 … … 878 881 * Get the entry for the current context. 879 882 */ 880 CTX_SUFF(PIOMIOPORTENTRY) pRegEntry = iomIoPortGetEntry(pVM, uPort, &pVCpu->iom.s.idxIoPortLastWriteStr); 883 uint16_t offPort; 884 CTX_SUFF(PIOMIOPORTENTRY) pRegEntry = iomIoPortGetEntry(pVM, uPort, &offPort, &pVCpu->iom.s.idxIoPortLastWriteStr); 881 885 if (pRegEntry) 882 886 { 883 887 #ifdef VBOX_WITH_STATISTICS 884 PIOMIOPORTSTATSENTRY pStats = iomIoPortGetStats(pVM, pRegEntry );888 PIOMIOPORTSTATSENTRY pStats = iomIoPortGetStats(pVM, pRegEntry, offPort); 885 889 #endif 886 890 -
trunk/src/VBox/VMM/VMMR3/IOM.cpp
r80649 r80679 454 454 uint32_t iPciRegion, PFNIOMIOPORTOUT pfnOut, PFNIOMIOPORTIN pfnIn, 455 455 PFNIOMIOPORTOUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, RTR3PTR pvUser, 456 const char *pszDesc, P IOMIOPORTHANDLE phIoPorts)456 const char *pszDesc, PCIOMIOPORTDESC paExtDescs, PIOMIOPORTHANDLE phIoPorts) 457 457 { 458 458 /* … … 477 477 AssertReturn(*pszDesc != '\0', VERR_INVALID_POINTER); 478 478 AssertReturn(strlen(pszDesc) < 128, VERR_INVALID_POINTER); 479 if (paExtDescs) 480 { 481 AssertPtrReturn(paExtDescs, VERR_INVALID_POINTER); 482 for (size_t i = 0;; i++) 483 { 484 const char *pszIn = paExtDescs[i].pszIn; 485 const char *pszOut = paExtDescs[i].pszIn; 486 if (!pszIn && !pszOut) 487 break; 488 AssertReturn(i < _8K, VERR_OUT_OF_RANGE); 489 AssertReturn(!pszIn || strlen(pszIn) < 128, VERR_INVALID_POINTER); 490 AssertReturn(!pszOut || strlen(pszOut) < 128, VERR_INVALID_POINTER); 491 } 492 } 479 493 480 494 /* … … 515 529 pVM->iom.s.paIoPortRegs[idx].pfnInStrCallback = pfnInStr ? pfnInStr : iomR3IOPortDummyInStr; 516 530 pVM->iom.s.paIoPortRegs[idx].pszDesc = pszDesc; 531 pVM->iom.s.paIoPortRegs[idx].paExtDescs = paExtDescs; 517 532 pVM->iom.s.paIoPortRegs[idx].pPciDev = pPciDev; 518 533 pVM->iom.s.paIoPortRegs[idx].iPciRegion = iPciRegion; … … 772 787 static void iomR3IoPortRegStats(PVM pVM, PIOMIOPORTENTRYR3 pRegEntry) 773 788 { 774 PIOMIOPORTSTATSENTRY pStats = &pVM->iom.s.paIoPortStats[pRegEntry->idxStats]; 775 const char * const pszDesc = pRegEntry->pszDesc; 776 unsigned uPort = pRegEntry->uPort; 777 unsigned const uEndPort = uPort + (unsigned)pRegEntry->cPorts; 789 PIOMIOPORTSTATSENTRY pStats = &pVM->iom.s.paIoPortStats[pRegEntry->idxStats]; 790 PCIOMIOPORTDESC pExtDesc = pRegEntry->paExtDescs; 791 unsigned uPort = pRegEntry->uPort; 792 unsigned const uFirstPort = uPort; 793 unsigned const uEndPort = uPort + pRegEntry->cPorts; 794 795 /* Register a dummy statistics for the prefix. */ 796 char szName[80]; 797 size_t cchPrefix; 798 if (uFirstPort < uEndPort - 1) 799 cchPrefix = RTStrPrintf(szName, sizeof(szName), "/IOM/NewPorts/%04x-%04x", uFirstPort, uEndPort - 1); 800 else 801 cchPrefix = RTStrPrintf(szName, sizeof(szName), "/IOM/NewPorts/%04x", uPort); 802 int rc = STAMR3Register(pVM, &pRegEntry->idxSelf, STAMTYPE_U16, STAMVISIBILITY_ALWAYS, szName, 803 STAMUNIT_NONE, pRegEntry->pszDesc); 804 AssertRC(rc); 805 806 807 /* Register stats for each port under it */ 778 808 do 779 809 { 780 char szName[80]; 781 size_t cchBaseNm = RTStrPrintf(szName, sizeof(szName), "/IOM/NewStylePorts/%04x-", uPort); 782 int rc; 810 size_t cchBaseNm; 811 if (uFirstPort < uEndPort - 1) 812 cchBaseNm = cchPrefix + RTStrPrintf(&szName[cchPrefix], sizeof(szName) - cchPrefix, "/%04x-", uPort); 813 else 814 { 815 szName[cchPrefix] = '/'; 816 cchBaseNm = cchPrefix + 1; 817 } 783 818 784 819 # define SET_NM_SUFFIX(a_sz) memcpy(&szName[cchBaseNm], a_sz, sizeof(a_sz)); 820 const char * const pszInDesc = pExtDesc ? pExtDesc->pszIn : NULL; 821 const char * const pszOutDesc = pExtDesc ? pExtDesc->pszOut : NULL; 785 822 786 823 /* register the statistics counters. */ 787 824 SET_NM_SUFFIX("In-R3"); 788 rc = STAMR3Register(pVM, &pStats->InR3, STAMTYPE_COUNTER, STAMVISIBILITY_USED, szName, STAMUNIT_OCCURENCES, psz Desc); AssertRC(rc);825 rc = STAMR3Register(pVM, &pStats->InR3, STAMTYPE_COUNTER, STAMVISIBILITY_USED, szName, STAMUNIT_OCCURENCES, pszInDesc); AssertRC(rc); 789 826 SET_NM_SUFFIX("Out-R3"); 790 rc = STAMR3Register(pVM, &pStats->OutR3, STAMTYPE_COUNTER, STAMVISIBILITY_USED, szName, STAMUNIT_OCCURENCES, psz Desc); AssertRC(rc);827 rc = STAMR3Register(pVM, &pStats->OutR3, STAMTYPE_COUNTER, STAMVISIBILITY_USED, szName, STAMUNIT_OCCURENCES, pszOutDesc); AssertRC(rc); 791 828 SET_NM_SUFFIX("In-RZ"); 792 rc = STAMR3Register(pVM, &pStats->InRZ, STAMTYPE_COUNTER, STAMVISIBILITY_USED, szName, STAMUNIT_OCCURENCES, psz Desc); AssertRC(rc);829 rc = STAMR3Register(pVM, &pStats->InRZ, STAMTYPE_COUNTER, STAMVISIBILITY_USED, szName, STAMUNIT_OCCURENCES, pszInDesc); AssertRC(rc); 793 830 SET_NM_SUFFIX("Out-RZ"); 794 rc = STAMR3Register(pVM, &pStats->OutRZ, STAMTYPE_COUNTER, STAMVISIBILITY_USED, szName, STAMUNIT_OCCURENCES, psz Desc); AssertRC(rc);831 rc = STAMR3Register(pVM, &pStats->OutRZ, STAMTYPE_COUNTER, STAMVISIBILITY_USED, szName, STAMUNIT_OCCURENCES, pszOutDesc); AssertRC(rc); 795 832 SET_NM_SUFFIX("In-RZtoR3"); 796 rc = STAMR3Register(pVM, &pStats->InRZToR3, STAMTYPE_COUNTER, STAMVISIBILITY_USED, szName, STAMUNIT_OCCURENCES, pszDesc); AssertRC(rc);833 rc = STAMR3Register(pVM, &pStats->InRZToR3, STAMTYPE_COUNTER, STAMVISIBILITY_USED, szName, STAMUNIT_OCCURENCES, NULL); AssertRC(rc); 797 834 SET_NM_SUFFIX("Out-RZtoR3"); 798 rc = STAMR3Register(pVM, &pStats->OutRZToR3, STAMTYPE_COUNTER, STAMVISIBILITY_USED, szName, STAMUNIT_OCCURENCES, pszDesc); AssertRC(rc);835 rc = STAMR3Register(pVM, &pStats->OutRZToR3, STAMTYPE_COUNTER, STAMVISIBILITY_USED, szName, STAMUNIT_OCCURENCES, NULL); AssertRC(rc); 799 836 800 837 /* Profiling */ 801 SET_NM_SUFFIX("In-R3 /Prof");802 rc = STAMR3Register(pVM, &pStats->ProfInR3, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, psz Desc); AssertRC(rc);803 SET_NM_SUFFIX("Out-R3 /Prof");804 rc = STAMR3Register(pVM, &pStats->ProfOutR3, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, psz Desc); AssertRC(rc);805 SET_NM_SUFFIX("In-RZ /Prof");806 rc = STAMR3Register(pVM, &pStats->ProfInRZ, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, psz Desc); AssertRC(rc);807 SET_NM_SUFFIX("Out-RZ /Prof");808 rc = STAMR3Register(pVM, &pStats->ProfOutRZ, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, psz Desc); AssertRC(rc);838 SET_NM_SUFFIX("In-R3-Prof"); 839 rc = STAMR3Register(pVM, &pStats->ProfInR3, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, pszInDesc); AssertRC(rc); 840 SET_NM_SUFFIX("Out-R3-Prof"); 841 rc = STAMR3Register(pVM, &pStats->ProfOutR3, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, pszOutDesc); AssertRC(rc); 842 SET_NM_SUFFIX("In-RZ-Prof"); 843 rc = STAMR3Register(pVM, &pStats->ProfInRZ, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, pszInDesc); AssertRC(rc); 844 SET_NM_SUFFIX("Out-RZ-Prof"); 845 rc = STAMR3Register(pVM, &pStats->ProfOutRZ, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, pszOutDesc); AssertRC(rc); 809 846 810 847 pStats++; 811 848 uPort++; 849 if (pExtDesc) 850 pExtDesc = pszInDesc || pszOutDesc ? pExtDesc + 1 : NULL; 812 851 } while (uPort < uEndPort); 813 852 } … … 819 858 static void iomR3IoPortDeregStats(PVM pVM, PIOMIOPORTENTRYR3 pRegEntry, unsigned uPort) 820 859 { 821 PIOMIOPORTSTATSENTRY pStats = &pVM->iom.s.paIoPortStats[pRegEntry->idxStats]; 822 unsigned const uEndPort = uPort + (unsigned)pRegEntry->cPorts; 823 do 824 { 825 char szPrefix[80]; 826 RTStrPrintf(szPrefix, sizeof(szPrefix), "/IOM/NewStylePorts/%04x-", uPort); 827 STAMR3DeregisterByPrefix(pVM->pUVM, szPrefix); 828 829 pStats++; 830 uPort++; 831 } while (uPort < uEndPort); 860 char szPrefix[80]; 861 size_t cchPrefix; 862 if (pRegEntry->cPorts > 1) 863 cchPrefix = RTStrPrintf(szPrefix, sizeof(szPrefix), "/IOM/NewPorts/%04x-%04x/", uPort, uPort + pRegEntry->cPorts - 1); 864 else 865 cchPrefix = RTStrPrintf(szPrefix, sizeof(szPrefix), "/IOM/NewPorts/%04x/", uPort); 866 STAMR3DeregisterByPrefix(pVM->pUVM, szPrefix); 832 867 } 833 868 -
trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
r80677 r80679 98 98 99 99 /** @interface_method_impl{PDMDEVHLPR3,pfnIoPortCreateEx} */ 100 static DECLCALLBACK(int) pdmR3DevHlp_IoPortCreateEx(PPDMDEVINS pDevIns, RTIOPORT cPorts, 101 uint32_t fFlags, PPDMPCIDEV pPciDev, uint32_t iPciRegion, 102 PFNIOMIOPORTOUT pfnOut, PFNIOMIOPORTIN pfnIn, 103 PFNIOMIOPORTOUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, 104 RTR3PTR pvUser, const char *pszDesc, PIOMIOPORTHANDLE phIoPorts) 105 { 106 PDMDEV_ASSERT_DEVINS(pDevIns); 107 LogFlow(("pdmR3DevHlp_IoPortCreateEx: caller='%s'/%d: cPorts=%#x fFlags=%#x pPciDev=%p iPciRegion=%#x pfnOut=%p pfnIn=%p pfnOutStr=%p pfnInStr=%p pvUser=%p pszDesc=%p:{%s} phIoPorts=%p\n", 100 static DECLCALLBACK(int) pdmR3DevHlp_IoPortCreateEx(PPDMDEVINS pDevIns, RTIOPORT cPorts, uint32_t fFlags, PPDMPCIDEV pPciDev, 101 uint32_t iPciRegion, PFNIOMIOPORTOUT pfnOut, PFNIOMIOPORTIN pfnIn, 102 PFNIOMIOPORTOUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, RTR3PTR pvUser, 103 const char *pszDesc, PCIOMIOPORTDESC paExtDescs, PIOMIOPORTHANDLE phIoPorts) 104 { 105 PDMDEV_ASSERT_DEVINS(pDevIns); 106 LogFlow(("pdmR3DevHlp_IoPortCreateEx: caller='%s'/%d: cPorts=%#x fFlags=%#x pPciDev=%p iPciRegion=%#x pfnOut=%p pfnIn=%p pfnOutStr=%p pfnInStr=%p pvUser=%p pszDesc=%p:{%s} paExtDescs=%p phIoPorts=%p\n", 108 107 pDevIns->pReg->szName, pDevIns->iInstance, cPorts, fFlags, pPciDev, iPciRegion, pfnOut, pfnIn, pfnOutStr, pfnInStr, 109 pvUser, pszDesc, pszDesc, p hIoPorts));108 pvUser, pszDesc, pszDesc, paExtDescs, phIoPorts)); 110 109 PVM pVM = pDevIns->Internal.s.pVMR3; 111 110 VM_ASSERT_EMT0_RETURN(pVM, VERR_VM_THREAD_NOT_EMT); … … 113 112 114 113 int rc = IOMR3IoPortCreate(pVM, pDevIns, cPorts, fFlags, pPciDev, iPciRegion, 115 pfnOut, pfnIn, pfnOutStr, pfnInStr, pvUser, pszDesc, p hIoPorts);114 pfnOut, pfnIn, pfnOutStr, pfnInStr, pvUser, pszDesc, paExtDescs, phIoPorts); 116 115 117 116 LogFlow(("pdmR3DevHlp_IoPortCreateEx: caller='%s'/%d: returns %Rrc (*phIoPorts=%#x)\n", -
trunk/src/VBox/VMM/include/IOMInline.h
r80675 r80679 38 38 * @param pVM The cross context VM structure. 39 39 * @param uPort The I/O port lookup. 40 * @param poffPort Where to the port offset relative to the start of 41 * the I/O port range. 40 42 * @param pidxLastHint Pointer to IOMCPU::idxIoPortLastRead or 41 43 * IOMCPU::idxIoPortLastWrite. … … 46 48 * entry. 47 49 */ 48 DECLINLINE(CTX_SUFF(PIOMIOPORTENTRY)) iomIoPortGetEntry(PVMCC pVM, RTIOPORT uPort, uint16_t *pidxLastHint)50 DECLINLINE(CTX_SUFF(PIOMIOPORTENTRY)) iomIoPortGetEntry(PVMCC pVM, RTIOPORT uPort, PRTIOPORT poffPort, uint16_t *pidxLastHint) 49 51 { 50 52 Assert(IOM_IS_SHARED_LOCK_OWNER(pVM)); 51 53 52 54 #ifdef IN_RING0 53 uint32_t iEnd = RT_MIN(pVM->iom.s.cIoPortLookupEntries, pVM->iomr0.s.cIoPortAlloc);54 P IOMIOPORTLOOKUPENTRY paLookup = pVM->iomr0.s.paIoPortLookup;55 uint32_t iEnd = RT_MIN(pVM->iom.s.cIoPortLookupEntries, pVM->iomr0.s.cIoPortAlloc); 56 PCIOMIOPORTLOOKUPENTRY paLookup = pVM->iomr0.s.paIoPortLookup; 55 57 #else 56 uint32_t iEnd = pVM->iom.s.cIoPortLookupEntries;57 P IOMIOPORTLOOKUPENTRY paLookup = pVM->iom.s.paIoPortLookup;58 uint32_t iEnd = pVM->iom.s.cIoPortLookupEntries; 59 PCIOMIOPORTLOOKUPENTRY paLookup = pVM->iom.s.paIoPortLookup; 58 60 #endif 59 61 if (iEnd > 0) … … 67 69 for (;;) 68 70 { 69 P IOMIOPORTLOOKUPENTRY pCur = &paLookup[i];71 PCIOMIOPORTLOOKUPENTRY pCur = &paLookup[i]; 70 72 if (pCur->uFirstPort > uPort) 71 73 { … … 73 75 iEnd = i; 74 76 else 75 return NULL;77 break; 76 78 } 77 79 else if (pCur->uLastPort < uPort) … … 81 83 iFirst = i; 82 84 else 83 return NULL;85 break; 84 86 } 85 87 else 86 88 { 87 89 *pidxLastHint = (uint16_t)i; 90 *poffPort = uPort - pCur->uFirstPort; 88 91 89 92 /* … … 107 110 } 108 111 } 112 *poffPort = 0; 109 113 return NULL; 110 114 } … … 120 124 * @param pVM The cross context VM structure. 121 125 * @param pRegEntry The I/O port entry to get stats for. 122 */ 123 DECLINLINE(PIOMIOPORTSTATSENTRY) iomIoPortGetStats(PVMCC pVM, CTX_SUFF(PIOMIOPORTENTRY) pRegEntry) 126 * @param offPort The offset of the port relative to the start of the 127 * registration entry. 128 */ 129 DECLINLINE(PIOMIOPORTSTATSENTRY) iomIoPortGetStats(PVMCC pVM, CTX_SUFF(PIOMIOPORTENTRY) pRegEntry, uint16_t offPort) 124 130 { 125 131 size_t idxStats = pRegEntry->idxStats; 132 idxStats += offPort; 126 133 # ifdef IN_RING0 127 134 if (idxStats < pVM->iomr0.s.cIoPortStatsAllocation) -
trunk/src/VBox/VMM/include/IOMInternal.h
r80641 r80679 205 205 /** Description / Name. For easing debugging. */ 206 206 R3PTRTYPE(const char *) pszDesc; 207 /** Extended port description table, optional. */ 208 R3PTRTYPE(PCIOMIOPORTDESC) paExtDescs; 207 209 /** PCI device the registration is associated with. */ 208 210 R3PTRTYPE(PPDMPCIDEV) pPciDev;
Note:
See TracChangeset
for help on using the changeset viewer.