renamed few struct about SOC
This commit is contained in:
parent
c8620f8d6a
commit
14fbb968ec
@ -87,7 +87,10 @@ namespace hgl
|
|||||||
uint32 value;
|
uint32 value;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ARMCpuInfo
|
/**
|
||||||
|
* ARM CPU 核心信息
|
||||||
|
*/
|
||||||
|
struct ARMCpuCoreInfo
|
||||||
{
|
{
|
||||||
ARMCpuName name;
|
ARMCpuName name;
|
||||||
|
|
||||||
@ -99,7 +102,7 @@ namespace hgl
|
|||||||
|
|
||||||
const uint32 ParseARMCpuName(const char *); ///<根据字符串解晰ARM CPU名称ID
|
const uint32 ParseARMCpuName(const char *); ///<根据字符串解晰ARM CPU名称ID
|
||||||
|
|
||||||
bool ParseARMCpuInfo(ARMCpuInfo *,const uint32 &cpu_name_id); ///<根据ARM CPU名字ID解晰CPU信息
|
bool ParseARMCpuCoreInfo(ARMCpuCoreInfo *,const uint32 &cpu_name_id); ///<根据ARM CPU名字ID解晰CPU信息
|
||||||
|
|
||||||
enum class KryoArchLevel
|
enum class KryoArchLevel
|
||||||
{
|
{
|
||||||
@ -111,12 +114,12 @@ namespace hgl
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 高通 Kryo CPU核心信息<br>
|
* ARM CPU簇信息<br>
|
||||||
* 注:这里的频率单位为MHz,而且只是默认频率,实际频率可能会更高或更低
|
* 注:这里的频率单位为MHz,而且只是默认频率,实际频率可能会更高或更低
|
||||||
*/
|
*/
|
||||||
struct KryoCpuCoreInfo
|
struct ARMCpuClusterInfo
|
||||||
{
|
{
|
||||||
ARMCpuInfo arm; ///<对应的ARM处理器
|
ARMCpuCoreInfo arm; ///<对应的ARM核心信息
|
||||||
|
|
||||||
uint core_count; ///<核心数量
|
uint core_count; ///<核心数量
|
||||||
|
|
||||||
@ -124,29 +127,18 @@ namespace hgl
|
|||||||
uint boost_freq; ///<最高频率
|
uint boost_freq; ///<最高频率
|
||||||
};
|
};
|
||||||
|
|
||||||
struct KryoCPUInfo
|
struct SOCInfo
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Kryo CPU 型号
|
|
||||||
* 旧系列直接使用数字型号,新的6gen1/7gen1/8gen1之类,直接写为601/701/801
|
|
||||||
*/
|
|
||||||
uint model;
|
|
||||||
|
|
||||||
KryoCpuCoreInfo core[size_t(KryoArchLevel::RANGE_SIZE)];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct SOCModel
|
|
||||||
{
|
{
|
||||||
SOCVendor vendor;
|
SOCVendor vendor;
|
||||||
char model[32];
|
char model[32];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CompOperatorMemcmp(const SOCModel &);
|
CompOperatorMemcmp(const SOCInfo &);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据收集到的SOC信息,解晰具体的SOC厂商和主要型号
|
* 根据收集到的SOC信息,解晰具体的SOC厂商和主要型号
|
||||||
*/
|
*/
|
||||||
bool ParseSOCModel(SOCModel &,const char *);
|
bool ParseSOCInfo(SOCInfo &,const char *);
|
||||||
}//namespace hgl
|
}//namespace hgl
|
||||||
|
@ -58,7 +58,7 @@ namespace hgl
|
|||||||
return arm_cpu_name.value;
|
return arm_cpu_name.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParseARMCpuInfo(ARMCpuInfo *info,const uint32 &cpu_name_id)
|
bool ParseARMCpuCoreInfo(ARMCpuCoreInfo *info,const uint32 &cpu_name_id)
|
||||||
{
|
{
|
||||||
if(!info)return(false);
|
if(!info)return(false);
|
||||||
if(cpu_name_id==0)return(false);
|
if(cpu_name_id==0)return(false);
|
||||||
|
@ -5,7 +5,7 @@ using namespace hgl;
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
bool isQualcomm(SOCModel &soc,const char *soc_name)
|
bool isQualcomm(SOCInfo &soc,const char *soc_name)
|
||||||
{
|
{
|
||||||
const char *p=hgl::stristr(soc_name,hgl::strlen(soc_name),"Qualcomm ",9);
|
const char *p=hgl::stristr(soc_name,hgl::strlen(soc_name),"Qualcomm ",9);
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ namespace
|
|||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isMediaTek(SOCModel &soc,const char *soc_name)
|
bool isMediaTek(SOCInfo &soc,const char *soc_name)
|
||||||
{
|
{
|
||||||
const char *p=hgl::stristr(soc_name,hgl::strlen(soc_name),"MTK ",4);
|
const char *p=hgl::stristr(soc_name,hgl::strlen(soc_name),"MTK ",4);
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ namespace
|
|||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isUnisoc(SOCModel &soc,const char *soc_name)
|
bool isUnisoc(SOCInfo &soc,const char *soc_name)
|
||||||
{
|
{
|
||||||
const char *p=hgl::stristr(soc_name,hgl::strlen(soc_name),"Unisoc",6);
|
const char *p=hgl::stristr(soc_name,hgl::strlen(soc_name),"Unisoc",6);
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ namespace
|
|||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isKirin(SOCModel &soc,const char *soc_name)
|
bool isKirin(SOCInfo &soc,const char *soc_name)
|
||||||
{
|
{
|
||||||
const char *p=hgl::stristr(soc_name,hgl::strlen(soc_name),"Kirin",5);
|
const char *p=hgl::stristr(soc_name,hgl::strlen(soc_name),"Kirin",5);
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ namespace
|
|||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isExynos(SOCModel &soc,const char *soc_name)
|
bool isExynos(SOCInfo &soc,const char *soc_name)
|
||||||
{
|
{
|
||||||
const char *p=hgl::stristr(soc_name,hgl::strlen(soc_name),"Exynos",6);
|
const char *p=hgl::stristr(soc_name,hgl::strlen(soc_name),"Exynos",6);
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ namespace
|
|||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isSpreadtrum(SOCModel &soc,const char *soc_name)
|
bool isSpreadtrum(SOCInfo &soc,const char *soc_name)
|
||||||
{
|
{
|
||||||
const char *p=hgl::stristr(soc_name,hgl::strlen(soc_name),"Spreadtrum",10);
|
const char *p=hgl::stristr(soc_name,hgl::strlen(soc_name),"Spreadtrum",10);
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ namespace
|
|||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isJLQ(SOCModel &soc,const char *soc_name)
|
bool isJLQ(SOCInfo &soc,const char *soc_name)
|
||||||
{
|
{
|
||||||
const char *p=hgl::stristr(soc_name,hgl::strlen(soc_name),"JLQ ",4);
|
const char *p=hgl::stristr(soc_name,hgl::strlen(soc_name),"JLQ ",4);
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ namespace
|
|||||||
|
|
||||||
namespace hgl
|
namespace hgl
|
||||||
{
|
{
|
||||||
bool ParseSOCModel(SOCModel &soc,const char *soc_name)
|
bool ParseSOCInfo(SOCInfo &soc,const char *soc_name)
|
||||||
{
|
{
|
||||||
hgl_zero(soc);
|
hgl_zero(soc);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user