diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-07-02 21:40:10 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-07-02 21:40:10 +0300 |
| commit | 8a3452098267e1af127d6c4f1836a9d82cd23f38 (patch) | |
| tree | c9fad842a8903f64a57027b66ef54bba0dee2928 /arch/riscv64/kernel/irq.c | |
| parent | 7ad9c01dad7b1b46eced8290b8b991383d648188 (diff) | |
| download | kmi-8a3452098267e1af127d6c4f1836a9d82cd23f38.tar.gz kmi-8a3452098267e1af127d6c4f1836a9d82cd23f38.zip | |
more complete interrupt handling outline
+ Still largely untested, should really try to come up with a proper
testsuite, at the moment it's mostly me trying things out in the (as
of yet unreleased) kmx repo
Diffstat (limited to 'arch/riscv64/kernel/irq.c')
| -rw-r--r-- | arch/riscv64/kernel/irq.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/riscv64/kernel/irq.c b/arch/riscv64/kernel/irq.c index 2ef15cc..0c129b9 100644 --- a/arch/riscv64/kernel/irq.c +++ b/arch/riscv64/kernel/irq.c @@ -38,16 +38,18 @@ stat_t deactivate_irq(irq_t id) return OK; } +/** Bit pattern representing supervisor external, timer and software irqs. */ +#define SR_IRQS (1 << 9) | (1 << 5) | (1 << 3) + /* very simple for now */ void enable_irqs() { - /* should be supervisor external interrupt */ - csr_set(CSR_SIE, 1 << 9); + csr_set(CSR_SIE, SR_IRQS); } void disable_irqs() { - csr_clear(CSR_SIE, 1 << 9); + csr_clear(CSR_SIE, SR_IRQS); } irq_t get_irq() |
