renamed few struct about SOC

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-07-28 10:34:27 +08:00
parent c8620f8d6a
commit 14fbb968ec
3 changed files with 21 additions and 29 deletions

View File

@ -87,7 +87,10 @@ namespace hgl
uint32 value;
};
struct ARMCpuInfo
/**
* ARM CPU
*/
struct ARMCpuCoreInfo
{
ARMCpuName name;
@ -99,7 +102,7 @@ namespace hgl
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
{
@ -111,12 +114,12 @@ namespace hgl
};
/**
* Kryo CPU核心信息<br>
* ARM CPU簇信息<br>
* MHz
*/
struct KryoCpuCoreInfo
struct ARMCpuClusterInfo
{
ARMCpuInfo arm; ///<对应的ARM处理器
ARMCpuCoreInfo arm; ///<对应的ARM核心信息
uint core_count; ///<核心数量
@ -124,29 +127,18 @@ namespace hgl
uint boost_freq; ///<最高频率
};
struct KryoCPUInfo
{
/**
* Kryo CPU
* 使6gen1/7gen1/8gen1之类601/701/801
*/
uint model;
KryoCpuCoreInfo core[size_t(KryoArchLevel::RANGE_SIZE)];
};
struct SOCModel
struct SOCInfo
{
SOCVendor vendor;
char model[32];
public:
CompOperatorMemcmp(const SOCModel &);
CompOperatorMemcmp(const SOCInfo &);
};
/**
* SOC信息SOC厂商和主要型号
*/
bool ParseSOCModel(SOCModel &,const char *);
bool ParseSOCInfo(SOCInfo &,const char *);
}//namespace hgl

View File

@ -58,7 +58,7 @@ namespace hgl
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(cpu_name_id==0)return(false);

View File

@ -5,7 +5,7 @@ using namespace hgl;
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);
@ -36,7 +36,7 @@ namespace
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);
@ -62,7 +62,7 @@ namespace
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);
@ -83,7 +83,7 @@ namespace
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);
@ -97,7 +97,7 @@ namespace
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);
@ -115,7 +115,7 @@ namespace
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);
@ -133,7 +133,7 @@ namespace
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);
@ -152,7 +152,7 @@ namespace
namespace hgl
{
bool ParseSOCModel(SOCModel &soc,const char *soc_name)
bool ParseSOCInfo(SOCInfo &soc,const char *soc_name)
{
hgl_zero(soc);