cpuinfoex.inc
来自「pipe类 pipe类 pipe类 pipe类 pipe类」· INC 代码 · 共 174 行
INC
174 行
//Getting extended info
function cCPUid.GetExtInfo: boolean;
begin
result:=true;
try
begin
with fCPUid_m do begin
ext_64bit:=(fCPUdata.Extended[1].regEDX shr 29) and $1;
std_vendor_string:=GetStdVendorIDString;
std_family:=(fCPUdata.Standart[1].regEAX shr 8) and $F;
std_model:=(fCPUdata.Standart[1].regEAX shr 4) and $F;
std_stepping:=fCPUdata.Standart[1].regEAX and $F;
std_type:=(fCPUdata.Standart[1].regEAX shr 12) and $2;
std_extfam:=(fCPUdata.Standart[1].regEAX shr 20) and $FF;
std_extmod:=(fCPUdata.Standart[1].regEAX shr 16) and $F;
std_brand:=fCPUdata.Standart[1].regEBX and $FF;
std_clflush:=(fCPUdata.Standart[1].regEBX shr 8) and $FF;
std_ccount:=(fCPUdata.Standart[1].regEBX shr 16) and $FF;
std_apic:=(fCPUdata.Standart[1].regEBX shr 24) and $FF;
ext_vendor_string:=GetExtVendorIDString;
ext_extfamily:=((fCPUdata.Extended[1].regEAX shr 20) and $FF);
ext_extmodel:=((fCPUdata.Extended[1].regEAX shr 16) and $F);
ext_family:=(fCPUdata.Extended[1].regEAX shr 8) and $F;
ext_model:=(fCPUdata.Extended[1].regEAX shr 4) and $F;
ext_stepping:=fCPUdata.Extended[1].regEAX and $F;
ext_brand:=fCPUdata.Extended[1].regEBX and $FFF;
ext_a64Brand:=(fCPUdata.Extended[1].regEBX shr 6) and $3F;
ext_a64BrandNN:=fCPUdata.Extended[1].regEBX and $3F;
GetCPUString(ext_cpu_name);
case std_type of
0: std_typeS:='Primary processor';
1: std_typeS:='Overdrive processor';
2: std_typeS:='Secondary processor';
3: std_typeS:='Reserved';
end;
end;
end;
except
result:=false;
end;
end;
function cCPUid.GetCPUfeatures: boolean;
var
MsrValue: tMSR;
begin
result:=false;
try
begin
with fCPUdata.Standart[1] do
begin
fCPUfeatures.MMX:=(regEDX shr 23) and $1;
fCPUfeatures.SSE:=(regEDX shr 25) and $1;
fCPUfeatures.SSE2:=(regEDX shr 26) and $1;
fCPUfeatures.IA64:=(regEDX shr 30) and $1;
fCPUfeatures.HTT:=(regEDX shr 28) and $1;
fCPUfeatures.CLFlush:=(regEDX shr 19) and $1;
fCPUfeatures.PSN:=(regEDX shr 18) and $1;
fCPUfeatures.APIC:=(regEDX shr 9) and $1;
fCPUfeatures.MSR:=(regEDX shr 5) and $1;
fCPUfeatures.RDTSC:=(regEDX shr 4) and $1;
end;
with fCPUdata.Standart[1] do
begin
fCPUfeatures.SSE3:=regECX and $1;
end;
with fCPUdata.Extended[1] do
begin
fCPUfeatures.f3DNow:=(regEDX shr 31) and $1;
fCPUfeatures.f3DNowex:=(regEDX shr 30) and $1;
if (fFlagBrand = cyrix) then fCPUfeatures.MMXex:=(regEDX shr 24) and $1//MMX+ for Cyrix
else fCPUfeatures.MMXex:=(regEDX shr 22) and $1; //MMX+ for AMD
fCPUfeatures.AA64:=(regEDX shr 29) and $1;
fCPUfeatures.NX:=(regEDX shr 20) and $1;
fCPUfeatures.MP:=(regEDX shr 19) and $1;
end;
if fCPUid_m.std_ccount<2 then fCPUfeatures.HTT:=0;
if (fCPUdata.Extended[0].regEAX >= $80000008) and (fFlagBrand = amd)
then
fCPUfeatures.PhysicalCores := (fCPUdata.Extended[8].regECX and $FF) + 1
else
fCPUfeatures.PhysicalCores := 1;
if (fCPUdata.Standart[0].regEAX >= $00000004) and (fFlagBrand=intel)
then
fCPUfeatures.PhysicalCores := ((fCPUdata.Standart[4].regEAX shr 26) and $3F) + 1
else
fCPUfeatures.PhysicalCores := 1;
if (fFlagBrand=intel) and (fCPUid_m.std_family=$F) then
begin
fCPUfeatures.VanderPool:=(CPUdata.Standart[1].regECX shr 5) and $1;
//fCPUfeatures.LaGrande:=(CPUdata.Standart[1].regECX shr 2) and $1;
end;
if (fFlagBrand=intel) and ((fCPUid_m.std_family=$F) or ((fCPUid_m.std_family=6) and (fCPUid_m.std_model>=7))) then
begin
FillChar(MsrValue, SizeOf(MsrValue), 0);
oHWIO.IMSRIORef.ReadMSR($17, MsrValue);
fCPUfeatures.PlatformID:=(MsrValue.HiPart shr 18) and $7;
FillChar(MsrValue, SizeOf(MsrValue), 0);
oHWIO.IMSRIORef.ReadMSR($8B, MsrValue);
fCPUfeatures.MicrocodID:=MsrValue.HiPart;
end;
end;
except
result:=false;
end;
end;
function cCPUid.GetPowerManag: boolean;
begin
result:=false;
try
begin
if fFlagBrand = amd then fPManagement.PowerNow:=(((fCPUdata.Extended[7].regEDX shr 2) and $1) and ((fCPUdata.Extended[7].regEDX shr 1) and $1));
if (fPManagement.PowerNow=1) and (fCPUid_m.std_family=15) then
begin
fPManagement.CoolnQuiet:=1;
fPManagement.PowerNow:=0;
end;
if fFlagBrand = intel then
begin
fPManagement.EIST:=(fCPUdata.Standart[1].regECX shr 7) and $1;
fPManagement.ODCM:=(fCPUdata.Standart[1].regEDX shr 22) and $1;
fPManagement.TM1:=(fCPUdata.Standart[1].regEDX shr 29) and $1;
fPManagement.TM2:=(fCPUdata.Standart[1].regECX shr 8) and $1;
end;
end;
except
result:=false;
end;
end;
function cCPUid.GetFeaturesFlags: boolean;
var
i: byte;
begin
if fCPUdata.Standart[0].regEAX>=$1 then
begin
if fCPUdata.Standart[1].regEDX>0 then fFeaturesFlags.std1ff.is_avail:=true;
if fCPUdata.Standart[1].regECX>0 then fFeaturesFlags.std2ff.is_avail:=true;
end;
if fCPUdata.Extended[0].regEAX>=$80000001 then
begin
if fCPUdata.Extended[1].regEDX>0 then fFeaturesFlags.ext1ff.is_avail:=true;
if fCPUdata.Extended[1].regECX>0 then fFeaturesFlags.ext2ff.is_avail:=true;
end;
if fFeaturesFlags.std1ff.is_avail then
for i:=0 to 31 do
fFeaturesFlags.std1ff.feature[i]:=(fCPUdata.Standart[1].regEDX shr i) and $1;
if fFeaturesFlags.std2ff.is_avail then
for i:=0 to 31 do
fFeaturesFlags.std2ff.feature[i]:=(fCPUdata.Standart[1].regECX shr i) and $1;
if fFeaturesFlags.ext1ff.is_avail then
for i:=0 to 31 do
fFeaturesFlags.ext1ff.feature[i]:=(fCPUdata.Extended[1].regEDX shr i) and $1;
if fFeaturesFlags.ext2ff.is_avail then
for i:=0 to 31 do
fFeaturesFlags.ext2ff.feature[i]:=(fCPUdata.Extended[1].regECX shr i) and $1;
end;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?