2019-07-24 17:03:26 +08:00
|
|
|
//See LICENSE for license details.
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "riscv_encoding.h"
|
|
|
|
#include "n22_func.h"
|
2021-10-26 12:51:32 +08:00
|
|
|
#include <rtthread.h>
|
|
|
|
|
2019-07-24 17:03:26 +08:00
|
|
|
__attribute__((weak)) uintptr_t handle_nmi() {
|
2021-10-26 12:51:32 +08:00
|
|
|
rt_kprintf("nmi\n");
|
2019-07-24 17:03:26 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
__attribute__((weak)) uintptr_t handle_trap(uintptr_t mcause, uintptr_t sp) {
|
|
|
|
if (mcause == 0xFFF) {
|
|
|
|
handle_nmi();
|
|
|
|
}
|
2021-10-26 12:51:32 +08:00
|
|
|
rt_kprintf("trap\n");
|
2019-07-24 17:03:26 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|