Changeset 34241 in vbox
- Timestamp:
- Nov 22, 2010 2:26:53 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pdmapi.h
r32935 r34241 97 97 VMMR3DECL(int) PDMR3LdrGetSymbolR3(PVM pVM, const char *pszModule, const char *pszSymbol, void **ppvValue); 98 98 VMMR3DECL(int) PDMR3LdrGetSymbolR0(PVM pVM, const char *pszModule, const char *pszSymbol, PRTR0PTR ppvValue); 99 VMMR3DECL(int) PDMR3LdrGetSymbolR0Lazy(PVM pVM, const char *pszModule, const char *pszS ymbol, PRTR0PTR ppvValue);99 VMMR3DECL(int) PDMR3LdrGetSymbolR0Lazy(PVM pVM, const char *pszModule, const char *pszSearchPath, const char *pszSymbol, PRTR0PTR ppvValue); 100 100 VMMR3DECL(int) PDMR3LdrLoadRC(PVM pVM, const char *pszFilename, const char *pszName); 101 101 VMMR3DECL(int) PDMR3LdrGetSymbolRC(PVM pVM, const char *pszModule, const char *pszSymbol, PRTRCPTR pRCPtrValue); 102 VMMR3DECL(int) PDMR3LdrGetSymbolRCLazy(PVM pVM, const char *pszModule, const char *pszS ymbol, PRTRCPTR pRCPtrValue);102 VMMR3DECL(int) PDMR3LdrGetSymbolRCLazy(PVM pVM, const char *pszModule, const char *pszSearchPath, const char *pszSymbol, PRTRCPTR pRCPtrValue); 103 103 VMMR3DECL(int) PDMR3LdrQueryRCModFromPC(PVM pVM, RTRCPTR uPC, 104 104 char *pszModName, size_t cchModName, PRTRCPTR pMod, … … 109 109 char *pszNearSym1, size_t cchNearSym1, PRTR0PTR pNearSym1, 110 110 char *pszNearSym2, size_t cchNearSym2, PRTR0PTR pNearSym2); 111 VMMR3DECL(int) PDMR3LdrGetInterfaceSymbols(PVM pVM, void *pvInterface, size_t cbInterface, 112 const char *pszModule, const char *pszSymPrefix, 113 const char *pszSymList, bool fRing0OrRC); 111 VMMR3DECL(int) PDMR3LdrGetInterfaceSymbols(PVM pVM, 112 void *pvInterface, size_t cbInterface, 113 const char *pszModule, const char *pszSearchPath, 114 const char *pszSymPrefix, const char *pszSymList, 115 bool fRing0OrRC); 114 116 115 117 VMMR3DECL(int) PDMR3QueryDevice(PVM pVM, const char *pszDevice, unsigned iInstance, PPPDMIBASE ppBase); -
trunk/include/VBox/sup.h
r33806 r34241 893 893 * @param pszFilename The path to the image file. 894 894 * @param pszModule The module name. Max 32 bytes. 895 * @param ppvImageBase Where to store the image address. 896 */ 897 SUPR3DECL(int) SUPR3LoadModule(const char *pszFilename, const char *pszModule, void **ppvImageBase); 895 * @param ppvImageBase Where to store the image address. 896 * @param pszErr Where to return error message on failure. 897 * @param cbErr The size of the error buffer. 898 */ 899 SUPR3DECL(int) SUPR3LoadModule(const char *pszFilename, const char *pszModule, 900 void **ppvImageBase, char *pszErr, size_t cbErr); 898 901 899 902 /** … … 1051 1054 SUPR3DECL(int) SUPR3HardenedLdrLoadAppPriv(const char *pszFilename, PRTLDRMOD phLdrMod); 1052 1055 1056 /** 1057 * Same as RTLdrLoad() but will verify the files it loads (hardened builds). 1058 * 1059 * This differs from SUPR3HardenedLdrLoad() in that it can load modules from 1060 * extension packs and anything else safely installed on the system, provided 1061 * they pass the hardening tests. 1062 * 1063 * @returns iprt status code. 1064 * @param pszFilename The full path to the module, with extension. 1065 * @param phLdrMod Where to store the handle to the loaded module. 1066 * @param pszErr Where to return error message on failure. 1067 * @param cbErr The size of the error buffer. 1068 */ 1069 SUPR3DECL(int) SUPR3HardenedLdrLoadPlugIn(const char *pszFilename, PRTLDRMOD phLdrMod, char *pszErr, size_t cbErr); 1053 1070 1054 1071 /** … … 1058 1075 */ 1059 1076 SUPR3DECL(int) SUPR3QueryVTxSupported(void); 1060 1061 1077 1062 1078 /** -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r33878 r34241 1556 1556 1557 1557 1558 SUPR3DECL(int) SUPR3LoadModule(const char *pszFilename, const char *pszModule, void **ppvImageBase) 1559 { 1560 int rc = VINF_SUCCESS; 1561 #ifdef VBOX_WITH_HARDENING 1558 SUPR3DECL(int) SUPR3LoadModule(const char *pszFilename, const char *pszModule, void **ppvImageBase, char *pszErr, size_t cbErr) 1559 { 1562 1560 /* 1563 1561 * Check that the module can be trusted. 1564 1562 */ 1565 rc = supR3HardenedVerifyFixedFile(pszFilename, false /* fFatal */); 1566 #endif 1563 int rc = SUPR3HardenedVerifyPlugIn(pszFilename, pszErr, cbErr); 1567 1564 if (RT_SUCCESS(rc)) 1565 { 1568 1566 rc = supLoadModule(pszFilename, pszModule, NULL, ppvImageBase); 1569 else 1570 LogRel(("SUPR3LoadModule: Verification of \"%s\" failed, rc=%Rrc\n", rc)); 1567 if (RT_FAILURE(rc)) 1568 RTStrPrintf(pszErr, cbErr, "supLoadModule returned %Rrc", rc); 1569 } 1571 1570 return rc; 1572 1571 } … … 2056 2055 { 2057 2056 void *pvImageBase; 2058 return SUPR3LoadModule(pszFilename, "VMMR0.r0", &pvImageBase );2057 return SUPR3LoadModule(pszFilename, "VMMR0.r0", &pvImageBase, NULL, 0); 2059 2058 } 2060 2059 … … 2189 2188 2190 2189 LogFlow(("SUPR3HardenedLdrLoadAppPriv: returns %Rrc\n", rc)); 2190 return rc; 2191 } 2192 2193 2194 SUPR3DECL(int) SUPR3HardenedLdrLoadPlugIn(const char *pszFilename, PRTLDRMOD phLdrMod, char *pszErr, size_t cbErr) 2195 { 2196 int rc; 2197 2198 /* 2199 * Validate input. 2200 */ 2201 AssertPtr(pszErr); 2202 Assert(cbErr > 32); 2203 AssertPtrReturn(phLdrMod, VERR_INVALID_PARAMETER); 2204 *phLdrMod = NIL_RTLDRMOD; 2205 AssertPtrReturn(pszFilename, VERR_INVALID_PARAMETER); 2206 AssertReturn(RTPathStartsWithRoot(pszFilename), VERR_INVALID_PARAMETER); 2207 2208 #ifdef VBOX_WITH_HARDENING 2209 /* 2210 * Verify the image file. 2211 */ 2212 rc = supR3HardenedVerifyFile(pszFilename, RTHCUINTPTR_MAX, pszErr, cbErr); 2213 if (RT_FAILURE(rc)) 2214 { 2215 if (!pszErr || !cbErr) 2216 LogRel(("supR3HardenedVerifyFile: Verification of \"%s\" failed, rc=%Rrc\n", pszFilename, rc)); 2217 return rc; 2218 } 2219 #endif 2220 2221 /* 2222 * Try load it. 2223 */ 2224 rc = RTLdrLoad(pszFilename, phLdrMod); 2225 if (RT_FAILURE(rc)) 2226 RTStrPrintf(pszErr, cbErr, "RTLdrLoad returned %Rrc", rc); 2191 2227 return rc; 2192 2228 } -
trunk/src/VBox/HostDrivers/Support/testcase/tstSupLoadModule.cpp
r28800 r34241 70 70 case VINF_GETOPT_NOT_OPTION: 71 71 { 72 char szErr[4096+1024]; 72 73 void *pvImageBase; 73 rc = SUPR3LoadModule(ValueUnion.psz, RTPathFilename(ValueUnion.psz), &pvImageBase );74 rc = SUPR3LoadModule(ValueUnion.psz, RTPathFilename(ValueUnion.psz), &pvImageBase, szErr, sizeof(szErr)); 74 75 if (RT_FAILURE(rc)) 75 76 { 76 RTMsgError("%Rrc when attempting to load '%s' \n", rc, ValueUnion.psz);77 RTMsgError("%Rrc when attempting to load '%s': %s\n", rc, ValueUnion.psz, szErr); 77 78 return 1; 78 79 } -
trunk/src/VBox/VMM/IOM.cpp
r33540 r34241 1417 1417 if (pVM->iom.s.pfnMMIOHandlerR0 == NIL_RTR0PTR) 1418 1418 { 1419 rc = PDMR3LdrGetSymbolRC Lazy(pVM, NULL, "IOMMMIOHandler", &pVM->iom.s.pfnMMIOHandlerRC);1419 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "IOMMMIOHandler", &pVM->iom.s.pfnMMIOHandlerRC); 1420 1420 AssertLogRelRCReturn(rc, rc); 1421 rc = PDMR3LdrGetSymbolR0 Lazy(pVM, NULL, "IOMMMIOHandler", &pVM->iom.s.pfnMMIOHandlerR0);1421 rc = PDMR3LdrGetSymbolR0(pVM, NULL, "IOMMMIOHandler", &pVM->iom.s.pfnMMIOHandlerR0); 1422 1422 AssertLogRelRCReturn(rc, rc); 1423 1423 } -
trunk/src/VBox/VMM/PDMDevHlp.cpp
r34163 r34241 54 54 55 55 56 /******************************************************************************* 57 * Defined Constants And Macros * 58 *******************************************************************************/ 56 57 /** 58 * Wrapper around PDMR3LdrGetSymbolRCLazy. 59 */ 60 DECLINLINE(int) pdmR3DevGetSymbolRCLazy(PPDMDEVINS pDevIns, const char *pszSymbol, PRTRCPTR ppvValue) 61 { 62 return PDMR3LdrGetSymbolRCLazy(pDevIns->Internal.s.pVMR3, 63 pDevIns->Internal.s.pDevR3->pReg->szRCMod, 64 pDevIns->Internal.s.pDevR3->pszRCSearchPath, 65 pszSymbol, ppvValue); 66 } 67 68 69 /** 70 * Wrapper around PDMR3LdrGetSymbolR0Lazy. 71 */ 72 DECLINLINE(int) pdmR3DevGetSymbolR0Lazy(PPDMDEVINS pDevIns, const char *pszSymbol, PRTR0PTR ppvValue) 73 { 74 return PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, 75 pDevIns->Internal.s.pDevR3->pReg->szR0Mod, 76 pDevIns->Internal.s.pDevR3->pszR0SearchPath, 77 pszSymbol, ppvValue); 78 } 79 80 59 81 /** @name R3 DevHlp 60 82 * @{ … … 107 129 if (pszIn) 108 130 { 109 rc = PDMR3LdrGetSymbolRCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szRCMod, pszIn, &RCPtrIn);131 rc = pdmR3DevGetSymbolRCLazy(pDevIns, pszIn, &RCPtrIn); 110 132 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszIn)\n", pDevIns->pReg->szRCMod, pszIn)); 111 133 } … … 113 135 if (pszOut && RT_SUCCESS(rc)) 114 136 { 115 rc = PDMR3LdrGetSymbolRCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szRCMod, pszOut, &RCPtrOut);137 rc = pdmR3DevGetSymbolRCLazy(pDevIns, pszOut, &RCPtrOut); 116 138 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOut)\n", pDevIns->pReg->szRCMod, pszOut)); 117 139 } … … 119 141 if (pszInStr && RT_SUCCESS(rc)) 120 142 { 121 rc = PDMR3LdrGetSymbolRCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szRCMod, pszInStr, &RCPtrInStr);143 rc = pdmR3DevGetSymbolRCLazy(pDevIns, pszInStr, &RCPtrInStr); 122 144 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszInStr)\n", pDevIns->pReg->szRCMod, pszInStr)); 123 145 } … … 125 147 if (pszOutStr && RT_SUCCESS(rc)) 126 148 { 127 rc = PDMR3LdrGetSymbolRCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szRCMod, pszOutStr, &RCPtrOutStr);149 rc = pdmR3DevGetSymbolRCLazy(pDevIns, pszOutStr, &RCPtrOutStr); 128 150 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOutStr)\n", pDevIns->pReg->szRCMod, pszOutStr)); 129 151 } … … 174 196 if (pszIn) 175 197 { 176 rc = PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szR0Mod, pszIn, &pfnR0PtrIn);198 rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pszIn, &pfnR0PtrIn); 177 199 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszIn)\n", pDevIns->pReg->szR0Mod, pszIn)); 178 200 } … … 180 202 if (pszOut && RT_SUCCESS(rc)) 181 203 { 182 rc = PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szR0Mod, pszOut, &pfnR0PtrOut);204 rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pszOut, &pfnR0PtrOut); 183 205 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOut)\n", pDevIns->pReg->szR0Mod, pszOut)); 184 206 } … … 186 208 if (pszInStr && RT_SUCCESS(rc)) 187 209 { 188 rc = PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szR0Mod, pszInStr, &pfnR0PtrInStr);210 rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pszInStr, &pfnR0PtrInStr); 189 211 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszInStr)\n", pDevIns->pReg->szR0Mod, pszInStr)); 190 212 } … … 192 214 if (pszOutStr && RT_SUCCESS(rc)) 193 215 { 194 rc = PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szR0Mod, pszOutStr, &pfnR0PtrOutStr);216 rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pszOutStr, &pfnR0PtrOutStr); 195 217 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOutStr)\n", pDevIns->pReg->szR0Mod, pszOutStr)); 196 218 } … … 276 298 RTRCPTR RCPtrWrite = NIL_RTRCPTR; 277 299 if (pszWrite) 278 rc = PDMR3LdrGetSymbolRCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szRCMod, pszWrite, &RCPtrWrite);300 rc = pdmR3DevGetSymbolRCLazy(pDevIns, pszWrite, &RCPtrWrite); 279 301 280 302 RTRCPTR RCPtrRead = NIL_RTRCPTR; 281 303 int rc2 = VINF_SUCCESS; 282 304 if (pszRead) 283 rc2 = PDMR3LdrGetSymbolRCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szRCMod, pszRead, &RCPtrRead);305 rc2 = pdmR3DevGetSymbolRCLazy(pDevIns, pszRead, &RCPtrRead); 284 306 285 307 RTRCPTR RCPtrFill = NIL_RTRCPTR; 286 308 int rc3 = VINF_SUCCESS; 287 309 if (pszFill) 288 rc3 = PDMR3LdrGetSymbolRCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szRCMod, pszFill, &RCPtrFill);310 rc3 = pdmR3DevGetSymbolRCLazy(pDevIns, pszFill, &RCPtrFill); 289 311 290 312 if (RT_SUCCESS(rc) && RT_SUCCESS(rc2) && RT_SUCCESS(rc3)) … … 333 355 R0PTRTYPE(PFNIOMMMIOWRITE) pfnR0PtrWrite = 0; 334 356 if (pszWrite) 335 rc = PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szR0Mod, pszWrite, &pfnR0PtrWrite);357 rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pszWrite, &pfnR0PtrWrite); 336 358 R0PTRTYPE(PFNIOMMMIOREAD) pfnR0PtrRead = 0; 337 359 int rc2 = VINF_SUCCESS; 338 360 if (pszRead) 339 rc2 = PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szR0Mod, pszRead, &pfnR0PtrRead);361 rc2 = pdmR3DevGetSymbolR0Lazy(pDevIns, pszRead, &pfnR0PtrRead); 340 362 R0PTRTYPE(PFNIOMMMIOFILL) pfnR0PtrFill = 0; 341 363 int rc3 = VINF_SUCCESS; 342 364 if (pszFill) 343 rc3 = PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szR0Mod, pszFill, &pfnR0PtrFill);365 rc3 = pdmR3DevGetSymbolR0Lazy(pDevIns, pszFill, &pfnR0PtrFill); 344 366 if (RT_SUCCESS(rc) && RT_SUCCESS(rc2) && RT_SUCCESS(rc3)) 345 367 rc = IOMR3MMIORegisterR0(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvUser, pfnR0PtrWrite, pfnR0PtrRead, pfnR0PtrFill); … … 1872 1894 { 1873 1895 if (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_RC) 1874 rc = PDMR3LdrGetInterfaceSymbols(pDevIns->Internal.s.pVMR3, pvInterface, cbInterface, 1875 pDevIns->pReg->szRCMod, pszSymPrefix, pszSymList, 1896 rc = PDMR3LdrGetInterfaceSymbols(pDevIns->Internal.s.pVMR3, 1897 pvInterface, cbInterface, 1898 pDevIns->pReg->szRCMod, pDevIns->Internal.s.pDevR3->pszRCSearchPath, 1899 pszSymPrefix, pszSymList, 1876 1900 false /*fRing0OrRC*/); 1877 1901 else … … 1908 1932 { 1909 1933 if (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0) 1910 rc = PDMR3LdrGetInterfaceSymbols(pDevIns->Internal.s.pVMR3, pvInterface, cbInterface, 1911 pDevIns->pReg->szR0Mod, pszSymPrefix, pszSymList, 1934 rc = PDMR3LdrGetInterfaceSymbols(pDevIns->Internal.s.pVMR3, 1935 pvInterface, cbInterface, 1936 pDevIns->pReg->szR0Mod, pDevIns->Internal.s.pDevR3->pszR0SearchPath, 1937 pszSymPrefix, pszSymList, 1912 1938 true /*fRing0OrRC*/); 1913 1939 else … … 1952 1978 1953 1979 PFNPDMDRVREQHANDLERR0 pfnReqHandlerR0; 1954 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, szSymbol, &pfnReqHandlerR0);1980 rc = pdmR3DevGetSymbolR0Lazy(pDevIns, szSymbol, &pfnReqHandlerR0); 1955 1981 if (RT_SUCCESS(rc)) 1956 1982 { … … 2076 2102 if (pPciBusReg->pszSetIrqRC) 2077 2103 { 2078 int rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pPciBusReg->pszSetIrqRC, &pPciBus->pfnSetIrqRC);2104 int rc = pdmR3DevGetSymbolRCLazy(pDevIns, pPciBusReg->pszSetIrqRC, &pPciBus->pfnSetIrqRC); 2079 2105 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pPciBusReg->pszSetIrqRC, rc)); 2080 2106 if (RT_FAILURE(rc)) … … 2096 2122 if (pPciBusReg->pszSetIrqR0) 2097 2123 { 2098 int rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pPciBusReg->pszSetIrqR0, &pPciBus->pfnSetIrqR0);2124 int rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pPciBusReg->pszSetIrqR0, &pPciBus->pfnSetIrqR0); 2099 2125 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pPciBusReg->pszSetIrqR0, rc)); 2100 2126 if (RT_FAILURE(rc)) … … 2210 2236 if (pPicReg->pszSetIrqRC) 2211 2237 { 2212 int rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pPicReg->pszSetIrqRC, &pVM->pdm.s.Pic.pfnSetIrqRC);2238 int rc = pdmR3DevGetSymbolRCLazy(pDevIns, pPicReg->pszSetIrqRC, &pVM->pdm.s.Pic.pfnSetIrqRC); 2213 2239 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pPicReg->pszSetIrqRC, rc)); 2214 2240 if (RT_SUCCESS(rc)) 2215 2241 { 2216 rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pPicReg->pszGetInterruptRC, &pVM->pdm.s.Pic.pfnGetInterruptRC);2242 rc = pdmR3DevGetSymbolRCLazy(pDevIns, pPicReg->pszGetInterruptRC, &pVM->pdm.s.Pic.pfnGetInterruptRC); 2217 2243 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pPicReg->pszGetInterruptRC, rc)); 2218 2244 } … … 2236 2262 if (pPicReg->pszSetIrqR0) 2237 2263 { 2238 int rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pPicReg->pszSetIrqR0, &pVM->pdm.s.Pic.pfnSetIrqR0);2264 int rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pPicReg->pszSetIrqR0, &pVM->pdm.s.Pic.pfnSetIrqR0); 2239 2265 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pPicReg->pszSetIrqR0, rc)); 2240 2266 if (RT_SUCCESS(rc)) 2241 2267 { 2242 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pPicReg->pszGetInterruptR0, &pVM->pdm.s.Pic.pfnGetInterruptR0);2268 rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pPicReg->pszGetInterruptR0, &pVM->pdm.s.Pic.pfnGetInterruptR0); 2243 2269 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pPicReg->pszGetInterruptR0, rc)); 2244 2270 } … … 2414 2440 if (pApicReg->pszGetInterruptRC) 2415 2441 { 2416 int rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszGetInterruptRC, &pVM->pdm.s.Apic.pfnGetInterruptRC);2442 int rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszGetInterruptRC, &pVM->pdm.s.Apic.pfnGetInterruptRC); 2417 2443 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszGetInterruptRC, rc)); 2418 2444 if (RT_SUCCESS(rc)) 2419 2445 { 2420 rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszHasPendingIrqRC, &pVM->pdm.s.Apic.pfnHasPendingIrqRC);2446 rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszHasPendingIrqRC, &pVM->pdm.s.Apic.pfnHasPendingIrqRC); 2421 2447 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszHasPendingIrqRC, rc)); 2422 2448 } 2423 2449 if (RT_SUCCESS(rc)) 2424 2450 { 2425 rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszSetBaseRC, &pVM->pdm.s.Apic.pfnSetBaseRC);2451 rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszSetBaseRC, &pVM->pdm.s.Apic.pfnSetBaseRC); 2426 2452 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszSetBaseRC, rc)); 2427 2453 } 2428 2454 if (RT_SUCCESS(rc)) 2429 2455 { 2430 rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszGetBaseRC, &pVM->pdm.s.Apic.pfnGetBaseRC);2456 rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszGetBaseRC, &pVM->pdm.s.Apic.pfnGetBaseRC); 2431 2457 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszGetBaseRC, rc)); 2432 2458 } 2433 2459 if (RT_SUCCESS(rc)) 2434 2460 { 2435 rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszSetTPRRC, &pVM->pdm.s.Apic.pfnSetTPRRC);2461 rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszSetTPRRC, &pVM->pdm.s.Apic.pfnSetTPRRC); 2436 2462 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszSetTPRRC, rc)); 2437 2463 } 2438 2464 if (RT_SUCCESS(rc)) 2439 2465 { 2440 rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszGetTPRRC, &pVM->pdm.s.Apic.pfnGetTPRRC);2466 rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszGetTPRRC, &pVM->pdm.s.Apic.pfnGetTPRRC); 2441 2467 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszGetTPRRC, rc)); 2442 2468 } 2443 2469 if (RT_SUCCESS(rc)) 2444 2470 { 2445 rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszWriteMSRRC, &pVM->pdm.s.Apic.pfnWriteMSRRC);2471 rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszWriteMSRRC, &pVM->pdm.s.Apic.pfnWriteMSRRC); 2446 2472 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszWriteMSRRC, rc)); 2447 2473 } 2448 2474 if (RT_SUCCESS(rc)) 2449 2475 { 2450 rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszReadMSRRC, &pVM->pdm.s.Apic.pfnReadMSRRC);2476 rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszReadMSRRC, &pVM->pdm.s.Apic.pfnReadMSRRC); 2451 2477 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszReadMSRRC, rc)); 2452 2478 } 2453 2479 if (RT_SUCCESS(rc)) 2454 2480 { 2455 rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszBusDeliverRC, &pVM->pdm.s.Apic.pfnBusDeliverRC);2481 rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszBusDeliverRC, &pVM->pdm.s.Apic.pfnBusDeliverRC); 2456 2482 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszBusDeliverRC, rc)); 2457 2483 } 2458 2484 if (RT_SUCCESS(rc)) 2459 2485 { 2460 rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszLocalInterruptRC, &pVM->pdm.s.Apic.pfnLocalInterruptRC);2486 rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszLocalInterruptRC, &pVM->pdm.s.Apic.pfnLocalInterruptRC); 2461 2487 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszLocalInterruptRC, rc)); 2462 2488 } … … 2488 2514 if (pApicReg->pszGetInterruptR0) 2489 2515 { 2490 int rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszGetInterruptR0, &pVM->pdm.s.Apic.pfnGetInterruptR0);2516 int rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszGetInterruptR0, &pVM->pdm.s.Apic.pfnGetInterruptR0); 2491 2517 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszGetInterruptR0, rc)); 2492 2518 if (RT_SUCCESS(rc)) 2493 2519 { 2494 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszHasPendingIrqR0, &pVM->pdm.s.Apic.pfnHasPendingIrqR0);2520 rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszHasPendingIrqR0, &pVM->pdm.s.Apic.pfnHasPendingIrqR0); 2495 2521 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszHasPendingIrqR0, rc)); 2496 2522 } 2497 2523 if (RT_SUCCESS(rc)) 2498 2524 { 2499 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszSetBaseR0, &pVM->pdm.s.Apic.pfnSetBaseR0);2525 rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszSetBaseR0, &pVM->pdm.s.Apic.pfnSetBaseR0); 2500 2526 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszSetBaseR0, rc)); 2501 2527 } 2502 2528 if (RT_SUCCESS(rc)) 2503 2529 { 2504 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszGetBaseR0, &pVM->pdm.s.Apic.pfnGetBaseR0);2530 rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszGetBaseR0, &pVM->pdm.s.Apic.pfnGetBaseR0); 2505 2531 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszGetBaseR0, rc)); 2506 2532 } 2507 2533 if (RT_SUCCESS(rc)) 2508 2534 { 2509 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszSetTPRR0, &pVM->pdm.s.Apic.pfnSetTPRR0);2535 rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszSetTPRR0, &pVM->pdm.s.Apic.pfnSetTPRR0); 2510 2536 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszSetTPRR0, rc)); 2511 2537 } 2512 2538 if (RT_SUCCESS(rc)) 2513 2539 { 2514 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszGetTPRR0, &pVM->pdm.s.Apic.pfnGetTPRR0);2540 rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszGetTPRR0, &pVM->pdm.s.Apic.pfnGetTPRR0); 2515 2541 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszGetTPRR0, rc)); 2516 2542 } 2517 2543 if (RT_SUCCESS(rc)) 2518 2544 { 2519 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszWriteMSRR0, &pVM->pdm.s.Apic.pfnWriteMSRR0);2545 rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszWriteMSRR0, &pVM->pdm.s.Apic.pfnWriteMSRR0); 2520 2546 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszWriteMSRR0, rc)); 2521 2547 } 2522 2548 if (RT_SUCCESS(rc)) 2523 2549 { 2524 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszReadMSRR0, &pVM->pdm.s.Apic.pfnReadMSRR0);2550 rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszReadMSRR0, &pVM->pdm.s.Apic.pfnReadMSRR0); 2525 2551 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszReadMSRR0, rc)); 2526 2552 } 2527 2553 if (RT_SUCCESS(rc)) 2528 2554 { 2529 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszBusDeliverR0, &pVM->pdm.s.Apic.pfnBusDeliverR0);2555 rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszBusDeliverR0, &pVM->pdm.s.Apic.pfnBusDeliverR0); 2530 2556 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszBusDeliverR0, rc)); 2531 2557 } 2532 2558 if (RT_SUCCESS(rc)) 2533 2559 { 2534 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszLocalInterruptR0, &pVM->pdm.s.Apic.pfnLocalInterruptR0);2560 rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszLocalInterruptR0, &pVM->pdm.s.Apic.pfnLocalInterruptR0); 2535 2561 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszLocalInterruptR0, rc)); 2536 2562 } … … 2674 2700 if (pIoApicReg->pszSetIrqRC) 2675 2701 { 2676 int rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pIoApicReg->pszSetIrqRC, &pVM->pdm.s.IoApic.pfnSetIrqRC);2702 int rc = pdmR3DevGetSymbolRCLazy(pDevIns, pIoApicReg->pszSetIrqRC, &pVM->pdm.s.IoApic.pfnSetIrqRC); 2677 2703 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pIoApicReg->pszSetIrqRC, rc)); 2678 2704 if (RT_FAILURE(rc)) … … 2691 2717 if (pIoApicReg->pszSendMsiRC) 2692 2718 { 2693 int rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pIoApicReg->pszSetIrqRC, &pVM->pdm.s.IoApic.pfnSendMsiRC);2719 int rc = pdmR3DevGetSymbolRCLazy(pDevIns, pIoApicReg->pszSetIrqRC, &pVM->pdm.s.IoApic.pfnSendMsiRC); 2694 2720 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pIoApicReg->pszSendMsiRC, rc)); 2695 2721 if (RT_FAILURE(rc)) … … 2709 2735 if (pIoApicReg->pszSetIrqR0) 2710 2736 { 2711 int rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pIoApicReg->pszSetIrqR0, &pVM->pdm.s.IoApic.pfnSetIrqR0);2737 int rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pIoApicReg->pszSetIrqR0, &pVM->pdm.s.IoApic.pfnSetIrqR0); 2712 2738 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pIoApicReg->pszSetIrqR0, rc)); 2713 2739 if (RT_FAILURE(rc)) … … 2727 2753 if (pIoApicReg->pszSendMsiR0) 2728 2754 { 2729 int rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pIoApicReg->pszSetIrqR0, &pVM->pdm.s.IoApic.pfnSendMsiR0);2755 int rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pIoApicReg->pszSetIrqR0, &pVM->pdm.s.IoApic.pfnSendMsiR0); 2730 2756 AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pIoApicReg->pszSendMsiR0, rc)); 2731 2757 if (RT_FAILURE(rc)) … … 3443 3469 3444 3470 /** @} */ 3471 -
trunk/src/VBox/VMM/PDMDevice.cpp
r33595 r34241 61 61 /** VM Handle. */ 62 62 PVM pVM; 63 /** Pointer to the configuration node the registrations should be 64 * associated with. Can be NULL. */ 65 PCFGMNODE pCfgNode; 63 66 } PDMDEVREGCBINT; 64 67 /** Pointer to a PDMDEVREGCBINT structure. */ … … 483 486 */ 484 487 PDMDEVREGCBINT RegCB; 485 RegCB.Core.u32Version = PDM_DEVREG_CB_VERSION;488 RegCB.Core.u32Version = PDM_DEVREG_CB_VERSION; 486 489 RegCB.Core.pfnRegister = pdmR3DevReg_Register; 487 RegCB.pVM = pVM; 490 RegCB.pVM = pVM; 491 RegCB.pCfgNode = NULL; 488 492 489 493 /* … … 503 507 { 504 508 /* make filename */ 505 char *pszFilename = pdmR3FileR3("VBoxDD", /* fShared = */ true);509 char *pszFilename = pdmR3FileR3("VBoxDD", true /*fShared*/); 506 510 if (!pszFilename) 507 511 return VERR_NO_TMP_MEMORY; … … 512 516 513 517 /* make filename */ 514 pszFilename = pdmR3FileR3("VBoxDD2", /* fShared = */ true);518 pszFilename = pdmR3FileR3("VBoxDD2", true /*fShared*/); 515 519 if (!pszFilename) 516 520 return VERR_NO_TMP_MEMORY; … … 557 561 if (!RTPathHavePath(szFilename)) 558 562 { 559 char *psz = pdmR3FileR3(szFilename );563 char *psz = pdmR3FileR3(szFilename, false /*fShared*/); 560 564 if (!psz) 561 565 return VERR_NO_TMP_MEMORY; … … 574 578 * Load the module and register it's devices. 575 579 */ 580 RegCB.pCfgNode = pCur; 576 581 rc = pdmR3DevLoad(pVM, &RegCB, szFilename, szName); 577 582 if (RT_FAILURE(rc)) … … 691 696 692 697 /* 693 * Allocate new device structure and insert it into the list. 694 */ 698 * Allocate new device structure, initialize and insert it into the list. 699 */ 700 int rc; 695 701 pDev = (PPDMDEV)MMR3HeapAlloc(pRegCB->pVM, MM_TAG_PDM_DEVICE, sizeof(*pDev)); 696 702 if (pDev) 697 703 { 698 pDev->pNext = NULL;704 pDev->pNext = NULL; 699 705 pDev->cInstances = 0; 700 706 pDev->pInstances = NULL; 701 pDev->pReg = pReg; 702 pDev->cchName = (uint32_t)strlen(pReg->szName); 703 704 if (pDevPrev) 705 pDevPrev->pNext = pDev; 706 else 707 pRegCB->pVM->pdm.s.pDevs = pDev; 708 Log(("PDM: Registered device '%s'\n", pReg->szName)); 709 return VINF_SUCCESS; 710 } 711 return VERR_NO_MEMORY; 707 pDev->pReg = pReg; 708 pDev->cchName = (uint32_t)strlen(pReg->szName); 709 rc = CFGMR3QueryStringAllocDef( pRegCB->pCfgNode, "RCSearchPath", &pDev->pszRCSearchPath, NULL); 710 if (RT_SUCCESS(rc)) 711 rc = CFGMR3QueryStringAllocDef(pRegCB->pCfgNode, "R0SearchPath", &pDev->pszR0SearchPath, NULL); 712 if (RT_SUCCESS(rc)) 713 { 714 if (pDevPrev) 715 pDevPrev->pNext = pDev; 716 else 717 pRegCB->pVM->pdm.s.pDevs = pDev; 718 Log(("PDM: Registered device '%s'\n", pReg->szName)); 719 return VINF_SUCCESS; 720 } 721 722 MMR3HeapFree(pDev); 723 } 724 else 725 rc = VERR_NO_MEMORY; 726 return rc; 712 727 } 713 728 -
trunk/src/VBox/VMM/PDMDriver.cpp
r34222 r34241 58 58 /** VM Handle. */ 59 59 PVM pVM; 60 /** Pointer to the configuration node the registrations should be 61 * associated with. Can be NULL. */ 62 PCFGMNODE pCfgNode; 60 63 } PDMDRVREGCBINT, *PPDMDRVREGCBINT; 61 64 typedef const PDMDRVREGCBINT *PCPDMDRVREGCBINT; … … 120 123 RegCB.Core.pfnRegister = pdmR3DrvRegister; 121 124 RegCB.pVM = pVM; 125 RegCB.pCfgNode = NULL; 122 126 123 127 /* … … 137 141 { 138 142 /* make filename */ 139 char *pszFilename = pdmR3FileR3("VBoxDD", /*fShared=*/true);143 char *pszFilename = pdmR3FileR3("VBoxDD", true /*fShared*/); 140 144 if (!pszFilename) 141 145 return VERR_NO_TMP_MEMORY; … … 181 185 if (!RTPathHavePath(szFilename)) 182 186 { 183 char *psz = pdmR3FileR3(szFilename );187 char *psz = pdmR3FileR3(szFilename, false /*fShared*/); 184 188 if (!psz) 185 189 return VERR_NO_TMP_MEMORY; … … 198 202 * Load the module and register it's drivers. 199 203 */ 204 RegCB.pCfgNode = pCur; 200 205 rc = pdmR3DrvLoad(pVM, &RegCB, szFilename, szName); 201 206 if (RT_FAILURE(rc)) … … 322 327 * Allocate new driver structure and insert it into the list. 323 328 */ 329 int rc; 324 330 pDrv = (PPDMDRV)MMR3HeapAlloc(pRegCB->pVM, MM_TAG_PDM_DRIVER, sizeof(*pDrv)); 325 331 if (pDrv) 326 332 { 327 pDrv->pNext = NULL;328 pDrv->cInstances = 0;333 pDrv->pNext = NULL; 334 pDrv->cInstances = 0; 329 335 pDrv->iNextInstance = 0; 330 pDrv->pReg = pReg; 331 332 if (pDrvPrev) 333 pDrvPrev->pNext = pDrv; 334 else 335 pRegCB->pVM->pdm.s.pDrvs = pDrv; 336 Log(("PDM: Registered driver '%s'\n", pReg->szName)); 337 return VINF_SUCCESS; 338 } 339 return VERR_NO_MEMORY; 336 pDrv->pReg = pReg; 337 rc = CFGMR3QueryStringAllocDef( pRegCB->pCfgNode, "RCSearchPath", &pDrv->pszRCSearchPath, NULL); 338 if (RT_SUCCESS(rc)) 339 rc = CFGMR3QueryStringAllocDef(pRegCB->pCfgNode, "R0SearchPath", &pDrv->pszR0SearchPath, NULL); 340 if (RT_SUCCESS(rc)) 341 { 342 if (pDrvPrev) 343 pDrvPrev->pNext = pDrv; 344 else 345 pRegCB->pVM->pdm.s.pDrvs = pDrv; 346 Log(("PDM: Registered driver '%s'\n", pReg->szName)); 347 return VINF_SUCCESS; 348 } 349 MMR3HeapFree(pDrv); 350 } 351 else 352 rc = VERR_NO_MEMORY; 353 return rc; 340 354 } 341 355 … … 1262 1276 { 1263 1277 if (pDrvIns->pReg->fFlags & PDM_DRVREG_FLAGS_RC) 1264 rc = PDMR3LdrGetInterfaceSymbols(pDrvIns->Internal.s.pVMR3, pvInterface, cbInterface, 1265 pDrvIns->pReg->szRCMod, pszSymPrefix, pszSymList, 1278 rc = PDMR3LdrGetInterfaceSymbols(pDrvIns->Internal.s.pVMR3, 1279 pvInterface, cbInterface, 1280 pDrvIns->pReg->szRCMod, pDrvIns->Internal.s.pDrv->pszRCSearchPath, 1281 pszSymPrefix, pszSymList, 1266 1282 false /*fRing0OrRC*/); 1267 1283 else … … 1298 1314 { 1299 1315 if (pDrvIns->pReg->fFlags & PDM_DRVREG_FLAGS_R0) 1300 rc = PDMR3LdrGetInterfaceSymbols(pDrvIns->Internal.s.pVMR3, pvInterface, cbInterface, 1301 pDrvIns->pReg->szR0Mod, pszSymPrefix, pszSymList, 1316 rc = PDMR3LdrGetInterfaceSymbols(pDrvIns->Internal.s.pVMR3, 1317 pvInterface, cbInterface, 1318 pDrvIns->pReg->szR0Mod, pDrvIns->Internal.s.pDrv->pszR0SearchPath, 1319 pszSymPrefix, pszSymList, 1302 1320 true /*fRing0OrRC*/); 1303 1321 else … … 1359 1377 szSymbol[sizeof("drvR0") - 1] = RT_C_TO_UPPER(szSymbol[sizeof("drvR0") - 1]); 1360 1378 1361 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDrvIns->pReg->szR0Mod, szSymbol, &pfnReqHandlerR0); 1379 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDrvIns->pReg->szR0Mod, pDrvIns->Internal.s.pDrv->pszR0SearchPath, szSymbol, 1380 &pfnReqHandlerR0); 1362 1381 if (RT_SUCCESS(rc)) 1363 1382 pDrvIns->Internal.s.pfnReqHandlerR0 = pfnReqHandlerR0; -
trunk/src/VBox/VMM/PDMInternal.h
r34219 r34241 392 392 /** Pointer to chain of instances (R3 Ptr). */ 393 393 PPDMDEVINSR3 pInstances; 394 /** The search path for raw-mode context modules (';' as separator). */ 395 char *pszRCSearchPath; 396 /** The search path for ring-0 context modules (';' as separator). */ 397 char *pszR0SearchPath; 394 398 } PDMDEV; 395 399 … … 426 430 /** The next instance number. */ 427 431 uint32_t iNextInstance; 432 /** The search path for raw-mode context modules (';' as separator). */ 433 char *pszRCSearchPath; 434 /** The search path for ring-0 context modules (';' as separator). */ 435 char *pszR0SearchPath; 428 436 } PDMDRV; 429 437 … … 1144 1152 int pdmR3LdrInitU(PUVM pUVM); 1145 1153 void pdmR3LdrTermU(PUVM pUVM); 1146 char * pdmR3FileR3(const char *pszFile, bool fShared = false);1154 char *pdmR3FileR3(const char *pszFile, bool fShared); 1147 1155 int pdmR3LoadR3U(PUVM pUVM, const char *pszFilename, const char *pszName); 1148 1156 -
trunk/src/VBox/VMM/PDMLdr.cpp
r33877 r34241 35 35 #include <VBox/log.h> 36 36 #include <iprt/assert.h> 37 #include <iprt/alloc.h> 37 #include <iprt/ctype.h> 38 #include <iprt/file.h> 38 39 #include <iprt/ldr.h> 40 #include <iprt/mem.h> 39 41 #include <iprt/path.h> 40 42 #include <iprt/string.h> … … 61 63 *******************************************************************************/ 62 64 static DECLCALLBACK(int) pdmR3GetImportRC(RTLDRMOD hLdrMod, const char *pszModule, const char *pszSymbol, unsigned uSymbol, RTUINTPTR *pValue, void *pvUser); 63 static int pdmR3LoadR0U(PUVM pUVM, const char *pszFilename, const char *pszName );64 static char * pdmR3FileRC(const char *pszFile);65 static char * pdmR3FileR0(const char *pszFile);66 static char * pdmR3File(const char *pszFile, const char *pszDefaultExt, bool fShared);65 static int pdmR3LoadR0U(PUVM pUVM, const char *pszFilename, const char *pszName, const char *pszSearchPath); 66 static char *pdmR3FileRC(const char *pszFile, const char *pszSearchPath); 67 static char *pdmR3FileR0(const char *pszFile, const char *pszSearchPath); 68 static char *pdmR3File(const char *pszFile, const char *pszDefaultExt, const char *pszSearchPath, bool fShared); 67 69 68 70 … … 76 78 VMMR3DECL(int) PDMR3LdrLoadVMMR0U(PUVM pUVM) 77 79 { 78 return pdmR3LoadR0U(pUVM, NULL, VMMR0_MAIN_MODULE_NAME );80 return pdmR3LoadR0U(pUVM, NULL, VMMR0_MAIN_MODULE_NAME, NULL); 79 81 } 80 82 … … 293 295 * Load the loader item. 294 296 */ 295 rc = SUPR3HardenedVerifyFile(pModule->szFilename, "pdmR3LoadR3U", NULL); 296 if (RT_SUCCESS(rc)) 297 rc = RTLdrLoad(pModule->szFilename, &pModule->hLdrMod); 297 char szErr[4096+1024]; 298 rc = SUPR3HardenedLdrLoadPlugIn(pModule->szFilename, &pModule->hLdrMod, szErr, sizeof(szErr)); 298 299 if (RT_SUCCESS(rc)) 299 300 { … … 304 305 { 305 306 /* Something went wrong, most likely module not found. Don't consider other unlikely errors */ 306 rc = VMSetError(pUVM->pVM, rc, RT_SRC_POS, N_("Unable to load R3 module %s (%s)"), pModule->szFilename, pszName); 307 rc = VMSetError(pUVM->pVM, rc, RT_SRC_POS, 308 N_("Unable to load R3 module %s (%s): %s"), pModule->szFilename, pszName, szErr); 307 309 RTMemFree(pModule); 308 310 } … … 459 461 char *pszFile = NULL; 460 462 if (!pszFilename) 461 pszFilename = pszFile = pdmR3FileRC(pszName );463 pszFilename = pszFile = pdmR3FileRC(pszName, NULL); 462 464 463 465 /* … … 481 483 * Open the loader item. 482 484 */ 483 int rc = SUPR3HardenedVerifyFile(pszFilename, "PDMR3LdrLoadRC", NULL); 485 char szErr[4096+1024]; 486 int rc = SUPR3HardenedVerifyPlugIn(pszFilename, szErr, sizeof(szErr)); 484 487 if (RT_SUCCESS(rc)) 488 { 489 szErr[0] = '\0'; 485 490 rc = RTLdrOpen(pszFilename, 0, RTLDRARCH_X86_32, &pModule->hLdrMod); 491 } 486 492 if (RT_SUCCESS(rc)) 487 493 { … … 559 565 560 566 /* Don't consider VERR_PDM_MODULE_NAME_CLASH and VERR_NO_MEMORY above as these are very unlikely. */ 561 if (RT_FAILURE(rc)) 567 if (RT_FAILURE(rc) && szErr[0]) 568 rc = VMSetError(pVM, rc, RT_SRC_POS, N_("Cannot load GC module %s: %s"), pszFilename, szErr); 569 else if (RT_FAILURE(rc)) 562 570 rc = VMSetError(pVM, rc, RT_SRC_POS, N_("Cannot load GC module %s"), pszFilename); 563 571 … … 576 584 * @param pszFilename Filename of the module binary. 577 585 * @param pszName Module name. Case sensitive and the length is limited! 578 */ 579 static int pdmR3LoadR0U(PUVM pUVM, const char *pszFilename, const char *pszName) 586 * @param pszSearchPath List of directories to search if @a pszFilename is 587 * not specified. Can be NULL, in which case the arch 588 * dependent install dir is searched. 589 */ 590 static int pdmR3LoadR0U(PUVM pUVM, const char *pszFilename, const char *pszName, const char *pszSearchPath) 580 591 { 581 592 /* … … 601 612 char *pszFile = NULL; 602 613 if (!pszFilename) 603 pszFilename = pszFile = pdmR3FileR0(pszName );614 pszFilename = pszFile = pdmR3FileR0(pszName, pszSearchPath); 604 615 605 616 /* … … 622 633 * Ask the support library to load it. 623 634 */ 635 char szErr[4096+1024]; 624 636 void *pvImageBase; 625 int rc = SUPR3LoadModule(pszFilename, pszName, &pvImageBase );637 int rc = SUPR3LoadModule(pszFilename, pszName, &pvImageBase, szErr, sizeof(szErr)); 626 638 if (RT_SUCCESS(rc)) 627 639 { … … 650 662 RTCritSectLeave(&pUVM->pdm.s.ListCritSect); 651 663 RTMemFree(pModule); 652 LogRel(("pdmR3LoadR0U: pszName=\"%s\" rc=%Rrc \n", pszName, rc));664 LogRel(("pdmR3LoadR0U: pszName=\"%s\" rc=%Rrc szErr=\"%s\"\n", pszName, rc, szErr)); 653 665 654 666 /* Don't consider VERR_PDM_MODULE_NAME_CLASH and VERR_NO_MEMORY above as these are very unlikely. */ 655 667 if (RT_FAILURE(rc) && pUVM->pVM) /** @todo VMR3SetErrorU. */ 656 rc = VMSetError(pUVM->pVM, rc, RT_SRC_POS, N_("Cannot load R0 module %s "), pszFilename);668 rc = VMSetError(pUVM->pVM, rc, RT_SRC_POS, N_("Cannot load R0 module %s: %s"), pszFilename, szErr); 657 669 658 670 RTMemTmpFree(pszFile); /* might be reference thru pszFilename in the above VMSetError call. */ … … 770 782 * @param pVM VM handle. 771 783 * @param pszModule Module name. If NULL the main R0 module (VMMR0.r0) is assumed. 784 * @param pszSearchPath List of directories to search if @a pszFile is 785 * not qualified with a path. Can be NULL, in which 786 * case the arch dependent install dir is searched. 772 787 * @param pszSymbol Symbol name. If it's value is less than 64k it's treated like a 773 788 * ordinal value rather than a string pointer. 774 789 * @param ppvValue Where to store the symbol value. 775 790 */ 776 VMMR3DECL(int) PDMR3LdrGetSymbolR0Lazy(PVM pVM, const char *pszModule, const char *pszSymbol, PRTR0PTR ppvValue) 791 VMMR3DECL(int) PDMR3LdrGetSymbolR0Lazy(PVM pVM, const char *pszModule, const char *pszSearchPath, const char *pszSymbol, 792 PRTR0PTR ppvValue) 777 793 { 778 794 #ifdef PDMLDR_FAKE_MODE … … 799 815 if (!pModule) 800 816 { 801 int rc = pdmR3LoadR0U(pUVM, NULL, pszModule );817 int rc = pdmR3LoadR0U(pUVM, NULL, pszModule, pszSearchPath); 802 818 AssertMsgRCReturn(rc, ("pszModule=%s rc=%Rrc\n", pszModule, rc), VERR_MODULE_NOT_FOUND); 803 819 } … … 873 889 * @param pVM VM handle. 874 890 * @param pszModule Module name. If NULL the main R0 module (VMMGC.gc) is assumes. 891 * @param pszSearchPath List of directories to search if @a pszFile is 892 * not qualified with a path. Can be NULL, in which 893 * case the arch dependent install dir is searched. 875 894 * @param pszSymbol Symbol name. If it's value is less than 64k it's treated like a 876 895 * ordinal value rather than a string pointer. 877 896 * @param pRCPtrValue Where to store the symbol value. 878 897 */ 879 VMMR3DECL(int) PDMR3LdrGetSymbolRCLazy(PVM pVM, const char *pszModule, const char *pszSymbol, PRTRCPTR pRCPtrValue) 898 VMMR3DECL(int) PDMR3LdrGetSymbolRCLazy(PVM pVM, const char *pszModule, const char *pszSearchPath, const char *pszSymbol, 899 PRTRCPTR pRCPtrValue) 880 900 { 881 901 #if defined(PDMLDR_FAKE_MODE) || !defined(VBOX_WITH_RAW_MODE) … … 902 922 if (!pModule) 903 923 { 904 char *pszFilename = pdmR3FileRC(pszModule );924 char *pszFilename = pdmR3FileRC(pszModule, pszSearchPath); 905 925 AssertMsgReturn(pszFilename, ("pszModule=%s\n", pszModule), VERR_MODULE_NOT_FOUND); 906 926 int rc = PDMR3LdrLoadRC(pVM, pszFilename, pszModule); … … 925 945 char *pdmR3FileR3(const char *pszFile, bool fShared) 926 946 { 927 return pdmR3File(pszFile, NULL, fShared);947 return pdmR3File(pszFile, NULL, NULL, fShared); 928 948 } 929 949 … … 936 956 * @returns NULL on failure. 937 957 * 938 * @param pszFile File name (no path). 939 */ 940 char *pdmR3FileR0(const char *pszFile) 941 { 942 return pdmR3File(pszFile, NULL, /*fShared=*/false); 958 * @param pszFile File name (no path). 959 * @param pszSearchPath List of directories to search if @a pszFile is 960 * not qualified with a path. Can be NULL, in which 961 * case the arch dependent install dir is searched. 962 */ 963 char *pdmR3FileR0(const char *pszFile, const char *pszSearchPath) 964 { 965 return pdmR3File(pszFile, NULL, pszSearchPath, /*fShared=*/false); 943 966 } 944 967 … … 951 974 * @returns NULL on failure. 952 975 * 953 * @param pszFile File name (no path). 954 */ 955 char *pdmR3FileRC(const char *pszFile) 956 { 957 return pdmR3File(pszFile, NULL, /*fShared=*/false); 976 * @param pszFile File name (no path). 977 * @param pszSearchPath List of directories to search if @a pszFile is 978 * not qualified with a path. Can be NULL, in which 979 * case the arch dependent install dir is searched. 980 */ 981 char *pdmR3FileRC(const char *pszFile, const char *pszSearchPath) 982 { 983 return pdmR3File(pszFile, NULL, pszSearchPath, /*fShared=*/false); 958 984 } 959 985 … … 1014 1040 * @param pszFile File name (no path). 1015 1041 * @param pszDefaultExt The default extention, NULL if none. 1042 * @param pszSearchPath List of directories to search if @a pszFile is 1043 * not qualified with a path. Can be NULL, in which 1044 * case the arch dependent install dir is searched. 1016 1045 * @param fShared If true, search in the shared directory (/usr/lib on Unix), else 1017 1046 * search in the private directory (/usr/lib/virtualbox on Unix). … … 1020 1049 * @todo Remove the fShared hack again once we don't need to link against VBoxDD anymore! 1021 1050 */ 1022 static char *pdmR3File(const char *pszFile, const char *pszDefaultExt, bool fShared)1051 static char *pdmR3File(const char *pszFile, const char *pszDefaultExt, const char *pszSearchPath, bool fShared) 1023 1052 { 1024 1053 char szPath[RTPATH_MAX]; 1025 1054 int rc; 1026 1055 1056 AssertLogRelReturn(!fShared || !pszSearchPath, NULL); 1057 Assert(!RTPathHavePath(pszFile)); 1058 1059 /* 1060 * If there is a path, search it. 1061 */ 1062 if ( pszSearchPath 1063 && *pszSearchPath) 1064 { 1065 /* Check the filename length. */ 1066 size_t const cchFile = strlen(pszFile); 1067 if (cchFile >= sizeof(szPath)) 1068 return NULL; 1069 1070 /* 1071 * Walk the search path. 1072 */ 1073 const char *psz = pszSearchPath; 1074 while (*psz) 1075 { 1076 /* Skip leading blanks - no directories with leading spaces, thank you. */ 1077 while (RT_C_IS_BLANK(*psz)) 1078 psz++; 1079 1080 /* Find the end of this element. */ 1081 const char *pszNext; 1082 const char *pszEnd = strchr(psz, ';'); 1083 if (!pszEnd) 1084 pszEnd = pszNext = strchr(psz, '\0'); 1085 else 1086 pszNext = pszEnd + 1; 1087 if (pszEnd != psz) 1088 { 1089 rc = RTPathJoinEx(szPath, sizeof(szPath), psz, pszEnd - psz, pszFile, cchFile); 1090 if (RT_SUCCESS(rc)) 1091 { 1092 if (RTFileExists(szPath)) 1093 { 1094 size_t cchPath = strlen(szPath) + 1; 1095 char *pszRet = (char *)RTMemTmpAlloc(cchPath); 1096 if (pszRet) 1097 memcpy(pszRet, szPath, cchPath); 1098 return pszRet; 1099 } 1100 } 1101 } 1102 1103 /* advance */ 1104 psz = pszNext; 1105 } 1106 } 1107 1108 /* 1109 * Use the default location. 1110 */ 1027 1111 rc = fShared ? RTPathSharedLibs(szPath, sizeof(szPath)) 1028 1112 : RTPathAppPrivateArch(szPath, sizeof(szPath)); … … 1324 1408 * @param enmType The module type. 1325 1409 * @param fLazy Lazy loading the module if set. 1326 */ 1327 static PPDMMOD pdmR3LdrFindModule(PUVM pUVM, const char *pszModule, PDMMODTYPE enmType, bool fLazy) 1410 * @param pszSearchPath Search path for use when lazy loading. 1411 */ 1412 static PPDMMOD pdmR3LdrFindModule(PUVM pUVM, const char *pszModule, PDMMODTYPE enmType, 1413 bool fLazy, const char *pszSearchPath) 1328 1414 { 1329 1415 RTCritSectEnter(&pUVM->pdm.s.ListCritSect); … … 1343 1429 case PDMMOD_TYPE_RC: 1344 1430 { 1345 char *pszFilename = pdmR3FileRC(pszModule );1431 char *pszFilename = pdmR3FileRC(pszModule, pszSearchPath); 1346 1432 if (pszFilename) 1347 1433 { … … 1349 1435 RTMemTmpFree(pszFilename); 1350 1436 if (RT_SUCCESS(rc)) 1351 return pdmR3LdrFindModule(pUVM, pszModule, enmType, false );1437 return pdmR3LdrFindModule(pUVM, pszModule, enmType, false, NULL); 1352 1438 } 1353 1439 break; … … 1357 1443 case PDMMOD_TYPE_R0: 1358 1444 { 1359 int rc = pdmR3LoadR0U(pUVM, NULL, pszModule );1445 int rc = pdmR3LoadR0U(pUVM, NULL, pszModule, pszSearchPath); 1360 1446 if (RT_SUCCESS(rc)) 1361 return pdmR3LdrFindModule(pUVM, pszModule, enmType, false );1447 return pdmR3LdrFindModule(pUVM, pszModule, enmType, false, NULL); 1362 1448 break; 1363 1449 } … … 1384 1470 * load the module if it isn't found in the module 1385 1471 * list. 1472 * @param pszSearchPath The module search path. If NULL, search the 1473 * architecture dependent install directory. 1386 1474 * @param pszSymPrefix What to prefix the symbols in the list with. The 1387 1475 * idea is that you define a list that goes with an … … 1407 1495 */ 1408 1496 VMMR3DECL(int) PDMR3LdrGetInterfaceSymbols(PVM pVM, void *pvInterface, size_t cbInterface, 1409 const char *pszModule, const char *pszSymPrefix, 1410 const char *pszSymList, bool fRing0) 1497 const char *pszModule, const char *pszSearchPath, 1498 const char *pszSymPrefix, const char *pszSymList, 1499 bool fRing0) 1411 1500 { 1412 1501 /* … … 1417 1506 pszModule ? pszModule : fRing0 ? "VMMR0.r0" : "VMMGC.gc", 1418 1507 fRing0 ? PDMMOD_TYPE_R0 : PDMMOD_TYPE_RC, 1419 true /*fLazy*/ );1508 true /*fLazy*/, pszSearchPath); 1420 1509 if (pModule) 1421 1510 { -
trunk/src/VBox/VMM/PDMUsb.cpp
r33595 r34241 308 308 { 309 309 /* make filename */ 310 char *pszFilename = pdmR3FileR3("VBoxDD", /* fShared = */ true);310 char *pszFilename = pdmR3FileR3("VBoxDD", true /*fShared*/); 311 311 if (!pszFilename) 312 312 return VERR_NO_TMP_MEMORY; … … 353 353 if (!RTPathHavePath(szFilename)) 354 354 { 355 char *psz = pdmR3FileR3(szFilename );355 char *psz = pdmR3FileR3(szFilename, false /*fShared*/); 356 356 if (!psz) 357 357 return VERR_NO_TMP_MEMORY; -
trunk/src/VBox/VMM/PGMHandler.cpp
r32540 r34241 109 109 R0PTRTYPE(PFNPGMR0PHYSHANDLER) pfnHandlerR0 = NIL_RTR0PTR; 110 110 int rc = VINF_SUCCESS; 111 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pszModR0, pszHandlerR0, &pfnHandlerR0);111 rc = PDMR3LdrGetSymbolR0Lazy(pVM, pszModR0, NULL /*pszSearchPath*/, pszHandlerR0, &pfnHandlerR0); 112 112 if (RT_SUCCESS(rc)) 113 113 { … … 116 116 */ 117 117 RTRCPTR pfnHandlerRC = NIL_RTRCPTR; 118 rc = PDMR3LdrGetSymbolRCLazy(pVM, pszModRC, pszHandlerRC, &pfnHandlerRC);118 rc = PDMR3LdrGetSymbolRCLazy(pVM, pszModRC, NULL /*pszSearchPath*/, pszHandlerRC, &pfnHandlerRC); 119 119 if (RT_SUCCESS(rc)) 120 120 return PGMHandlerPhysicalRegisterEx(pVM, enmType, GCPhys, GCPhysLast, pfnHandlerR3, pvUserR3, … … 254 254 */ 255 255 RTRCPTR pfnHandlerRC; 256 int rc = PDMR3LdrGetSymbolRCLazy(pVM, pszModRC, pszHandlerRC, &pfnHandlerRC);256 int rc = PDMR3LdrGetSymbolRCLazy(pVM, pszModRC, NULL /*pszSearchPath*/, pszHandlerRC, &pfnHandlerRC); 257 257 if (RT_SUCCESS(rc)) 258 258 return PGMR3HandlerVirtualRegisterEx(pVM, enmType, GCPtr, GCPtrLast, pfnInvalidateR3, pfnHandlerR3, pfnHandlerRC, pszDesc); -
trunk/src/VBox/VMM/TM.cpp
r33595 r34241 908 908 * Resolve symbols. 909 909 */ 910 rc = PDMR3LdrGetSymbolRC Lazy(pVM, NULL, "tmVirtualNanoTSBad", &pVM->tm.s.VirtualGetRawDataRC.pfnBad);910 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "tmVirtualNanoTSBad", &pVM->tm.s.VirtualGetRawDataRC.pfnBad); 911 911 AssertRCReturn(rc, rc); 912 rc = PDMR3LdrGetSymbolRC Lazy(pVM, NULL, "tmVirtualNanoTSRediscover", &pVM->tm.s.VirtualGetRawDataRC.pfnRediscover);912 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "tmVirtualNanoTSRediscover", &pVM->tm.s.VirtualGetRawDataRC.pfnRediscover); 913 913 AssertRCReturn(rc, rc); 914 914 if (pVM->tm.s.pfnVirtualGetRawR3 == RTTimeNanoTSLFenceSync) 915 rc = PDMR3LdrGetSymbolRC Lazy(pVM, NULL, "RTTimeNanoTSLFenceSync", &pVM->tm.s.pfnVirtualGetRawRC);915 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "RTTimeNanoTSLFenceSync", &pVM->tm.s.pfnVirtualGetRawRC); 916 916 else if (pVM->tm.s.pfnVirtualGetRawR3 == RTTimeNanoTSLFenceAsync) 917 rc = PDMR3LdrGetSymbolRC Lazy(pVM, NULL, "RTTimeNanoTSLFenceAsync", &pVM->tm.s.pfnVirtualGetRawRC);917 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "RTTimeNanoTSLFenceAsync", &pVM->tm.s.pfnVirtualGetRawRC); 918 918 else if (pVM->tm.s.pfnVirtualGetRawR3 == RTTimeNanoTSLegacySync) 919 rc = PDMR3LdrGetSymbolRC Lazy(pVM, NULL, "RTTimeNanoTSLegacySync", &pVM->tm.s.pfnVirtualGetRawRC);919 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "RTTimeNanoTSLegacySync", &pVM->tm.s.pfnVirtualGetRawRC); 920 920 else if (pVM->tm.s.pfnVirtualGetRawR3 == RTTimeNanoTSLegacyAsync) 921 rc = PDMR3LdrGetSymbolRC Lazy(pVM, NULL, "RTTimeNanoTSLegacyAsync", &pVM->tm.s.pfnVirtualGetRawRC);921 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "RTTimeNanoTSLegacyAsync", &pVM->tm.s.pfnVirtualGetRawRC); 922 922 else 923 923 AssertFatalFailed(); 924 924 AssertRCReturn(rc, rc); 925 925 926 rc = PDMR3LdrGetSymbolR0 Lazy(pVM, NULL, "tmVirtualNanoTSBad", &pVM->tm.s.VirtualGetRawDataR0.pfnBad);926 rc = PDMR3LdrGetSymbolR0(pVM, NULL, "tmVirtualNanoTSBad", &pVM->tm.s.VirtualGetRawDataR0.pfnBad); 927 927 AssertRCReturn(rc, rc); 928 rc = PDMR3LdrGetSymbolR0 Lazy(pVM, NULL, "tmVirtualNanoTSRediscover", &pVM->tm.s.VirtualGetRawDataR0.pfnRediscover);928 rc = PDMR3LdrGetSymbolR0(pVM, NULL, "tmVirtualNanoTSRediscover", &pVM->tm.s.VirtualGetRawDataR0.pfnRediscover); 929 929 AssertRCReturn(rc, rc); 930 930 if (pVM->tm.s.pfnVirtualGetRawR3 == RTTimeNanoTSLFenceSync) 931 rc = PDMR3LdrGetSymbolR0 Lazy(pVM, NULL, "RTTimeNanoTSLFenceSync", &pVM->tm.s.pfnVirtualGetRawR0);931 rc = PDMR3LdrGetSymbolR0(pVM, NULL, "RTTimeNanoTSLFenceSync", &pVM->tm.s.pfnVirtualGetRawR0); 932 932 else if (pVM->tm.s.pfnVirtualGetRawR3 == RTTimeNanoTSLFenceAsync) 933 rc = PDMR3LdrGetSymbolR0 Lazy(pVM, NULL, "RTTimeNanoTSLFenceAsync", &pVM->tm.s.pfnVirtualGetRawR0);933 rc = PDMR3LdrGetSymbolR0(pVM, NULL, "RTTimeNanoTSLFenceAsync", &pVM->tm.s.pfnVirtualGetRawR0); 934 934 else if (pVM->tm.s.pfnVirtualGetRawR3 == RTTimeNanoTSLegacySync) 935 rc = PDMR3LdrGetSymbolR0 Lazy(pVM, NULL, "RTTimeNanoTSLegacySync", &pVM->tm.s.pfnVirtualGetRawR0);935 rc = PDMR3LdrGetSymbolR0(pVM, NULL, "RTTimeNanoTSLegacySync", &pVM->tm.s.pfnVirtualGetRawR0); 936 936 else if (pVM->tm.s.pfnVirtualGetRawR3 == RTTimeNanoTSLegacyAsync) 937 rc = PDMR3LdrGetSymbolR0 Lazy(pVM, NULL, "RTTimeNanoTSLegacyAsync", &pVM->tm.s.pfnVirtualGetRawR0);937 rc = PDMR3LdrGetSymbolR0(pVM, NULL, "RTTimeNanoTSLegacyAsync", &pVM->tm.s.pfnVirtualGetRawR0); 938 938 else 939 939 AssertFatalFailed(); … … 973 973 pVM->tm.s.VirtualGetRawDataRC.pu64Prev = MMHyperR3ToRC(pVM, (void *)&pVM->tm.s.u64VirtualRawPrev); 974 974 AssertFatal(pVM->tm.s.VirtualGetRawDataRC.pu64Prev); 975 rc = PDMR3LdrGetSymbolRC Lazy(pVM, NULL, "tmVirtualNanoTSBad", &pVM->tm.s.VirtualGetRawDataRC.pfnBad);975 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "tmVirtualNanoTSBad", &pVM->tm.s.VirtualGetRawDataRC.pfnBad); 976 976 AssertFatalRC(rc); 977 rc = PDMR3LdrGetSymbolRC Lazy(pVM, NULL, "tmVirtualNanoTSRediscover", &pVM->tm.s.VirtualGetRawDataRC.pfnRediscover);977 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "tmVirtualNanoTSRediscover", &pVM->tm.s.VirtualGetRawDataRC.pfnRediscover); 978 978 AssertFatalRC(rc); 979 979 980 980 if (pVM->tm.s.pfnVirtualGetRawR3 == RTTimeNanoTSLFenceSync) 981 rc = PDMR3LdrGetSymbolRC Lazy(pVM, NULL, "RTTimeNanoTSLFenceSync", &pVM->tm.s.pfnVirtualGetRawRC);981 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "RTTimeNanoTSLFenceSync", &pVM->tm.s.pfnVirtualGetRawRC); 982 982 else if (pVM->tm.s.pfnVirtualGetRawR3 == RTTimeNanoTSLFenceAsync) 983 rc = PDMR3LdrGetSymbolRC Lazy(pVM, NULL, "RTTimeNanoTSLFenceAsync", &pVM->tm.s.pfnVirtualGetRawRC);983 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "RTTimeNanoTSLFenceAsync", &pVM->tm.s.pfnVirtualGetRawRC); 984 984 else if (pVM->tm.s.pfnVirtualGetRawR3 == RTTimeNanoTSLegacySync) 985 rc = PDMR3LdrGetSymbolRC Lazy(pVM, NULL, "RTTimeNanoTSLegacySync", &pVM->tm.s.pfnVirtualGetRawRC);985 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "RTTimeNanoTSLegacySync", &pVM->tm.s.pfnVirtualGetRawRC); 986 986 else if (pVM->tm.s.pfnVirtualGetRawR3 == RTTimeNanoTSLegacyAsync) 987 rc = PDMR3LdrGetSymbolRC Lazy(pVM, NULL, "RTTimeNanoTSLegacyAsync", &pVM->tm.s.pfnVirtualGetRawRC);987 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "RTTimeNanoTSLegacyAsync", &pVM->tm.s.pfnVirtualGetRawRC); 988 988 else 989 989 AssertFatalFailed();
Note:
See TracChangeset
for help on using the changeset viewer.