riscv: add SBI implementation IDs.

Add new SBI implementation IDs including recently allocated one for bhyve.

Reviewed by:	mhorne
Sponsored by:	UKRI
Differential Revision:	https://reviews.freebsd.org/D45696
This commit is contained in:
Ruslan Bukin 2024-06-25 12:25:26 +01:00
parent 8521ea135f
commit d5963606f0
2 changed files with 29 additions and 4 deletions

View File

@ -49,6 +49,12 @@
#define SBI_IMPL_ID_KVM 3
#define SBI_IMPL_ID_RUSTSBI 4
#define SBI_IMPL_ID_DIOSIX 5
#define SBI_IMPL_ID_COFFER 6
#define SBI_IMPL_ID_XEN_PROJECT 7
#define SBI_IMPL_ID_POLARFIRE_HSS 8
#define SBI_IMPL_ID_COREBOOT 9
#define SBI_IMPL_ID_OREBOOT 10
#define SBI_IMPL_ID_BHYVE 11
/* SBI Error Codes */
#define SBI_SUCCESS 0

View File

@ -132,6 +132,11 @@ sbi_print_version(void)
case (SBI_IMPL_ID_BBL):
printf("SBI: Berkely Boot Loader %lu\n", 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);
break;
case (SBI_IMPL_ID_XVISOR):
printf("SBI: eXtensible Versatile hypervISOR %lu\n",
sbi_impl_version);
@ -146,10 +151,24 @@ sbi_print_version(void)
case (SBI_IMPL_ID_DIOSIX):
printf("SBI: Diosix %lu\n", 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);
case (SBI_IMPL_ID_COFFER):
printf("SBI: Coffer %lu\n", sbi_impl_version);
break;
case (SBI_IMPL_ID_XEN_PROJECT):
printf("SBI: Xen Project %lu\n", sbi_impl_version);
break;
case (SBI_IMPL_ID_POLARFIRE_HSS):
printf("SBI: PolarFire Hart Software Services %lu\n",
sbi_impl_version);
break;
case (SBI_IMPL_ID_COREBOOT):
printf("SBI: coreboot %lu\n", sbi_impl_version);
break;
case (SBI_IMPL_ID_OREBOOT):
printf("SBI: oreboot %lu\n", sbi_impl_version);
break;
case (SBI_IMPL_ID_BHYVE):
printf("SBI: bhyve %lu\n", sbi_impl_version);
break;
default:
printf("SBI: Unrecognized Implementation: %lu\n", sbi_impl_id);