diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-03-12 07:51:25 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-03-13 09:52:02 +0300 |
commit | 823345ecaed0deb7770d9bac1c881004a6410e91 (patch) | |
tree | e3b71fb186be4bebd610e796cc12f2d3f33424e6 /platform/sifive | |
parent | 16e7071f6ddd5ba69d416b5a68e4aa191fc19d3b (diff) | |
download | opensbi-823345ecaed0deb7770d9bac1c881004a6410e91.tar.xz |
include: Make sbi_current_hartid() as macro in riscv_asm.h
The sbi_current_hartid() being a regular function is quite
expensive because for callers it is a function call instead
of a direct CSR read. This patch converts sbi_current_hartid()
into a macro in riscv_asm.h.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'platform/sifive')
-rw-r--r-- | platform/sifive/fu540/platform.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/sifive/fu540/platform.c b/platform/sifive/fu540/platform.c index 4a8c016..848261c 100644 --- a/platform/sifive/fu540/platform.c +++ b/platform/sifive/fu540/platform.c @@ -9,12 +9,12 @@ #include <libfdt.h> #include <fdt.h> +#include <sbi/riscv_asm.h> +#include <sbi/riscv_io.h> #include <sbi/riscv_encoding.h> #include <sbi/sbi_const.h> -#include <sbi/sbi_hart.h> #include <sbi/sbi_console.h> #include <sbi/sbi_platform.h> -#include <sbi/riscv_io.h> #include <sbi_utils/irqchip/plic.h> #include <sbi_utils/serial/sifive-uart.h> #include <sbi_utils/sys/clint.h> @@ -148,7 +148,7 @@ static int fu540_console_init(void) static int fu540_irqchip_init(bool cold_boot) { int rc; - u32 hartid = sbi_current_hartid(); + u32 hartid = current_hartid(); if (cold_boot) { rc = plic_cold_irqchip_init(FU540_PLIC_ADDR, |