Changeset 14517 in vbox
- Timestamp:
- Nov 24, 2008 1:41:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/PGMR0DynMap.cpp
r14504 r14517 215 215 VMMR0DECL(int) PGMR0DynMapInit(void) 216 216 { 217 #ifndef DEBUG_bird218 return VINF_SUCCESS;219 #else220 217 Assert(!g_pPGMR0DynMap); 221 218 … … 264 261 RTMemFree(pThis); 265 262 return rc; 266 #endif267 263 } 268 264 … … 273 269 VMMR0DECL(void) PGMR0DynMapTerm(void) 274 270 { 275 #ifdef DEBUG_bird276 271 /* 277 272 * Destroy the cache. … … 302 297 RTMemFree(pThis); 303 298 } 304 #endif305 299 } 306 300 … … 453 447 /* cCpus * PGMR0DYNMAP_PAGES_PER_CPU (/2). */ 454 448 RTCPUID cCpus = RTMpGetCount(); 449 AssertReturn(cCpus > 0 && cCpus <= RTCPUSET_MAX_CPUS, 0); 455 450 uint32_t cPages = cCpus * PGMR0DYNMAP_PAGES_PER_CPU; 456 451 uint32_t cMinPages = cCpus * (PGMR0DYNMAP_PAGES_PER_CPU / 2); … … 461 456 pThis->cMaxLoad = 0; 462 457 463 while (pThis->cMaxLoad <PGMR0DYNMAP_CALC_OVERLOAD(cPages))458 while (pThis->cMaxLoad > PGMR0DYNMAP_CALC_OVERLOAD(cPages)) 464 459 cPages += PGMR0DYNMAP_PAGES_PER_CPU; 465 460 … … 478 473 cMinPages = PGMR0DYNMAP_MAX_PAGES; 479 474 475 Assert(cMinPages); 480 476 *pcMinPages = cMinPages; 481 477 return cPages; … … 627 623 if (RT_SUCCESS(rc)) 628 624 { 629 rc = RTR0MemObjMapKernel(&pPgLvl->a[i].hMapObj, pPgLvl->a[i].hMemObj, &pPgLvl->a[i].u.pv, 0 /* cbAlignment */, 625 rc = RTR0MemObjMapKernel(&pPgLvl->a[i].hMapObj, pPgLvl->a[i].hMemObj, 626 (void *)-1 /* pvFixed */, 0 /* cbAlignment */, 630 627 RTMEM_PROT_WRITE | RTMEM_PROT_READ); 631 628 if (RT_SUCCESS(rc)) 632 629 { 630 pPgLvl->a[i].u.pv = RTR0MemObjAddress(pPgLvl->a[i].hMapObj); 631 AssertMsg(((uintptr_t)pPgLvl->a[i].u.pv & ~(uintptr_t)PAGE_OFFSET_MASK), ("%p\n", pPgLvl->a[i].u.pv)); 633 632 pPgLvl->a[i].HCPhys = HCPhys; 634 633 if (i + 1 == pPgLvl->cLevels) … … 855 854 uint32_t cMinPages; 856 855 uint32_t cPages = pgmR0DynMapCalcNewSize(pThis, &cMinPages); 856 AssertReturn(cPages, VERR_INTERNAL_ERROR); 857 857 if (pThis->cPages >= cPages) 858 858 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.