From: Xi Ruoyao Date: Wed, 22 Mar 2023 12:44:19 +0000 (+0800) Subject: lscpu: Parse loongarch specific lines X-Git-Tag: v2.39-rc2~20^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=59370266151d2bcbe103fab053ad7db85cb02825;p=thirdparty%2Futil-linux.git lscpu: Parse loongarch specific lines /proc/cpuinfo on loongarch uses UPPERCASE letters in some field names. Add the patterns for them. "Address Sizes", "CPU Family", "CPU Revision" (aka "Model"), and "Model Name" are correctly outputed, but "CPU MHz" not (because we don't have a CPUFreq driver yet). Signed-off-by: Xi Ruoyao --- diff --git a/sys-utils/lscpu-cputype.c b/sys-utils/lscpu-cputype.c index 31f4009bce..79805b540f 100644 --- a/sys-utils/lscpu-cputype.c +++ b/sys-utils/lscpu-cputype.c @@ -192,12 +192,16 @@ static const struct cpuinfo_pattern type_patterns[] = { /* Sort by fields name! */ DEF_PAT_CPUTYPE( "ASEs implemented", PAT_FLAGS, flags), /* mips */ + DEF_PAT_CPUTYPE( "Address Sizes", PAT_ADDRESS_SIZES, addrsz),/* loongarch */ DEF_PAT_CPUTYPE( "BogoMIPS", PAT_BOGOMIPS, bogomips), /* aarch64 */ + DEF_PAT_CPUTYPE( "CPU Family", PAT_FAMILY, family), /* loongarch */ + DEF_PAT_CPUTYPE( "CPU Revision", PAT_REVISION, revision), /* loongarch */ DEF_PAT_CPUTYPE( "CPU implementer", PAT_IMPLEMENTER,vendor), /* ARM and aarch64 */ DEF_PAT_CPUTYPE( "CPU part", PAT_PART, model), /* ARM and aarch64 */ DEF_PAT_CPUTYPE( "CPU revision", PAT_REVISION, revision), /* aarch64 */ DEF_PAT_CPUTYPE( "CPU variant", PAT_VARIANT, stepping), /* aarch64 */ DEF_PAT_CPUTYPE( "Features", PAT_FEATURES, flags), /* aarch64 */ + DEF_PAT_CPUTYPE( "Model Name", PAT_MODEL_NAME, modelname), /* loongarch */ DEF_PAT_CPUTYPE( "address sizes", PAT_ADDRESS_SIZES, addrsz),/* x86 */ DEF_PAT_CPUTYPE( "bogomips per cpu", PAT_BOGOMIPS, bogomips), /* s390 */ DEF_PAT_CPUTYPE( "cpu", PAT_CPU, modelname), /* ppc, sparc */ @@ -230,6 +234,7 @@ static const struct cpuinfo_pattern type_patterns[] = static const struct cpuinfo_pattern cpu_patterns[] = { /* Sort by fields name! */ + DEF_PAT_CPU( "CPU MHz", PAT_MHZ, mhz), /* loongarch */ DEF_PAT_CPU( "bogomips", PAT_BOGOMIPS_CPU, bogomips), DEF_PAT_CPU( "cpu MHz", PAT_MHZ, mhz), DEF_PAT_CPU( "cpu MHz dynamic", PAT_MHZ_DYNAMIC, dynamic_mhz), /* s390 */