diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-10-30 00:57:33 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-10-30 00:57:33 +0200 |
| commit | 44a73ecab6e91519627786a5101cd4f1a2f2b0d7 (patch) | |
| tree | f5c811050a4d5ee832f5883c4d0c27efddd60817 /arch/riscv64/kernel/except.c | |
| parent | 5976ad390a15726c3ddfacf8c8b282c8350f9554 (diff) | |
| download | kmi-44a73ecab6e91519627786a5101cd4f1a2f2b0d7.tar.gz kmi-44a73ecab6e91519627786a5101cd4f1a2f2b0d7.zip | |
most of the way to passing tests
Diffstat (limited to 'arch/riscv64/kernel/except.c')
| -rw-r--r-- | arch/riscv64/kernel/except.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/riscv64/kernel/except.c b/arch/riscv64/kernel/except.c new file mode 100644 index 0000000..e46b584 --- /dev/null +++ b/arch/riscv64/kernel/except.c @@ -0,0 +1,21 @@ +#include <kmi/types.h> +#include <kmi/panic.h> +#include <kmi/vmem.h> +#include <kmi/bkl.h> + +void riscv_handle_exception(void *pc, void *addr, unsigned long id) +{ + switch (id) { + case 12: + case 13: + case 15: { + bkl_lock(); + handle_pagefault((vm_t)addr); + bkl_unlock(); + break; + } + + default: + unhandled_panic(pc, addr, id); + } +} |
