Date: Tue, 30 Jul 2019 12:17:12 +0000 (UTC) From: Ganbold Tsagaankhuu <ganbold@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350439 - stable/12/sys/arm64/arm64 Message-ID: <201907301217.x6UCHCmU050400@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ganbold Date: Tue Jul 30 12:17:11 2019 New Revision: 350439 URL: https://svnweb.freebsd.org/changeset/base/350439 Log: MFC r346993 Add a hw.model sysctl oid for arm64 which reports the CPU model similar to armv6/7. Modified: stable/12/sys/arm64/arm64/identcpu.c Modified: stable/12/sys/arm64/arm64/identcpu.c ============================================================================== --- stable/12/sys/arm64/arm64/identcpu.c Tue Jul 30 08:53:03 2019 (r350438) +++ stable/12/sys/arm64/arm64/identcpu.c Tue Jul 30 12:17:11 2019 (r350439) @@ -52,6 +52,10 @@ char machine[] = "arm64"; SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, "Machine class"); +static char cpu_model[64]; +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, + cpu_model, sizeof(cpu_model), "Machine model"); + /* * Per-CPU affinity as provided in MPIDR_EL1 * Indexed by CPU number in logical order selected by the system. @@ -1292,6 +1296,10 @@ identify_cpu(void) cpu_desc[cpu].cpu_revision = CPU_REV(midr); cpu_desc[cpu].cpu_variant = CPU_VAR(midr); + + snprintf(cpu_model, sizeof(cpu_model), "%s %s r%dp%d", + cpu_desc[cpu].cpu_impl_name, cpu_desc[cpu].cpu_part_name, + cpu_desc[cpu].cpu_variant, cpu_desc[cpu].cpu_revision); /* Save affinity for current CPU */ cpu_desc[cpu].mpidr = get_mpidr();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907301217.x6UCHCmU050400>