Skip to content

Commit bcc5c41

Browse files
Hubert Badochabadochov
authored andcommitted
riscv: rename sbadaddr to stval
RISC-V Privileged Architectures V1.10 renamed and generalized sbadaddr to stval. binutils >= 2.43 dropped support for sbadaddr alias. JIRA: RTOS-913
1 parent b8de910 commit bcc5c41

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

hal/riscv64/_interrupts.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,10 @@ _interrupts_exceptionFpu:
422422
tail _interrupts_returnUnlocked
423423

424424
_interrupts_exceptionNotFpu:
425-
csrr s3, sbadaddr
425+
csrr s3, stval
426426
/* Save sscratch to be able to get hart ID */
427427
csrr s5, sscratch
428-
sd s3, 256(sp) /* sbadaddr */
428+
sd s3, 256(sp) /* stval */
429429
sd s5, 272(sp)
430430

431431
mv a1, sp

hal/riscv64/arch/cpu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ typedef struct {
162162
u64 ksp;
163163
u64 sstatus;
164164
u64 sepc;
165-
u64 sbadaddr;
165+
u64 stval;
166166
u64 scause;
167167
u64 sscratch;
168168

@@ -296,7 +296,7 @@ void hal_cpuRemoteFlushTLB(u32 asid, const void *vaddr, size_t size);
296296
static inline void *hal_cpuGetFaultAddr(void)
297297
{
298298
u64 badaddress;
299-
badaddress = csr_read(sbadaddr);
299+
badaddress = csr_read(stval);
300300
return (void *)badaddress;
301301
}
302302
#endif

hal/riscv64/exceptions.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void hal_exceptionsDumpContext(char *buff, exc_context_t *ctx, int n)
101101
i += hal_i2s(" sstatus : ", &buff[i], (u64)ctx->sstatus, 16, 1);
102102
i += hal_i2s(" sepc : ", &buff[i], (u64)ctx->sepc, 16, 1);
103103
buff[i++] = '\n';
104-
i += hal_i2s(" sbaddaddr : ", &buff[i], (u64)ctx->sbadaddr, 16, 1);
104+
i += hal_i2s(" stval : ", &buff[i], (u64)ctx->stval, 16, 1);
105105
i += hal_i2s(" scause : ", &buff[i], (u64)ctx->scause, 16, 1);
106106
i += hal_i2s(" sscratch : ", &buff[i], (u64)ctx->sscratch, 16, 1);
107107
buff[i++] = '\n';
@@ -164,7 +164,7 @@ int hal_exceptionsFaultType(unsigned int n, exc_context_t *ctx)
164164

165165
inline void *hal_exceptionsFaultAddr(unsigned int n, exc_context_t *ctx)
166166
{
167-
return (void *)ctx->sbadaddr;
167+
return (void *)ctx->stval;
168168
}
169169

170170

0 commit comments

Comments
 (0)