diff options
| author | Damien Le Moal <[email protected]> | 2018-12-21 17:06:59 +0900 |
|---|---|---|
| committer | Damien Le Moal <[email protected]> | 2018-12-21 17:06:59 +0900 |
| commit | 5563a0335421c3e1d69dc62a1b58675ddf3d1e5b (patch) | |
| tree | 47c756c6e8591467636f0983236c420f9f76cf43 /lib/sbi_trap.c | |
| parent | 426adf9f6025fe70470476166db63ea7c0c1514b (diff) | |
Introduce sbi_current_hartid()
Use this helper instead of hardcoding csr_read(mhartid).
Signed-off-by: Damien Le Moal <[email protected]>
Diffstat (limited to 'lib/sbi_trap.c')
| -rw-r--r-- | lib/sbi_trap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sbi_trap.c b/lib/sbi_trap.c index f9c70a63..284bb74f 100644 --- a/lib/sbi_trap.c +++ b/lib/sbi_trap.c @@ -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))) { |
