From e7a57e0ab745d1c5f9a47ac241ee3c595298aa50 Mon Sep 17 00:00:00 2001 From: jca Date: Tue, 6 Dec 2022 00:11:23 +0000 Subject: [PATCH] Print SBI vendor, version and implemented spec version On my Unmatched: SBI: OpenSBI v0.9, SBI Specification Version 0.2 ok mlarkin@ --- sys/arch/riscv64/riscv64/machdep.c | 4 +++- sys/arch/riscv64/riscv64/sbi.c | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/arch/riscv64/riscv64/machdep.c b/sys/arch/riscv64/riscv64/machdep.c index 61ea8541113..60debb0b388 100644 --- a/sys/arch/riscv64/riscv64/machdep.c +++ b/sys/arch/riscv64/riscv64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.29 2022/10/30 17:43:40 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.30 2022/12/06 00:11:23 jca Exp $ */ /* * Copyright (c) 2014 Patrick Wildt @@ -273,6 +273,8 @@ cpu_startup(void) printf("avail mem = %lu (%luMB)\n", ptoa(uvmexp.free), ptoa(uvmexp.free) / 1024 / 1024); + sbi_print_version(); + curpcb = &proc0.p_addr->u_pcb; curpcb->pcb_flags = 0; curpcb->pcb_tf = &proc0tf; diff --git a/sys/arch/riscv64/riscv64/sbi.c b/sys/arch/riscv64/riscv64/sbi.c index 8c85a708284..57b90aad434 100644 --- a/sys/arch/riscv64/riscv64/sbi.c +++ b/sys/arch/riscv64/riscv64/sbi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sbi.c,v 1.6 2021/07/02 08:44:37 kettenis Exp $ */ +/* $OpenBSD: sbi.c,v 1.7 2022/12/06 00:11:23 jca Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD @@ -76,22 +76,22 @@ sbi_print_version(void) switch (sbi_impl_id) { case (SBI_IMPL_ID_BBL): - printf("SBI: Berkely Boot Loader %lu\n", sbi_impl_version); + printf("SBI: Berkely Boot Loader %lu", sbi_impl_version); break; case (SBI_IMPL_ID_OPENSBI): major = sbi_impl_version >> OPENSBI_VERSION_MAJOR_OFFSET; minor = sbi_impl_version & OPENSBI_VERSION_MINOR_MASK; - printf("SBI: OpenSBI v%u.%u\n", major, minor); + printf("SBI: OpenSBI v%u.%u", major, minor); break; default: - printf("SBI: Unrecognized Implementation: %lu\n", sbi_impl_id); + printf("SBI: Unrecognized Implementation: %lu", sbi_impl_id); break; } major = (sbi_spec_version & SBI_SPEC_VERS_MAJOR_MASK) >> SBI_SPEC_VERS_MAJOR_OFFSET; minor = (sbi_spec_version & SBI_SPEC_VERS_MINOR_MASK); - printf("SBI Specification Version: %u.%u\n", major, minor); + printf(", SBI Specification Version %u.%u\n", major, minor); } #ifdef MULTIPROCESSOR -- 2.20.1