summaryrefslogtreecommitdiff
path: root/src/arch/riscv/trap_handler.c
diff options
context:
space:
mode:
authorFelix Singer <felixsinger@posteo.net>2023-12-08 10:39:44 +0100
committerFelix Singer <service+coreboot-gerrit@felixsinger.de>2023-12-20 08:34:26 +0000
commit6ff711c48faa64024d031ed7753c157837347d24 (patch)
treed0b805cf7e4f112ca0bc6b4a65d9a457dc47e6b7 /src/arch/riscv/trap_handler.c
parent9963aa359a4480921d0693a4a9599f6dcb7bc3cb (diff)
arch/riscv: Use same indent levels for switch/case
Use same indent levels for switch/case in order to comply with the linter. Change-Id: Icf41e823c42ffea7b73bdd9112081af4d1f94bc9 Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79417 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Alexander Couzens <lynxis@fe80.eu> Reviewed-by: Eric Lai <ericllai@google.com>
Diffstat (limited to 'src/arch/riscv/trap_handler.c')
-rw-r--r--src/arch/riscv/trap_handler.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/arch/riscv/trap_handler.c b/src/arch/riscv/trap_handler.c
index 8cb27de045..fbc6ae4c0e 100644
--- a/src/arch/riscv/trap_handler.c
+++ b/src/arch/riscv/trap_handler.c
@@ -33,10 +33,10 @@ static const char *const exception_names[] = {
static const char *mstatus_to_previous_mode(uintptr_t ms)
{
switch (ms & MSTATUS_MPP) {
- case 0x00000000: return "user";
- case 0x00000800: return "supervisor";
- case 0x00001000: return "hypervisor";
- case 0x00001800: return "machine";
+ case 0x00000000: return "user";
+ case 0x00000800: return "supervisor";
+ case 0x00001000: return "hypervisor";
+ case 0x00001800: return "machine";
}
return "unknown";
@@ -117,31 +117,31 @@ void trap_handler(trapframe *tf)
}
switch (tf->cause) {
- case CAUSE_MISALIGNED_FETCH:
- case CAUSE_FETCH_ACCESS:
- case CAUSE_ILLEGAL_INSTRUCTION:
- case CAUSE_BREAKPOINT:
- case CAUSE_LOAD_ACCESS:
- case CAUSE_STORE_ACCESS:
- case CAUSE_USER_ECALL:
- case CAUSE_HYPERVISOR_ECALL:
- case CAUSE_MACHINE_ECALL:
- print_trap_information(tf);
- break;
- case CAUSE_SUPERVISOR_ECALL:
- handle_sbi(tf);
- return;
- case CAUSE_MISALIGNED_LOAD:
- case CAUSE_MISALIGNED_STORE:
- print_trap_information(tf);
- handle_misaligned(tf);
- return;
- default:
- printk(BIOS_EMERG, "================================\n");
- printk(BIOS_EMERG, "coreboot: can not handle a trap:\n");
- printk(BIOS_EMERG, "================================\n");
- print_trap_information(tf);
- break;
+ case CAUSE_MISALIGNED_FETCH:
+ case CAUSE_FETCH_ACCESS:
+ case CAUSE_ILLEGAL_INSTRUCTION:
+ case CAUSE_BREAKPOINT:
+ case CAUSE_LOAD_ACCESS:
+ case CAUSE_STORE_ACCESS:
+ case CAUSE_USER_ECALL:
+ case CAUSE_HYPERVISOR_ECALL:
+ case CAUSE_MACHINE_ECALL:
+ print_trap_information(tf);
+ break;
+ case CAUSE_SUPERVISOR_ECALL:
+ handle_sbi(tf);
+ return;
+ case CAUSE_MISALIGNED_LOAD:
+ case CAUSE_MISALIGNED_STORE:
+ print_trap_information(tf);
+ handle_misaligned(tf);
+ return;
+ default:
+ printk(BIOS_EMERG, "================================\n");
+ printk(BIOS_EMERG, "coreboot: can not handle a trap:\n");
+ printk(BIOS_EMERG, "================================\n");
+ print_trap_information(tf);
+ break;
}
die("Can't recover from trap. Halting.\n");