diff --git a/arch/risc-v/src/common/riscv_cpuindex.c b/arch/risc-v/src/common/riscv_cpuindex.c index 62bcecd03e595..c5db4151e7dc8 100644 --- a/arch/risc-v/src/common/riscv_cpuindex.c +++ b/arch/risc-v/src/common/riscv_cpuindex.c @@ -45,5 +45,5 @@ int up_cpu_index(void) { - return (int)riscv_mhartid(); + return (int)riscv_mhartid() - CONFIG_ARCH_RV_HARTID_BASE; } diff --git a/arch/risc-v/src/common/riscv_internal.h b/arch/risc-v/src/common/riscv_internal.h index be3fe07ad6c1b..1846bb8708a5e 100644 --- a/arch/risc-v/src/common/riscv_internal.h +++ b/arch/risc-v/src/common/riscv_internal.h @@ -418,7 +418,7 @@ int riscv_smp_call_handler(int irq, void *c, void *arg); * Name: riscv_mhartid * * Description: - * Context aware way to query hart id + * Context aware way to query hart id (physical core ID) * * Returned Value: * Hart id diff --git a/arch/risc-v/src/common/riscv_macros.S b/arch/risc-v/src/common/riscv_macros.S index 03ddfe872d8ed..78068b482ffb8 100644 --- a/arch/risc-v/src/common/riscv_macros.S +++ b/arch/risc-v/src/common/riscv_macros.S @@ -349,7 +349,7 @@ * Name: riscv_mhartid * * Description: - * Context aware way to query hart id + * Context aware way to query hart id (physical core ID) * * Returned Value: * Hart id @@ -362,9 +362,6 @@ REGLOAD \out, RISCV_PERCPU_HARTID(\out) #else csrr \out, CSR_MHARTID -# if CONFIG_ARCH_RV_HARTID_BASE > 0 - add \out, \out, - CONFIG_ARCH_RV_HARTID_BASE -# endif #endif .endm diff --git a/arch/risc-v/src/common/riscv_mhartid.S b/arch/risc-v/src/common/riscv_mhartid.S index 0cfcfc256c785..d58ac689373a8 100644 --- a/arch/risc-v/src/common/riscv_mhartid.S +++ b/arch/risc-v/src/common/riscv_mhartid.S @@ -38,7 +38,7 @@ * Name: riscv_mhartid * * Description: - * Context aware way to query hart id + * Context aware way to query hart id (physical core ID) * * Returned Value: * Hart id