5 #include "sw/device/lib/runtime/irq.h"
9 static const uint32_t IRQ_EXT_ENABLE_OFFSET = 11;
10 static const uint32_t IRQ_TIMER_ENABLE_OFFSET = 7;
11 static const uint32_t IRQ_SW_ENABLE_OFFSET = 3;
13 void irq_set_vector_offset(uintptr_t address) {
14 CSR_WRITE(CSR_REG_MTVEC, (uint32_t)address);
17 void irq_global_ctrl(
bool en) {
25 void irq_external_ctrl(
bool en) {
26 const uint32_t mask = 1 << IRQ_EXT_ENABLE_OFFSET;
34 void irq_timer_ctrl(
bool en) {
35 const uint32_t mask = 1 << IRQ_TIMER_ENABLE_OFFSET;
43 void irq_software_ctrl(
bool en) {
44 const uint32_t mask = 1 << IRQ_SW_ENABLE_OFFSET;