@@ -1382,6 +1382,11 @@ void HyperThreading(RO(SHM_STRUCT) *RO(Shm), RO(PROC) *RO(Proc))
1382
1382
RO (Shm )-> Proc .Features .HyperThreading = RO (Proc )-> Features .HTT_Enable ;
1383
1383
}
1384
1384
1385
+ double TW_Manufacturer (unsigned short Y , unsigned short Z , double TU )
1386
+ {
1387
+ return (1 << Y ) * (1 + Z /4 ) * TU ;
1388
+ }
1389
+
1385
1390
void PowerInterface (RO (SHM_STRUCT ) * RO (Shm ), RO (PROC ) * RO (Proc ))
1386
1391
{
1387
1392
unsigned short pwrUnits = 0 , pwrVal ;
@@ -1490,20 +1495,16 @@ void PowerInterface(RO(SHM_STRUCT) *RO(Shm), RO(PROC) *RO(Proc))
1490
1495
}
1491
1496
for (pw = PWR_DOMAIN (PKG ); pw < PWR_DOMAIN (SIZE ); pw ++ )
1492
1497
{
1493
- unsigned long long duration ;
1494
- duration = (1 << RO (Proc )-> PowerThermal .PowerLimit [pw ].TimeWindow1_Y );
1495
- duration *= (4 + RO (Proc )-> PowerThermal .PowerLimit [pw ].TimeWindow1_Z );
1496
- duration = duration >> 2 ;
1497
-
1498
- RO (Shm )-> Proc .Power .Domain [pw ].TW1 = RO (Shm )-> Proc .Power .Unit .Times
1499
- * (double )duration ;
1500
-
1501
- duration = (1 << RO (Proc )-> PowerThermal .PowerLimit [pw ].TimeWindow2_Y );
1502
- duration *= (4 + RO (Proc )-> PowerThermal .PowerLimit [pw ].TimeWindow2_Z );
1503
- duration = duration >> 2 ;
1504
-
1505
- RO (Shm )-> Proc .Power .Domain [pw ].TW2 = RO (Shm )-> Proc .Power .Unit .Times
1506
- * (double )duration ;
1498
+ RO (Shm )-> Proc .Power .Domain [pw ].TW1 = TW_Manufacturer (
1499
+ RO (Proc )-> PowerThermal .PowerLimit [pw ].TimeWindow1_Y ,
1500
+ RO (Proc )-> PowerThermal .PowerLimit [pw ].TimeWindow1_Z ,
1501
+ RO (Shm )-> Proc .Power .Unit .Times
1502
+ );
1503
+ RO (Shm )-> Proc .Power .Domain [pw ].TW2 = TW_Manufacturer (
1504
+ RO (Proc )-> PowerThermal .PowerLimit [pw ].TimeWindow2_Y ,
1505
+ RO (Proc )-> PowerThermal .PowerLimit [pw ].TimeWindow2_Z ,
1506
+ RO (Shm )-> Proc .Power .Unit .Times
1507
+ );
1507
1508
}
1508
1509
RO (Shm )-> Proc .Power .TDC = RO (Proc )-> PowerThermal .TDC ;
1509
1510
RO (Shm )-> Proc .Power .Feature .TDC = RO (Proc )-> PowerThermal .Enable_Limit .TDC ;
0 commit comments