From b122c2bf6273f0e50d9057059be8219c08e8f7c1 Mon Sep 17 00:00:00 2001 From: jsg Date: Sat, 29 Apr 2017 10:05:49 +0000 Subject: [PATCH] store cpu model information in the buffer used by the hw.model sysctl ok kettenis@ --- sys/arch/arm64/arm64/cpu.c | 8 +++++++- sys/arch/arm64/arm64/machdep.c | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/arch/arm64/arm64/cpu.c b/sys/arch/arm64/arm64/cpu.c index a9ee4608283..41c9b81b883 100644 --- a/sys/arch/arm64/arm64/cpu.c +++ b/sys/arch/arm64/arm64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.1 2017/04/27 10:23:19 kettenis Exp $ */ +/* $OpenBSD: cpu.c,v 1.2 2017/04/29 10:05:49 jsg Exp $ */ /* * Copyright (c) 2016 Dale Rahn @@ -67,6 +67,8 @@ const struct implementers { { 0, "", NULL }, }; +char cpu_model[64]; + int cpu_match(struct device *, void *, void *); void cpu_attach(struct device *, struct device *, void *); @@ -108,6 +110,10 @@ cpu_identify(struct cpu_info *ci) printf(" %s %s r%dp%d", impl_name, part_name, CPU_VAR(midr), CPU_REV(midr)); + + if (CPU_IS_PRIMARY(ci)) + snprintf(cpu_model, sizeof(cpu_model), "%s %s r%dp%d", + impl_name, part_name, CPU_VAR(midr), CPU_REV(midr)); } int diff --git a/sys/arch/arm64/arm64/machdep.c b/sys/arch/arm64/arm64/machdep.c index be7c3b18216..b755b43552b 100644 --- a/sys/arch/arm64/arm64/machdep.c +++ b/sys/arch/arm64/arm64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.13 2017/04/11 06:52:13 kettenis Exp $ */ +/* $OpenBSD: machdep.c,v 1.14 2017/04/29 10:05:49 jsg Exp $ */ /* * Copyright (c) 2014 Patrick Wildt * @@ -77,7 +77,6 @@ struct uvm_constraint_range *uvm_md_constraints[] = { NULL }; /* the following is used externally (sysctl_hw) */ char machine[] = MACHINE; /* from */ -char cpu_model[] = "arm64"; // XXX FIX extern todr_chip_handle_t todr_handle; int safepri = 0; -- 2.20.1