riscv: Add the make function for SBI version
authormason.huo <mason.huo@starfivetech.com>
Wed, 22 Jun 2022 05:11:59 +0000 (13:11 +0800)
committermason.huo <mason.huo@starfivetech.com>
Tue, 5 Jul 2022 05:40:17 +0000 (13:40 +0800)
After cherry pick the riscv cpuidle driver,
there is a compilation error due to lack of
sbi_mk_version(); add it manually.

Signed-off-by: mason.huo <mason.huo@starfivetech.com>
arch/riscv/include/asm/sbi.h

index aca43fc..f59c9b0 100644 (file)
@@ -164,6 +164,14 @@ static inline unsigned long sbi_minor_version(void)
        return sbi_spec_version & SBI_SPEC_VERSION_MINOR_MASK;
 }
 
+/* Make SBI version */
+static inline unsigned long sbi_mk_version(unsigned long major,
+                                           unsigned long minor)
+{
+       return ((major & SBI_SPEC_VERSION_MAJOR_MASK) <<
+               SBI_SPEC_VERSION_MAJOR_SHIFT) | minor;
+}
+
 int sbi_err_map_linux_errno(int err);
 #else /* CONFIG_RISCV_SBI */
 static inline int sbi_remote_fence_i(const unsigned long *hart_mask) { return -1; }