5#include "riscv_decls.h"
9#include "../../deps/riscv-opcodes/encoding.h"
15inline void snrt_wfi() {
asm volatile(
"wfi"); }
17inline void snrt_nop() {
asm volatile(
"nop" : : :); }
19inline uint32_t snrt_mcycle() {
21 asm volatile(
"csrr %0, mcycle" :
"=r"(r) : :
"memory");
33inline void snrt_interrupt_enable(uint32_t irq) { set_csr(mie, 1 << irq); }
41inline void snrt_interrupt_disable(uint32_t irq) { clear_csr(mie, 1 << irq); }
49inline void snrt_interrupt_global_enable(
void) {
50 set_csr(mstatus, MSTATUS_MIE);
56inline void snrt_interrupt_global_disable(
void) {
57 clear_csr(mstatus, MSTATUS_MIE);