Added MMU

This commit is contained in:
2023-10-19 21:00:12 +02:00
parent 9da9b5045f
commit 5bb973e8da
6 changed files with 181 additions and 1 deletions
+19
View File
@@ -0,0 +1,19 @@
#ifndef EXCEPTION_H
#define EXCEPTION_H
#include "rv32cpu.h"
void exception_trigger(rv32_cpu_t* cpu, uint32_t scause);
#define SCAUSE_INSTRUCTION_MISSALIGNED 0x0
#define SCAUSE_INSTRUCTION_ACCESS_FAULT 0x1
#define SCAUSE_ILLEGAL_INSTRUCTION 0x2
#define SCAUSE_BREAKPOINT 0x3
#define SCAUSE_LOAD_ACCESS_FAULT 0x5
#define SCAUSE_AMO_ADDRESS_MISALIGNED 0x6
#define SCAUSE_ENVIRONMENT_CALL 0x8
#define SCAUSE_INSTRUCTION_PAGE_FAULT 0xC
#define SCAUSE_LOAD_PAGE_FAULT 0xD
#define SCAUSE_STORE_AMO_PAGE_FAULT 0xF
#endif