Changeset 56050 in vbox
- Timestamp:
- May 24, 2015 2:10:27 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PDMLdr.cpp
r55490 r56050 103 103 if (!HMIsEnabled(pVM)) 104 104 { 105 int rc = PDMR3LdrLoadRC(pVM, NULL, VMM GC_MAIN_MODULE_NAME);105 int rc = PDMR3LdrLoadRC(pVM, NULL, VMMRC_MAIN_MODULE_NAME); 106 106 if (RT_FAILURE(rc)) 107 107 return rc; … … 811 811 812 812 if (!pszModule) 813 pszModule = "VMMR0.r0";813 pszModule = VMMR0_MAIN_MODULE_NAME; 814 814 815 815 /* … … 866 866 AssertMsg(RTCritSectIsInitialized(&pUVM->pdm.s.ListCritSect), ("bad init order!\n")); 867 867 868 /*869 * Since we're lazy, we'll only check if the module is present870 * and hand it over to PDMR3LdrGetSymbolR0 when that's done.871 */872 if (pszModule)873 {868 if (pszModule) /* (We don't lazy load the main R0 module.) */ 869 { 870 /* 871 * Since we're lazy, we'll only check if the module is present 872 * and hand it over to PDMR3LdrGetSymbolR0 when that's done. 873 */ 874 874 AssertMsgReturn(!strpbrk(pszModule, "/\\:\n\r\t"), ("pszModule=%s\n", pszModule), VERR_INVALID_PARAMETER); 875 875 PPDMMOD pModule; … … 886 886 } 887 887 } 888 888 889 return PDMR3LdrGetSymbolR0(pVM, pszModule, pszSymbol, ppvValue); 889 890 #endif … … 918 919 919 920 if (!pszModule) 920 pszModule = "VMMGC.gc";921 pszModule = VMMRC_MAIN_MODULE_NAME; 921 922 922 923 /* … … 960 961 * @returns VBox status code. 961 962 * @param pVM Pointer to the VM. 962 * @param pszModule Module name. If NULL the main R0 module (VMMGC.gc) is assumes. 963 * @param pszModule Module name. If NULL the main RC module (VMMRC.rc) 964 * is assumed. 963 965 * @param pszSearchPath List of directories to search if @a pszFile is 964 966 * not qualified with a path. Can be NULL, in which … … 978 980 #else 979 981 AssertPtr(pVM); 980 AssertPtrNull(pszModule); 982 if (!pszModule) 983 pszModule = VMMRC_MAIN_MODULE_NAME; 984 AssertPtr(pszModule); 981 985 AssertPtr(pRCPtrValue); 982 986 AssertMsg(MMR3IsInitialized(pVM), ("bad init order!\n")); … … 986 990 * and hand it over to PDMR3LdrGetSymbolRC when that's done. 987 991 */ 988 if (pszModule) 989 { 990 AssertMsgReturn(!strpbrk(pszModule, "/\\:\n\r\t"), ("pszModule=%s\n", pszModule), VERR_INVALID_PARAMETER); 991 PUVM pUVM = pVM->pUVM; 992 PPDMMOD pModule; 993 RTCritSectEnter(&pUVM->pdm.s.ListCritSect); 994 for (pModule = pUVM->pdm.s.pModules; pModule; pModule = pModule->pNext) 995 if ( pModule->eType == PDMMOD_TYPE_RC 996 && !strcmp(pModule->szName, pszModule)) 997 break; 998 RTCritSectLeave(&pUVM->pdm.s.ListCritSect); 999 if (!pModule) 1000 { 1001 char *pszFilename = pdmR3FileRC(pszModule, pszSearchPath); 1002 AssertMsgReturn(pszFilename, ("pszModule=%s\n", pszModule), VERR_MODULE_NOT_FOUND); 1003 int rc = PDMR3LdrLoadRC(pVM, pszFilename, pszModule); 1004 RTMemTmpFree(pszFilename); 1005 AssertMsgRCReturn(rc, ("pszModule=%s rc=%Rrc\n", pszModule, rc), VERR_MODULE_NOT_FOUND); 1006 } 1007 } 992 AssertMsgReturn(!strpbrk(pszModule, "/\\:\n\r\t"), ("pszModule=%s\n", pszModule), VERR_INVALID_PARAMETER); 993 PUVM pUVM = pVM->pUVM; 994 PPDMMOD pModule; 995 RTCritSectEnter(&pUVM->pdm.s.ListCritSect); 996 for (pModule = pUVM->pdm.s.pModules; pModule; pModule = pModule->pNext) 997 if ( pModule->eType == PDMMOD_TYPE_RC 998 && !strcmp(pModule->szName, pszModule)) 999 break; 1000 RTCritSectLeave(&pUVM->pdm.s.ListCritSect); 1001 if (!pModule) 1002 { 1003 char *pszFilename = pdmR3FileRC(pszModule, pszSearchPath); 1004 AssertMsgReturn(pszFilename, ("pszModule=%s\n", pszModule), VERR_MODULE_NOT_FOUND); 1005 int rc = PDMR3LdrLoadRC(pVM, pszFilename, pszModule); 1006 RTMemTmpFree(pszFilename); 1007 AssertMsgRCReturn(rc, ("pszModule=%s rc=%Rrc\n", pszModule, rc), VERR_MODULE_NOT_FOUND); 1008 } 1009 1008 1010 return PDMR3LdrGetSymbolRC(pVM, pszModule, pszSymbol, pRCPtrValue); 1009 1011 #endif
Note:
See TracChangeset
for help on using the changeset viewer.