HalpInterruptRemapFixedLines
INT64 __stdcall HalpInterruptRemapFixedLines(){
int v0;
ULONG_PTR *v2;
__int64 v3;
_QWORD *v4;
_QWORD *v5;
INT64 v6;
int v7;
__int64 v8;
__int64 v9;
INT64 v10;
bool v11;
__int64 v12;
__int64 v13;
int v14;
unsigned __int8 v15;
UINT64 IrtIndex;
int v17;
__int64 v18;
v0 = 0;
LODWORD(IrtIndex) = 0;
v18 = 0i64;
if( !HalpInterruptFixedLines || (*(_DWORD *)(HalpInterruptController + 220) & 0x100) == 0 && !qword_140C4A168 )
return(unsigned int)v0;
v2 = (ULONG_PTR *)HalpRegisteredInterruptControllers;
v14 = 0;
while( 1 )
{
LABEL_22:
if( v2 == &HalpRegisteredInterruptControllers )
return(unsigned int)v0;
v3 = (__int64)v2;
v2 = (ULONG_PTR *)*v2;
if( *(_DWORD *)(v3 + 216) == 2 )
{
v4 = *(_QWORD **)(v3 + 240);
if( v4 != (_QWORD *)(v3 + 240) )
break;
}
}
while( 1 )
{
v5 = v4;
v4 = (_QWORD *)*v4;
if( *((_DWORD *)v5 + 8) == 2 )
{
v6 = 0i64;
v7 = *((_DWORD *)v5 + 6) - *((_DWORD *)v5 + 5);
v17 = 0;
if( v7 > 0 )
break;
}
LABEL_21:
if( v4 == (_QWORD *)(v3 + 240) )
goto LABEL_22;
}
v8 = 0i64;
v13 = 0i64;
v12 = 0i64;
v9 = 0i64;
while( 1 )
{
if( !*(_BYTE *)(v8 + v5[6]) )
goto LABEL_20;
LODWORD(v18) = *(_DWORD *)(v3 + 232);
HIDWORD(v18) = v6 + *((_DWORD *)v5 + 5);
v10 = v9 + v5[5];
if( (*(_DWORD *)(HalpInterruptController + 220) & 0x100) != 0 )
break;
LABEL_15:
if( qword_140C4A168 )
{
v0 = HalpHvMapDeviceInterrupt(*(_DWORD *)(v3 + 232), v6, v10, 0i64);
if( v0 < 0 )
{
*(_DWORD *)(v3 + 312) = 1825;
goto LABEL_25;
}
}
v15 = HalpAcquireHighLevelLock(&HalpInterruptLock);
v0 = HalpInterruptSetLineStateInternal(v3, (__int64)&v18, v10);
KxReleaseSpinLock(&HalpInterruptLock);
__writecr8(v15);
if( v0 < 0 )
return(unsigned int)v0;
LODWORD(v6) = v17;
v8 = v12;
v9 = v13;
LABEL_20:
v6 = (unsigned int)(v6 + 1);
v12 = v8 + 16;
v9 += 56i64;
v11 = (int)v6 < *((_DWORD *)v5 + 6) - *((_DWORD *)v5 + 5);
v17 = v6;
v8 += 16i64;
v13 = v9;
if( !v11 )
goto LABEL_21;
}
v0 = HalpIrtAllocateIndex(&IrtIndex, 1i64);
if( v0 >= 0 )
{
v14 ^= (IrtIndex ^ v14) & 0x3FFFFFFF;
HalpIommuUpdateRemappingTableEntry(0, v14 & 0x3FFFFFFF, v10);
*(_DWORD *)(v10 + 24) = 7;
*(_DWORD *)(v10 + 32) = v14 & 0x3FFFFFFF;
goto LABEL_15;
}
*(_DWORD *)(v3 + 312) = 1796;
LABEL_25:
*(_DWORD *)(v3 + 296) = v0;
HalpInterruptLastProblem = 31;
*(_DWORD *)(v3 + 292) = 31;
*(_QWORD *)(v3 + 304) = "minkernel\\hals\\lib\\interrupts\\common\\intrupt.c";
return(unsigned int)v0;
}Referenced by:
HalpInitializeInterruptsBspLate