From 66a307d6aa1bdb5e5a21fd9decb7ba11ba9fe86f Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Mon, 17 Oct 2022 14:25:46 -0700 Subject: Make PLIC/NS16550 coding style more conformant --- riscv/devices.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'riscv/devices.h') 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); -- cgit v1.1