summaryrefslogtreecommitdiffstats
path: root/sys/arm/arm
diff options
context:
space:
mode:
authorLuiz Otavio O Souza <luiz@netgate.com>2016-11-24 23:26:28 -0600
committerLuiz Souza <luiz@netgate.com>2017-07-20 21:28:14 -0500
commit8ee9085fe470bcbb4aa11fe569789193cdeaa8e8 (patch)
tree3d7834ac050eddeffd726a4057a837cf6ef43ccc /sys/arm/arm
parent76cd66f34eaad69e0a11f22000b298d12d1c6c45 (diff)
downloadFreeBSD-src-8ee9085fe470bcbb4aa11fe569789193cdeaa8e8.zip
FreeBSD-src-8ee9085fe470bcbb4aa11fe569789193cdeaa8e8.tar.gz
Export the CPU model as hw.model.
(cherry picked from commit 3a10a90e55b9cd00bf9c1343ff5df940cdd16a19)
Diffstat (limited to 'sys/arm/arm')
-rw-r--r--sys/arm/arm/identcpu-v4.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/arm/arm/identcpu-v4.c b/sys/arm/arm/identcpu-v4.c
index 769f0b3..382f445 100644
--- a/sys/arm/arm/identcpu-v4.c
+++ b/sys/arm/arm/identcpu-v4.c
@@ -54,7 +54,10 @@ __FBSDID("$FreeBSD$");
#include <machine/md_var.h>
char machine[] = "arm";
+static char cpu_model[128];
+SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_MPSAFE,
+ cpu_model, 0, "Machine model");
SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD,
machine, 0, "Machine class");
@@ -309,6 +312,13 @@ identify_arm_cpu(void)
for (i = 0; cpuids[i].cpuid != 0; i++)
if (cpuids[i].cpuid == (cpuid & CPU_ID_CPU_MASK)) {
cpu_class = cpuids[i].cpu_class;
+ memset(cpu_model, 0, sizeof(cpu_model));
+ snprintf(cpu_model, sizeof(cpu_model) - 1,
+ "CPU: %s %s (%s core)\n",
+ cpuids[i].cpu_name,
+ cpuids[i].cpu_steppings[cpuid &
+ CPU_ID_REVISION_MASK],
+ cpu_classes[cpu_class].class_name);
printf("CPU: %s %s (%s core)\n",
cpuids[i].cpu_name,
cpuids[i].cpu_steppings[cpuid &
OpenPOWER on IntegriCloud