PpmRegisterPerfCap
INT64 __fastcall PpmRegisterPerfCap(INT64 *a1){
unsigned int v2;
unsigned int v3;
__int64 v4;
__int64 v5;
INT64 v6;
unsigned int v7;
int v8;
int v9;
__int64 v11;
INT64 v12;
unsigned int v13;
unsigned int v14;
__int64 v15;
__int64 v16;
__int64 v17;
PpmAcquireLock(&PpmPerfPolicyLock);
v2 = 0;
if( !*((_DWORD *)a1 + 5) )
{
v3 = *((_DWORD *)a1 + 1);
if( v3 != -1 )
{
KeGetPrcb(v3);
v5 = *(_QWORD *)(v4 + 33136);
v6 = *(_QWORD *)(v4 + 33128);
goto LABEL_4;
}
LABEL_33:
PpmReleaseLock(&PpmPerfPolicyLock);
return(unsigned int)-1073741811;
}
v12 = PpmPerfDomainHead;
v3 = -1;
v5 = 0i64;
if( (INT64 *)PpmPerfDomainHead == &PpmPerfDomainHead )
goto LABEL_33;
do
{
v13 = *(_DWORD *)(v12 + 200);
v6 = v12;
v14 = 0;
if( v13 )
{
v15 = *(_QWORD *)(v12 + 216);
while( 1 )
{
v16 = v15 + 136i64 * v14;
if( *(_DWORD *)(v16 + 16) )
{
if( *(_DWORD *)(v16 + 20) == *((_DWORD *)a1 + 1) )
break;
}
if( ++v14 >= v13 )
goto LABEL_25;
}
v5 = v15 + 136i64 * v14;
if( v16 )
break;
}
LABEL_25:
v12 = *(_QWORD *)v12;
}
while( (INT64 *)v12 != &PpmPerfDomainHead );
LABEL_4:
if( !v6 || !v5 )
goto LABEL_33;
v7 = *((_DWORD *)a1 + 2);
v8 = *((_DWORD *)a1 + 3);
*(_DWORD *)(v5 + 32) = *((_DWORD *)a1 + 4);
v9 = *(_DWORD *)(v5 + 24);
if( v9 != v7 )
{
if( v9 == 100 )
{
*(_QWORD *)(v5 + 40) = *(_QWORD *)&KUSER_SHARED_DATA.InterruptTime.LowPart;
}
else if( v7 == 100 )
{
PopDiagTraceProcessorThrottleDurationPerfTrack(
(*(_QWORD *)&KUSER_SHARED_DATA.InterruptTime.LowPart - *(_QWORD *)(v5 + 40)) / 0x2710ui64,
v3);
*(_QWORD *)(v5 + 40) = 0i64;
}
v11 = *(_QWORD *)v5;
*(_DWORD *)(v5 + 24) = v7;
if( v11 )
{
PpmEventBiosCapChange(v11, v7);
}
else if( !*(_DWORD *)(v6 + 208) )
{
PpmEventHiddenProcessorBiosCapChange(
(UINT16 *)(*(_QWORD *)(v6 + 16) - 33128i64),
*((unsigned int *)a1 + 1),
(EVENT_DESCRIPTOR *)v7);
}
PopDiagTraceProcessorThrottlePerfTrack(100 - v7, v3);
}
if( *(_DWORD *)(v5 + 28) != v8 )
{
v17 = *(_QWORD *)v5;
*(_DWORD *)(v5 + 28) = v8;
if( v17 )
{
PpmEventThermalCapChange(v17, v8);
}
else if( !*(_DWORD *)(v6 + 208) )
{
PpmEventHiddenProcessorThermalCapChange(
(_EFI_DRIVER_ENTRY *)(*(_QWORD *)(v6 + 16) - 33128i64),
(UINT64 *)*((unsigned int *)a1 + 1));
}
}
*(_BYTE *)(v6 + 765) = 1;
PpmCheckApplyPerfConstraints(0);
return v2;
}Referenced by:
No references.