aboutsummaryrefslogtreecommitdiff
path: root/riscv/devices.h
diff options
context:
space:
mode:
Diffstat (limited to 'riscv/devices.h')
-rw-r--r--riscv/devices.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/riscv/devices.h b/riscv/devices.h
index bccda34..0030da8 100644
--- a/riscv/devices.h
+++ b/riscv/devices.h
@@ -78,7 +78,7 @@ class clint_t : public abstract_device_t {
#define PLIC_MAX_DEVICES 1024
-struct plic_context {
+struct plic_context_t {
uint32_t num;
processor_t *proc;
bool mmode;
@@ -89,7 +89,6 @@ struct plic_context {
uint8_t pending_priority[PLIC_MAX_DEVICES];
uint32_t claimed[PLIC_MAX_DEVICES/32];
};
-typedef struct plic_context plic_context_t;
class plic_t : public abstract_device_t, public abstract_interrupt_controller_t {
public:
@@ -106,12 +105,12 @@ class plic_t : public abstract_device_t, public abstract_interrupt_controller_t
uint32_t max_prio;
uint8_t priority[PLIC_MAX_DEVICES];
uint32_t level[PLIC_MAX_DEVICES/32];
- uint32_t context_best_pending(plic_context_t *c);
- void context_update(plic_context_t *context);
+ uint32_t context_best_pending(const plic_context_t *c);
+ void context_update(const plic_context_t *context);
uint32_t context_claim(plic_context_t *c);
bool priority_read(reg_t offset, uint32_t *val);
bool priority_write(reg_t offset, uint32_t val);
- bool context_enable_read(plic_context_t *context,
+ bool context_enable_read(const plic_context_t *context,
reg_t offset, uint32_t *val);
bool context_enable_write(plic_context_t *context,
reg_t offset, uint32_t val);