diff options
author | Andrew Waterman <andrew@sifive.com> | 2022-10-17 14:25:46 -0700 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2022-10-17 14:31:52 -0700 |
commit | 66a307d6aa1bdb5e5a21fd9decb7ba11ba9fe86f (patch) | |
tree | 0a19427d92059a3c0bb1dd242fd2a0442fca4c4e /riscv/devices.h | |
parent | 68aeeb5500521ff52c216862f9a653b64191f3ad (diff) | |
download | spike-66a307d6aa1bdb5e5a21fd9decb7ba11ba9fe86f.zip spike-66a307d6aa1bdb5e5a21fd9decb7ba11ba9fe86f.tar.gz spike-66a307d6aa1bdb5e5a21fd9decb7ba11ba9fe86f.tar.bz2 |
Make PLIC/NS16550 coding style more conformant
Diffstat (limited to 'riscv/devices.h')
-rw-r--r-- | riscv/devices.h | 9 |
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); |