mirror of
https://github.com/apache/nuttx.git
synced 2026-10-23 23:08:44 +00:00
arch/riscv: Remove CONFIG_ARCH_RV_HARTID_BASE offset from riscv_mhartid
The function is supposed to return the physical hart ID. It is needed for e.g. external interrupt acknowledgment (see mpfs_plic.c). This offset is moved initially to up_cpu_index (which is also wrong, but less wrong than the current implementation). Finally, a translation between physical <-> logical shall be provided.
This commit is contained in:
parent
e384a6a625
commit
f47c0a1953
4 changed files with 4 additions and 7 deletions
|
|
@ -45,5 +45,5 @@
|
|||
|
||||
int up_cpu_index(void)
|
||||
{
|
||||
return (int)riscv_mhartid();
|
||||
return (int)riscv_mhartid() - CONFIG_ARCH_RV_HARTID_BASE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue