mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 23:41:23 +01:00
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>
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
* Damien Le Moal <damien.lemoal@wdc.com>
|
||||
*/
|
||||
|
||||
#include <sbi/riscv_asm.h>
|
||||
#include <sbi/riscv_encoding.h>
|
||||
#include <sbi/sbi_const.h>
|
||||
#include <sbi/sbi_hart.h>
|
||||
#include <sbi/sbi_platform.h>
|
||||
#include <sbi/sbi_console.h>
|
||||
#include <sbi_utils/irqchip/plic.h>
|
||||
@@ -55,7 +55,7 @@ static int k210_console_init(void)
|
||||
static int k210_irqchip_init(bool cold_boot)
|
||||
{
|
||||
int rc;
|
||||
u32 hartid = sbi_current_hartid();
|
||||
u32 hartid = current_hartid();
|
||||
|
||||
if (cold_boot) {
|
||||
rc = plic_cold_irqchip_init(K210_PLIC_BASE_ADDR,
|
||||
|
Reference in New Issue
Block a user