aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel/except.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv64/kernel/except.c')
-rw-r--r--arch/riscv64/kernel/except.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/riscv64/kernel/except.c b/arch/riscv64/kernel/except.c
index 2525716..5f182fd 100644
--- a/arch/riscv64/kernel/except.c
+++ b/arch/riscv64/kernel/except.c
@@ -1,9 +1,24 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2024, Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
+/**
+ * @file except.c
+ * riscv64 exception handling.
+ */
+
#include <kmi/types.h>
#include <kmi/panic.h>
#include <kmi/debug.h>
#include <kmi/vmem.h>
#include <kmi/bkl.h>
+/**
+ * Handle exception. Intended to be called from entry.S.
+ *
+ * @param pc Where exception occurred.
+ * @param addr What address caused the exception, if any.
+ * @param id ID of exception, see riscv spec.
+ */
void riscv_handle_exception(void *pc, void *addr, unsigned long id)
{
switch (id) {