Chameleon

Chameleon Commit Details

Date:2017-07-16 22:57:08 (6 months 2 days ago)
Author:ErmaC
Commit:2890
Parents: 2889
Message:Preliminary AMD Ryzer support (Credits to Bronya)
Changes:
M/branches/ErmaC/Enoch/i386/libsaio/cpu.c
M/branches/ErmaC/Enoch/i386/libsaio/platform.h

File differences

branches/ErmaC/Enoch/i386/libsaio/cpu.c
11121112
11131113
11141114
1115
11151116
11161117
11171118
......
11321133
11331134
11341135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
11351158
11361159
11371160
uint64_t cpuMult;
uint64_t divisor = 0;
uint64_t did;
uint64_t fid;
cofvid = rdmsr64(K10_COFVID_STATUS);
}
break;
case 0x17: /*** Bronya: For AMD Family 17h Ryzen ***/
{
uint64_t cpuMult;
uint64_t CpuDfsId;
uint64_t CpuFid;
uint64_t prfsts = 0;
prfsts = rdmsr64(AMD_PSTATE0_STS);
CpuDfsId = bitfield(prfsts, 13, 8);
CpuFid = bitfield(prfsts, 7, 0);
cpuMult = (CpuFid / CpuDfsId) * 2;
cpuMultN2 = (prfsts & (uint64_t)bit(0));
currdiv = cpuMultN2;
/****** Addon END ******/
}
break;
default:
{
typedef unsigned long long vlong;
branches/ErmaC/Enoch/i386/libsaio/platform.h
345345
346346
347347
348
348349
349350
350351
#define MSR_AMD_MPERF0x000000E7
#define MSR_AMD_APERF0x000000E8
#define AMD_PSTATE0_STS0xC0010064
#define DEFAULT_FSB100000 /* for now, hardcoding 100MHz for old CPUs */

Archive Download the corresponding diff file

Revision: 2890