From 0842e21146087f1ba184c1c9b9b3dd87fbadf746 Mon Sep 17 00:00:00 2001 From: Henrik Karlsson Date: Thu, 16 May 2024 11:32:38 +0200 Subject: [PATCH] Clang format --- kernel/src/exception.c | 9 +++++---- kernel/src/interrupt.c | 2 +- kernel/src/trap.c | 7 +++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/kernel/src/exception.c b/kernel/src/exception.c index fa6a038..66007e7 100644 --- a/kernel/src/exception.c +++ b/kernel/src/exception.c @@ -13,8 +13,8 @@ #define SRET 0x10200073 #define URET 0x00200073 - -static proc_t *_exception_delegate(proc_t *proc, uint64_t mcause, uint64_t mtval) +static proc_t *_exception_delegate(proc_t *proc, uint64_t mcause, + uint64_t mtval) { proc->regs[REG_ECAUSE] = mcause; proc->regs[REG_EVAL] = mtval; @@ -36,9 +36,10 @@ static proc_t *_exception_trap_return(proc_t *proc) return proc; } -proc_t *exception_handler(proc_t * proc, uint64_t mcause, uint64_t mtval) +proc_t *exception_handler(proc_t *proc, uint64_t mcause, uint64_t mtval) { - if (mcause == ILLEGAL_INSTRUCTION && (mtval == MRET || mtval == SRET || mtval == URET)) + if (mcause == ILLEGAL_INSTRUCTION + && (mtval == MRET || mtval == SRET || mtval == URET)) return _exception_trap_return(proc); return _exception_delegate(proc, mcause, mtval); } diff --git a/kernel/src/interrupt.c b/kernel/src/interrupt.c index 70e03ea..cda176e 100644 --- a/kernel/src/interrupt.c +++ b/kernel/src/interrupt.c @@ -1,5 +1,5 @@ -#include #include +#include #include proc_t *interrupt_handler(proc_t *proc, uint64_t mcause, uint64_t mtval) diff --git a/kernel/src/trap.c b/kernel/src/trap.c index a6f93c7..eba4160 100644 --- a/kernel/src/trap.c +++ b/kernel/src/trap.c @@ -1,9 +1,8 @@ -#include - -#include #include #include #include +#include +#include proc_t *trap_handler(proc_t *proc, uint64_t mcause, uint64_t mtval) { @@ -11,7 +10,7 @@ proc_t *trap_handler(proc_t *proc, uint64_t mcause, uint64_t mtval) proc_t *next = syscall_handler(proc); if (next != proc) proc_release(proc); - if (next) + if (next) return next; return sched(); } else if ((int64_t)mcause < 0) {