handlers.c 414 B

1234567891011121314151617181920
  1. //See LICENSE for license details.
  2. #include <stdint.h>
  3. #include <stdio.h>
  4. #include "riscv_encoding.h"
  5. #include "n22_func.h"
  6. #include <rtthread.h>
  7. __attribute__((weak)) uintptr_t handle_nmi() {
  8. rt_kprintf("nmi\n");
  9. return 0;
  10. }
  11. __attribute__((weak)) uintptr_t handle_trap(uintptr_t mcause, uintptr_t sp) {
  12. if (mcause == 0xFFF) {
  13. handle_nmi();
  14. }
  15. rt_kprintf("trap\n");
  16. return 0;
  17. }