diff options
author | Anup Patel <anup@brainfault.org> | 2021-12-14 17:23:45 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2022-04-20 10:10:27 +0530 |
commit | d5b1a65c0e3a0b6b46eb66d5d0284bf3a6cc1e0c (patch) | |
tree | 2326d6c1bc34dc55521e239952a0b73e58282c45 /riscv | |
parent | b9fc8e4e9087a6064dfcc627efabbe3fd4bdc309 (diff) | |
download | spike-d5b1a65c0e3a0b6b46eb66d5d0284bf3a6cc1e0c.zip spike-d5b1a65c0e3a0b6b46eb66d5d0284bf3a6cc1e0c.tar.gz spike-d5b1a65c0e3a0b6b46eb66d5d0284bf3a6cc1e0c.tar.bz2 |
Add an abstract interrupt controller interface
We add an abstract interrupt controller interface which can be used by
devices to trigger wired interrupts.
Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'riscv')
-rw-r--r-- | riscv/abstract_interrupt_controller.h | 14 | ||||
-rw-r--r-- | riscv/devices.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/riscv/abstract_interrupt_controller.h b/riscv/abstract_interrupt_controller.h new file mode 100644 index 0000000..946b079 --- /dev/null +++ b/riscv/abstract_interrupt_controller.h @@ -0,0 +1,14 @@ +#ifndef _RISCV_ABSTRACT_INTERRUPT_CONTROLLER_H +#define _RISCV_ABSTRACT_INTERRUPT_CONTROLLER_H + +#include "decode.h" +#include <cstdint> +#include <cstddef> + +class abstract_interrupt_controller_t { + public: + virtual void set_interrupt_level(uint32_t interrupt_id, int level) = 0; + virtual ~abstract_interrupt_controller_t() {} +}; + +#endif diff --git a/riscv/devices.h b/riscv/devices.h index 9200f29..934904a 100644 --- a/riscv/devices.h +++ b/riscv/devices.h @@ -4,6 +4,7 @@ #include "decode.h" #include "mmio_plugin.h" #include "abstract_device.h" +#include "abstract_interrupt_controller.h" #include "platform.h" #include <map> #include <vector> |