diff options
author | Atish Patra <atish.patra@wdc.com> | 2020-05-09 16:47:25 -0700 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-05-10 09:59:24 +0530 |
commit | 13ca20d8df3b402d12e5701c651a53409db167d8 (patch) | |
tree | c7afbf73b0047ab7534379f64f465c86ea1fcea6 /lib/sbi/sbi_hart.c | |
parent | aef9a60d521a7810557d1caf826311bc349691ac (diff) |
lib: Create a separate math helper function file
There may be few common mathematics helper functions which can be used
anywhere in OpenSBI project.
Add a separate math helper function file to add these functions.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'lib/sbi/sbi_hart.c')
-rw-r--r-- | lib/sbi/sbi_hart.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index 00e593f..b789900 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -15,6 +15,7 @@ #include <sbi/sbi_console.h> #include <sbi/sbi_error.h> #include <sbi/sbi_hart.h> +#include <sbi/sbi_math.h> #include <sbi/sbi_platform.h> extern void __sbi_expected_trap(void); @@ -121,19 +122,6 @@ void sbi_hart_delegation_dump(struct sbi_scratch *scratch) #endif } -unsigned long log2roundup(unsigned long x) -{ - unsigned long ret = 0; - - while (ret < __riscv_xlen) { - if (x <= (1UL << ret)) - break; - ret++; - } - - return ret; -} - void sbi_hart_pmp_dump(struct sbi_scratch *scratch) { const struct sbi_platform *plat = sbi_platform_ptr(scratch); |