include: Rename ECALL defines to match latest RISC-V spec

We rename CAUSE_HYPERVISOR_ECALL to CAUSE_SUPERVISOR_ECALL and
CAUSE_SUPERVISOR_ECALL to CAUSE_VIRTUAL_SUPERVISOR_ECALL so that
it matches latest RISC-V privilege spec.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
Anup Patel
2020-09-01 17:54:29 +05:30
committed by Anup Patel
parent dcb10c0056
commit bef63d6848
3 changed files with 4 additions and 4 deletions

View File

@@ -539,8 +539,8 @@
#define CAUSE_MISALIGNED_STORE 0x6 #define CAUSE_MISALIGNED_STORE 0x6
#define CAUSE_STORE_ACCESS 0x7 #define CAUSE_STORE_ACCESS 0x7
#define CAUSE_USER_ECALL 0x8 #define CAUSE_USER_ECALL 0x8
#define CAUSE_HYPERVISOR_ECALL 0x9 #define CAUSE_SUPERVISOR_ECALL 0x9
#define CAUSE_SUPERVISOR_ECALL 0xa #define CAUSE_VIRTUAL_SUPERVISOR_ECALL 0xa
#define CAUSE_MACHINE_ECALL 0xb #define CAUSE_MACHINE_ECALL 0xb
#define CAUSE_FETCH_PAGE_FAULT 0xc #define CAUSE_FETCH_PAGE_FAULT 0xc
#define CAUSE_LOAD_PAGE_FAULT 0xd #define CAUSE_LOAD_PAGE_FAULT 0xd

View File

@@ -108,7 +108,7 @@ static int delegate_traps(struct sbi_scratch *scratch, u32 hartid)
* from VS-mode), Guest page faults and Virtual interrupts. * from VS-mode), Guest page faults and Virtual interrupts.
*/ */
if (misa_extension('H')) { if (misa_extension('H')) {
exceptions |= (1U << CAUSE_SUPERVISOR_ECALL); exceptions |= (1U << CAUSE_VIRTUAL_SUPERVISOR_ECALL);
exceptions |= (1U << CAUSE_FETCH_GUEST_PAGE_FAULT); exceptions |= (1U << CAUSE_FETCH_GUEST_PAGE_FAULT);
exceptions |= (1U << CAUSE_LOAD_GUEST_PAGE_FAULT); exceptions |= (1U << CAUSE_LOAD_GUEST_PAGE_FAULT);
exceptions |= (1U << CAUSE_VIRTUAL_INST_FAULT); exceptions |= (1U << CAUSE_VIRTUAL_INST_FAULT);

View File

@@ -251,7 +251,7 @@ void sbi_trap_handler(struct sbi_trap_regs *regs)
rc = sbi_misaligned_store_handler(mtval, mtval2, mtinst, regs); rc = sbi_misaligned_store_handler(mtval, mtval2, mtinst, regs);
msg = "misaligned store handler failed"; msg = "misaligned store handler failed";
break; break;
case CAUSE_HYPERVISOR_ECALL: case CAUSE_SUPERVISOR_ECALL:
rc = sbi_ecall_handler(regs); rc = sbi_ecall_handler(regs);
msg = "ecall handler failed"; msg = "ecall handler failed";
break; break;