128__attribute__((naked, aligned(4)))
154 FSTORE
" f0, (16*"GPR_SIZE" + 0*"FPR_SIZE
")(sp)\n"
155 FSTORE
" f1, (16*"GPR_SIZE" + 1*"FPR_SIZE
")(sp)\n"
156 FSTORE
" f2, (16*"GPR_SIZE" + 2*"FPR_SIZE
")(sp)\n"
157 FSTORE
" f3, (16*"GPR_SIZE" + 3*"FPR_SIZE
")(sp)\n"
158 FSTORE
" f4, (16*"GPR_SIZE" + 4*"FPR_SIZE
")(sp)\n"
159 FSTORE
" f5, (16*"GPR_SIZE" + 5*"FPR_SIZE
")(sp)\n"
160 FSTORE
" f6, (16*"GPR_SIZE" + 6*"FPR_SIZE
")(sp)\n"
161 FSTORE
" f7, (16*"GPR_SIZE" + 7*"FPR_SIZE
")(sp)\n"
162 FSTORE
" f10, (16*"GPR_SIZE" + 8*"FPR_SIZE
")(sp)\n"
163 FSTORE
" f11, (16*"GPR_SIZE" + 9*"FPR_SIZE
")(sp)\n"
164 FSTORE
" f12, (16*"GPR_SIZE" + 10*"FPR_SIZE
")(sp)\n"
165 FSTORE
" f13, (16*"GPR_SIZE" + 11*"FPR_SIZE
")(sp)\n"
166 FSTORE
" f14, (16*"GPR_SIZE" + 12*"FPR_SIZE
")(sp)\n"
167 FSTORE
" f15, (16*"GPR_SIZE" + 13*"FPR_SIZE
")(sp)\n"
168 FSTORE
" f16, (16*"GPR_SIZE" + 14*"FPR_SIZE
")(sp)\n"
169 FSTORE
" f17, (16*"GPR_SIZE" + 15*"FPR_SIZE
")(sp)\n"
170 FSTORE
" f28, (16*"GPR_SIZE" + 16*"FPR_SIZE
")(sp)\n"
171 FSTORE
" f29, (16*"GPR_SIZE" + 17*"FPR_SIZE
")(sp)\n"
172 FSTORE
" f30, (16*"GPR_SIZE" + 18*"FPR_SIZE
")(sp)\n"
173 FSTORE
" f31, (16*"GPR_SIZE" + 19*"FPR_SIZE
")(sp)\n"
188 FLOAD
" f0, (16*"GPR_SIZE" + 0*"FPR_SIZE
")(sp)\n"
189 FLOAD
" f1, (16*"GPR_SIZE" + 1*"FPR_SIZE
")(sp)\n"
190 FLOAD
" f2, (16*"GPR_SIZE" + 2*"FPR_SIZE
")(sp)\n"
191 FLOAD
" f3, (16*"GPR_SIZE" + 3*"FPR_SIZE
")(sp)\n"
192 FLOAD
" f4, (16*"GPR_SIZE" + 4*"FPR_SIZE
")(sp)\n"
193 FLOAD
" f5, (16*"GPR_SIZE" + 5*"FPR_SIZE
")(sp)\n"
194 FLOAD
" f6, (16*"GPR_SIZE" + 6*"FPR_SIZE
")(sp)\n"
195 FLOAD
" f7, (16*"GPR_SIZE" + 7*"FPR_SIZE
")(sp)\n"
196 FLOAD
" f10, (16*"GPR_SIZE" + 8*"FPR_SIZE
")(sp)\n"
197 FLOAD
" f11, (16*"GPR_SIZE" + 9*"FPR_SIZE
")(sp)\n"
198 FLOAD
" f12, (16*"GPR_SIZE" + 10*"FPR_SIZE
")(sp)\n"
199 FLOAD
" f13, (16*"GPR_SIZE" + 11*"FPR_SIZE
")(sp)\n"
200 FLOAD
" f14, (16*"GPR_SIZE" + 12*"FPR_SIZE
")(sp)\n"
201 FLOAD
" f15, (16*"GPR_SIZE" + 13*"FPR_SIZE
")(sp)\n"
202 FLOAD
" f16, (16*"GPR_SIZE" + 14*"FPR_SIZE
")(sp)\n"
203 FLOAD
" f17, (16*"GPR_SIZE" + 15*"FPR_SIZE
")(sp)\n"
204 FLOAD
" f28, (16*"GPR_SIZE" + 16*"FPR_SIZE
")(sp)\n"
205 FLOAD
" f29, (16*"GPR_SIZE" + 17*"FPR_SIZE
")(sp)\n"
206 FLOAD
" f30, (16*"GPR_SIZE" + 18*"FPR_SIZE
")(sp)\n"
207 FLOAD
" f31, (16*"GPR_SIZE" + 19*"FPR_SIZE
")(sp)\n"
244 volatile uintptr_t id;
270 __asm__
volatile (
"wfi");
288 __asm__
volatile (
"wfi");
306 volatile uintptr_t mhartid =
csr_read(mhartid);
309 volatile intptr_t mcause =
csr_read(mcause);
312 intptr_t interrupt = mcause < 0;
313 intptr_t cause = mcause & 0xF;
Board Support Package API definitions.
#define LOG_WARN(mod, fmt,...)
Log a warning message (yellow).
#define LOG_ERR(mod, fmt,...)
Log an error message (red).
#define DBG_MOD_FAULT
Hard faults and errors.
#define DBG_MOD_IRQ
Interrupt controller.
int irq_handleDefault(void)
Default Fallback Interrupt Handler.
void irq_handleExt()
External Interrupt Handler (PLIC).
void trap_entry(void)
The Main Trap Entry Point (Naked).
void crash()
Fatal Exception Handler.
int irq_handleSoft(void)
Handlers for CPU interrupts (Software).
void trap()
Main C Trap Dispatcher.
int irq_handleTimer(void)
Handlers for CPU interrupts (Timer).
#define LOAD
Load Word (32-bit).
#define STORE
Store Word (32-bit).
int(* interrupt_vector_table[64])(void)
Global Interrupt Vector Table.
void plic_releaseExtIRQ_m(u32 gateway)
Release ID source from external IRQ.
u32 plic_claimExtIRQ_m()
Initialize the PLIC instance with a base address. Calculates the internal pointers for the register b...
#define CAUSE_ILLEGAL_INSTRUCTION
Exception: Illegal Instruction.
#define CAUSE_ENV_CALL_M_MODE
Exception: Environment Call from M Mode.
#define CAUSE_STORE_AMO_PAGE_FAULT
Exception: Store/AMO Page Fault.
#define CAUSE_MACHINE_EXTERNAL
Interrupt: Machine External.
#define CAUSE_MACHINE_SOFTWARE
Interrupt: Machine Software.
#define CAUSE_ENV_CALL_U_MODE
Exception: Environment Call from U Mode.
#define CAUSE_LOAD_ADDR_MISALIGNED
Exception: Load Address Misaligned.
#define CAUSE_ACCESS_FAULT
Exception: Instruction Access Fault.
#define CAUSE_BREAKPOINT
Exception: Breakpoint.
#define CAUSE_STORE_AMO_ACCESS_FAULT
Exception: Store/AMO Access Fault.
#define CAUSE_INSTRUCTION_ADDR_MISALIGNED
Exception: Instruction Address Misaligned.
#define CAUSE_LOAD_ACCESS_FAULT
Exception: Load Access Fault.
#define CAUSE_INSTRUCTION_PAGE_FAULT
Exception: Instruction Page Fault.
#define CAUSE_MACHINE_TIMER
Interrupt: Machine Timer.
#define CAUSE_LOAD_PAGE_FAULT
Exception: Load Page Fault.
#define CAUSE_STORE_AMO_ADDR_MISALIGNED
Exception: Store/AMO Address Misaligned.
#define CAUSE_ENV_CALL_S_MODE
Exception: Environment Call from S Mode.
#define csr_read(csr)
This function is used to read the value of a CSR.
int irq_m_gpio1_1_handler(void)
int irq_m_user_h_handler(void)
int irq_m_user_c_handler(void)
int irq_m_gpio0_0_handler(void)
int irq_m_spi1_handler(void)
int irq_m_user_f_handler(void)
int irq_m_gpio0_1_handler(void)
int irq_m_userTimer2_handler(void)
int irq_m_uart1_handler(void)
int irq_m_i2c3_handler(void)
int irq_m_invalid_handler(void)
int irq_m_l2Cache_handler(void)
int irq_m_user_e_handler(void)
int irq_m_i2c0_handler(void)
int irq_m_userTimer1_handler(void)
int irq_m_user_g_handler(void)
int irq_m_userTimer0_handler(void)
int irq_m_i2c1_handler(void)
int irq_m_uart0_handler(void)
int irq_m_i2c2_handler(void)
int irq_m_axiA_handler(void)
int irq_m_gpio1_0_handler(void)
int irq_m_watchDog0_handler(void)
int irq_m_user_b_handler(void)
void irq_handleException()
int irq_m_spi0_handler(void)
int irq_m_uart2_handler(void)
int irq_m_spi2_handler(void)
int irq_m_user_d_handler(void)
int irq_m_i2c4_handler(void)
int irq_m_user_a_handler(void)
Trap (Interrupt) and Exception Handling Definitions.