Lines Matching refs:cMsrRanges
72 uint32_t cMsrRanges;
258 * @param cMsrRanges The number of MSR ranges.
261 static uint32_t cpumR3MsrRangesBinSearch(PCCPUMMSRRANGE paMsrRanges, uint32_t cMsrRanges, uint32_t uMsr)
263 if (!cMsrRanges)
267 uint32_t iLast = cMsrRanges - 1;
284 if (i < cMsrRanges)
304 * @param cMsrRanges The current number of ranges.
307 static PCPUMMSRRANGE cpumR3MsrRangesEnsureSpace(PVM pVM, PCPUMMSRRANGE *ppaMsrRanges, uint32_t cMsrRanges, uint32_t cNewRanges)
311 cMsrRangesAllocated = RT_ALIGN_32(cMsrRanges, 16);
319 cMsrRangesAllocated = cMsrRanges;
321 if (cMsrRangesAllocated < cMsrRanges + cNewRanges)
324 uint32_t cNew = RT_ALIGN_32(cMsrRanges + cNewRanges, 16);
328 Assert(cMsrRanges == pVM->cpum.s.GuestInfo.cMsrRanges);
402 pcMsrRanges = &pVM->cpum.s.GuestInfo.cMsrRanges;
405 uint32_t cMsrRanges = *pcMsrRanges;
411 if ( cMsrRanges > 0
412 && paMsrRanges[cMsrRanges - 1].uLast < pNewRange->uFirst)
414 paMsrRanges = cpumR3MsrRangesEnsureSpace(pVM, ppaMsrRanges, cMsrRanges, 1);
417 paMsrRanges[cMsrRanges] = *pNewRange;
422 uint32_t i = cpumR3MsrRangesBinSearch(paMsrRanges, cMsrRanges, pNewRange->uFirst);
423 Assert(i == cMsrRanges || pNewRange->uFirst <= paMsrRanges[i].uLast);
429 if ( i >= cMsrRanges
432 paMsrRanges = cpumR3MsrRangesEnsureSpace(pVM, ppaMsrRanges, cMsrRanges, 1);
435 if (i < cMsrRanges)
436 memmove(&paMsrRanges[i + 1], &paMsrRanges[i], (cMsrRanges - i) * sizeof(paMsrRanges[0]));
452 paMsrRanges = cpumR3MsrRangesEnsureSpace(pVM, ppaMsrRanges, cMsrRanges, 2);
455 if (i < cMsrRanges)
456 memmove(&paMsrRanges[i + 2], &paMsrRanges[i], (cMsrRanges - i) * sizeof(paMsrRanges[0]));
488 if (i + 1 < cMsrRanges)
489 memmove(&paMsrRanges[i], &paMsrRanges[i + 1], (cMsrRanges - i - 1) * sizeof(paMsrRanges[0]));
490 cMsrRanges = *pcMsrRanges -= 1;
494 while ( i < cMsrRanges
505 if (i + 1 < cMsrRanges)
506 memmove(&paMsrRanges[i], &paMsrRanges[i + 1], (cMsrRanges - i - 1) * sizeof(paMsrRanges[0]));
507 cMsrRanges = *pcMsrRanges -= 1;
512 paMsrRanges = cpumR3MsrRangesEnsureSpace(pVM, ppaMsrRanges, cMsrRanges, 1);
515 if (i < cMsrRanges)
516 memmove(&paMsrRanges[i + 1], &paMsrRanges[i], (cMsrRanges - i) * sizeof(paMsrRanges[0]));
540 int rc = cpumR3MsrRangesInsert(NULL /* pVM */, &pVM->cpum.s.GuestInfo.paMsrRangesR3, &pVM->cpum.s.GuestInfo.cMsrRanges,
756 uint32_t cLeft = pEntry->cMsrRanges;
771 pInfo->cMsrRanges = cMsrs;
831 uint32_t cRanges = pVM->cpum.s.GuestInfo.cMsrRanges;