SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
interrupt.h
Go to the documentation of this file.
1
8/* SPDX-License-Identifier: GPL-2.0+ */
9
10#ifndef __INTERRUPT_H__
11#define __INTERRUPT_H__
12
13#include "csr.h"
14
21static inline void riscv_interrupt_enable(void) {
22 /* Set MIE bit in mstatus register */
23 csr_set(mstatus, MSTATUS_MIE);
24}
25
32static inline void riscv_interrupt_disable(void) {
33 /* Clear MIE bit in mstatus register */
34 csr_clear(mstatus, MSTATUS_MIE);
35}
36
37#endif /* __INTERRUPT_H__ */
#define MSTATUS_MIE
Definition riscv64.h:6
#define csr_clear(csr, val)
Clear specified bits in a CSR.
Definition csr.h:201
#define csr_set(csr, val)
Set bits in a CSR.
Definition csr.h:165
static void riscv_interrupt_disable(void)
Disable interrupts in RISC-V mode.
Definition interrupt.h:32
static void riscv_interrupt_enable(void)
Enable interrupts in RISC-V mode.
Definition interrupt.h:21