- Timestamp:
- Mar 10, 2025 1:02:16 PM (2 months ago)
- svn:sync-xref-src-repo-rev:
- 167884
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/GICAll.cpp
r108494 r108496 1832 1832 uint16_t *pidxIntr, uint8_t *pbPriority) 1833 1833 { 1834 #define GIC_DIST_INTR_COUNT RT_ELEMENTS(pGicDev->bmIntrPending)1835 #define GIC_REDIST_INTR_COUNT RT_ELEMENTS(pGicCpu->bmIntrPending)1836 1837 1834 /* 1838 1835 * Collect interrupts that are pending, enabled and inactive. 1839 1836 * Discard interrupts if the group they belong to is disabled. 1840 * While collect edthe interrupts, pick the one with the highest, non-idle priority.1837 * While collecting the interrupts, pick the one with the highest, non-idle priority. 1841 1838 */ 1842 1839 uint16_t uIntId = GIC_INTID_RANGE_SPECIAL_NO_INTERRUPT; … … 1847 1844 { 1848 1845 uint16_t idxHighest = UINT16_MAX; 1849 uint32_t bmIntrPending[GIC_REDIST_INTR_COUNT]; 1850 for (uint16_t i = 0; i < GIC_REDIST_INTR_COUNT; i++) 1851 { 1852 bmIntrPending[i] = (pGicCpu->bmIntrPending[i] & pGicCpu->bmIntrEnabled[i]) & ~pGicCpu->bmIntrActive[i]; 1846 for (uint16_t i = 0; i < RT_ELEMENTS(pGicCpu->bmIntrPending); i++) 1847 { 1848 uint32_t uIntrPending = (pGicCpu->bmIntrPending[i] & pGicCpu->bmIntrEnabled[i]) & ~pGicCpu->bmIntrActive[i]; 1853 1849 if (!fGroup1) 1854 bmIntrPending[i]&= ~pGicCpu->bmIntrGroup[i];1850 uIntrPending &= ~pGicCpu->bmIntrGroup[i]; 1855 1851 if (!fGroup0) 1856 bmIntrPending[i]&= pGicCpu->bmIntrGroup[i];1857 1858 uint16_t const idxPending = ASMBitFirstSetU32( bmIntrPending[i]);1852 uIntrPending &= pGicCpu->bmIntrGroup[i]; 1853 1854 uint16_t const idxPending = ASMBitFirstSetU32(uIntrPending); 1859 1855 if (idxPending > 0) 1860 1856 { 1861 uint32_t const idxPriority = (32 * i)+ idxPending - 1;1857 uint32_t const idxPriority = 32 * i + idxPending - 1; 1862 1858 Assert(idxPriority < RT_ELEMENTS(pGicCpu->abIntrPriority)); 1863 1859 if (pGicCpu->abIntrPriority[idxPriority] < uPriority) … … 1881 1877 { 1882 1878 uint16_t idxHighest = UINT16_MAX; 1883 uint32_t bmIntrPending[GIC_DIST_INTR_COUNT];1884 for (uint16_t i = 0; i < GIC_DIST_INTR_COUNT; i++)1885 {1886 bmIntrPending[i] = (pGicDev->bmIntrPending[i] & pGicDev->bmIntrEnabled[i]) & ~pGicDev->bmIntrActive[i];1879 for (uint16_t i = 0; i < RT_ELEMENTS(pGicDev->bmIntrPending) / 2; i++) 1880 { 1881 uint32_t uLo = (pGicDev->bmIntrPending[i] & pGicDev->bmIntrEnabled[i]) & ~pGicDev->bmIntrActive[i]; 1882 uint32_t uHi = (pGicDev->bmIntrPending[i + 1] & pGicDev->bmIntrEnabled[i + 1]) & ~pGicDev->bmIntrActive[i + 1]; 1887 1883 if (!fGroup1) 1888 bmIntrPending[i] &= ~pGicDev->bmIntrGroup[i]; 1884 { 1885 uLo &= ~pGicDev->bmIntrGroup[i]; 1886 uHi &= ~pGicDev->bmIntrGroup[i + 1]; 1887 } 1889 1888 if (!fGroup0) 1890 bmIntrPending[i] &= pGicDev->bmIntrGroup[i]; 1891 1892 uint16_t const idxPending = ASMBitFirstSetU32(bmIntrPending[i]); 1889 { 1890 uLo &= pGicDev->bmIntrGroup[i]; 1891 uHi &= pGicDev->bmIntrGroup[i + 1]; 1892 } 1893 1894 uint64_t const uIntrPending = RT_MAKE_U64(uLo, uHi); 1895 uint16_t const idxPending = ASMBitFirstSetU64(uIntrPending); 1893 1896 if (idxPending > 0) 1894 1897 { 1895 uint32_t const idxPriority = (32 * i)+ idxPending - 1;1898 uint32_t const idxPriority = 64 * i + idxPending - 1; 1896 1899 if (pGicDev->abIntrPriority[idxPriority] < uPriority) 1897 1900 { … … 1920 1923 LogFlowFunc(("uIntId=%u [idxIntr=%u uPriority=%u]\n", uIntId, idxIntr, uPriority)); 1921 1924 return uIntId; 1922 1923 #undef GIC_DIST_INTR_COUNT1924 #undef GIC_REDIST_INTR_COUNT1925 1925 } 1926 1926 #else
Note:
See TracChangeset
for help on using the changeset viewer.