diff --git a/sys/riscv/include/sbi.h b/sys/riscv/include/sbi.h --- a/sys/riscv/include/sbi.h +++ b/sys/riscv/include/sbi.h @@ -172,6 +172,24 @@ return (SBI_CALL1(SBI_EXT_ID_BASE, SBI_BASE_PROBE_EXTENSION, id).value); } +static __inline u_long +sbi_get_mvendorid(void) +{ + return (SBI_CALL0(SBI_EXT_ID_BASE, SBI_BASE_GET_MVENDORID).value); +} + +static __inline u_long +sbi_get_marchid(void) +{ + return (SBI_CALL0(SBI_EXT_ID_BASE, SBI_BASE_GET_MARCHID).value); +} + +static __inline u_long +sbi_get_mimpid(void) +{ + return (SBI_CALL0(SBI_EXT_ID_BASE, SBI_BASE_GET_MIMPID).value); +} + /* TIME extension functions. */ void sbi_set_timer(uint64_t val); diff --git a/sys/riscv/riscv/sbi.c b/sys/riscv/riscv/sbi.c --- a/sys/riscv/riscv/sbi.c +++ b/sys/riscv/riscv/sbi.c @@ -79,24 +79,6 @@ return (SBI_CALL0(SBI_EXT_ID_BASE, SBI_BASE_GET_IMPL_VERSION)); } -static struct sbi_ret -sbi_get_mvendorid(void) -{ - return (SBI_CALL0(SBI_EXT_ID_BASE, SBI_BASE_GET_MVENDORID)); -} - -static struct sbi_ret -sbi_get_marchid(void) -{ - return (SBI_CALL0(SBI_EXT_ID_BASE, SBI_BASE_GET_MARCHID)); -} - -static struct sbi_ret -sbi_get_mimpid(void) -{ - return (SBI_CALL0(SBI_EXT_ID_BASE, SBI_BASE_GET_MIMPID)); -} - static void sbi_shutdown_final(void *dummy __unused, int howto) { @@ -307,9 +289,9 @@ sbi_impl_version = sbi_get_impl_version().value; /* Set the hardware implementation info. */ - mvendorid = sbi_get_mvendorid().value; - marchid = sbi_get_marchid().value; - mimpid = sbi_get_mimpid().value; + mvendorid = sbi_get_mvendorid(); + marchid = sbi_get_marchid(); + mimpid = sbi_get_mimpid(); /* Probe for legacy replacement extensions. */ if (sbi_probe_extension(SBI_EXT_ID_TIME) != 0)