19 lines
517 B
C
19 lines
517 B
C
#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 |