Introduce sbi_current_hartid()

Use this helper instead of hardcoding csr_read(mhartid).

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
This commit is contained in:
Damien Le Moal
2018-12-21 17:06:59 +09:00
parent 426adf9f60
commit 5563a03354
4 changed files with 15 additions and 4 deletions

View File

@@ -68,7 +68,7 @@ void sbi_trap_handler(struct sbi_trap_regs *regs,
{
int rc;
const char *msg;
u32 hartid = csr_read(mhartid);
u32 hartid = sbi_current_hartid();
ulong mcause = csr_read(mcause);
if (mcause & (1UL << (__riscv_xlen - 1))) {