Project

General

Profile

Bug #3025 ยป 0001-Fix-powernow.c.patch

powernow.c patch - lubos, 09/23/2017 07:43 AM

View differences:

sys/dev/powermng/powernow/powernow.c
do { \
(status) = rdmsr(MSR_AMDK7_FIDVID_STATUS); \
} while (PN8_STA_PENDING(status))
#define abs(x) ( (x) < 0 ? -(x) : (x) )
#define diff(x, y) ((x) > (y) ? (x) - (y) : (y) - (x))
#define POWERNOW_MAX_STATES 16
......
uint32_t vco_fid, vco_cfid;
vco_fid = FID_TO_VCO_FID(fid);
vco_cfid = FID_TO_VCO_FID(cfid);
while (abs(vco_fid - vco_cfid) > 2) {
while (diff(vco_fid, vco_cfid) > 2) {
if (fid > cfid) {
if (cfid > 6)
val = cfid + 2;
    (1-1/1)