- Timestamp:
- Aug 10, 2010 12:13:57 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMSharedPage.cpp
r31478 r31529 36 36 #include "PGMInline.h" 37 37 38 /******************************************************************************* 39 * Global Variables * 40 *******************************************************************************/ 38 41 #if defined(VBOX_STRICT) && HC_ARCH_BITS == 64 39 /* Keep a copy of all registered shared modules for the .pgmcheckduppages debugger command. */40 static PGMMREGISTERSHAREDMODULEREQ pSharedModules[512] = {0};41 static unsigned cSharedModules = 0;42 /** Keep a copy of all registered shared modules for the .pgmcheckduppages debugger command. */ 43 static PGMMREGISTERSHAREDMODULEREQ g_apSharedModules[512] = {0}; 44 static unsigned g_cSharedModules = 0; 42 45 #endif 43 46 … … 89 92 PGMMREGISTERSHAREDMODULEREQ *ppSharedModule = NULL; 90 93 91 if ( cSharedModules < RT_ELEMENTS(pSharedModules))94 if (g_cSharedModules < RT_ELEMENTS(g_apSharedModules)) 92 95 { 93 for (unsigned i = 0; i < RT_ELEMENTS( pSharedModules); i++)96 for (unsigned i = 0; i < RT_ELEMENTS(g_apSharedModules); i++) 94 97 { 95 if ( pSharedModules[i] == NULL)98 if (g_apSharedModules[i] == NULL) 96 99 { 97 ppSharedModule = & pSharedModules[i];100 ppSharedModule = &g_apSharedModules[i]; 98 101 break; 99 102 } … … 105 108 *ppSharedModule = (PGMMREGISTERSHAREDMODULEREQ)RTMemAllocZ(RT_OFFSETOF(GMMREGISTERSHAREDMODULEREQ, aRegions[cRegions])); 106 109 memcpy(*ppSharedModule, pReq, RT_OFFSETOF(GMMREGISTERSHAREDMODULEREQ, aRegions[cRegions])); 107 cSharedModules++;110 g_cSharedModules++; 108 111 } 109 112 } … … 155 158 156 159 # if defined(VBOX_STRICT) && HC_ARCH_BITS == 64 157 for (unsigned i = 0; i < cSharedModules; i++)158 { 159 if ( pSharedModules[i]160 && !strcmp( pSharedModules[i]->szName, pszModuleName)161 && !strcmp( pSharedModules[i]->szVersion, pszVersion))160 for (unsigned i = 0; i < g_cSharedModules; i++) 161 { 162 if ( g_apSharedModules[i] 163 && !strcmp(g_apSharedModules[i]->szName, pszModuleName) 164 && !strcmp(g_apSharedModules[i]->szVersion, pszVersion)) 162 165 { 163 RTMemFree( pSharedModules[i]);164 pSharedModules[i] = NULL;165 cSharedModules--;166 RTMemFree(g_apSharedModules[i]); 167 g_apSharedModules[i] = NULL; 168 g_cSharedModules--; 166 169 break; 167 170 } … … 399 402 do 400 403 { 401 if ( pSharedModules[i])404 if (g_apSharedModules[i]) 402 405 { 403 pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Shared module %s (%s):\n", pSharedModules[i]->szName,pSharedModules[i]->szVersion);404 for (unsigned j = 0; j < pSharedModules[i]->cRegions; j++)405 pCmdHlp->pfnPrintf(pCmdHlp, NULL, "--- Region %d: base %RGv size %x\n", j, pSharedModules[i]->aRegions[j].GCRegionAddr,pSharedModules[i]->aRegions[j].cbRegion);406 pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Shared module %s (%s):\n", g_apSharedModules[i]->szName, g_apSharedModules[i]->szVersion); 407 for (unsigned j = 0; j < g_apSharedModules[i]->cRegions; j++) 408 pCmdHlp->pfnPrintf(pCmdHlp, NULL, "--- Region %d: base %RGv size %x\n", j, g_apSharedModules[i]->aRegions[j].GCRegionAddr, g_apSharedModules[i]->aRegions[j].cbRegion); 406 409 } 407 410 i++; 408 411 } 409 while (i < RT_ELEMENTS( pSharedModules));412 while (i < RT_ELEMENTS(g_apSharedModules)); 410 413 pgmUnlock(pVM); 411 414
Note:
See TracChangeset
for help on using the changeset viewer.