Changeset 81106 in vbox for trunk/src/VBox/HostDrivers/Support/win
- Timestamp:
- Oct 3, 2019 9:23:00 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r77816 r81106 1762 1762 for (uint32_t idxGroup = 0; idxGroup < cGroups; idxGroup++) 1763 1763 { 1764 uint32_t cActive = 0; 1765 uint32_t cMax = RTMpGetCpuGroupCounts(idxGroup, &cActive); 1766 uint32_t cbNeeded = RT_UOFFSETOF_DYN(SUPGIPCPUGROUP, aiCpuSetIdxs[cMax]); 1764 uint32_t cActive = 0; 1765 uint32_t const cMax = RTMpGetCpuGroupCounts(idxGroup, &cActive); 1766 uint32_t const cbNeeded = RT_UOFFSETOF_DYN(SUPGIPCPUGROUP, aiCpuSetIdxs[cMax]); 1767 uintptr_t const offGroup = (uintptr_t)pGroup - (uintptr_t)pGip; 1767 1768 AssertReturn(cbNeeded <= cbGipCpuGroups, VERR_INTERNAL_ERROR_3); 1768 1769 AssertReturn(cActive <= cMax, VERR_INTERNAL_ERROR_4); 1769 1770 pGip->aoffCpuGroup[idxGroup] = (uint16_t)((uintptr_t)pGroup - (uintptr_t)pGip); 1770 AssertReturn(offGroup == (uint32_t)offGroup, VERR_INTERNAL_ERROR_5); 1771 1772 pGip->aoffCpuGroup[idxGroup] = offGroup; 1771 1773 pGroup->cMembers = cActive; 1772 1774 pGroup->cMaxMembers = cMax; … … 1813 1815 */ 1814 1816 for (uint32_t idxGroup = 0; idxGroup < pGip->cPossibleCpuGroups; idxGroup++) 1815 if (pGip->aoffCpuGroup[idxGroup] != UINT16_MAX) 1816 { 1817 PSUPGIPCPUGROUP pGroup = (PSUPGIPCPUGROUP)((uintptr_t)pGip + pGip->aoffCpuGroup[idxGroup]); 1818 1819 uint32_t cActive = 0; 1820 uint32_t cMax = RTMpGetCpuGroupCounts(idxGroup, &cActive); 1817 { 1818 uint32_t offGroup = pGip->aoffCpuGroup[idxGroup]; 1819 if (offGroup != UINT32_MAX) 1820 { 1821 PSUPGIPCPUGROUP pGroup = (PSUPGIPCPUGROUP)((uintptr_t)pGip + offGroup); 1822 uint32_t cActive = 0; 1823 uint32_t cMax = RTMpGetCpuGroupCounts(idxGroup, &cActive); 1824 1821 1825 AssertStmt(cMax == pGroup->cMaxMembers, cMax = pGroup->cMaxMembers); 1822 1826 AssertStmt(cActive <= cMax, cActive = cMax); 1823 1827 if (pGroup->cMembers != cActive) 1824 pGroup->cMembers = cActive;1828 ASMAtomicWriteU16(&pGroup->cMembers, cActive); 1825 1829 1826 1830 for (uint32_t idxMember = 0; idxMember < cMax; idxMember++) … … 1831 1835 1832 1836 if (pGroup->aiCpuSetIdxs[idxMember] != idxCpuSet) 1833 pGroup->aiCpuSetIdxs[idxMember] = idxCpuSet; 1834 } 1835 } 1837 ASMAtomicWriteS16(&pGroup->aiCpuSetIdxs[idxMember], idxCpuSet); 1838 } 1839 } 1840 } 1836 1841 } 1837 1842
Note:
See TracChangeset
for help on using the changeset viewer.