diff options
author | Samuel Holland <samuel@sholland.org> | 2022-06-13 04:03:49 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2022-06-13 09:24:06 +0300 |
commit | 2ea7799d563ed9bbaf3b677728e928a6cd8f580c (patch) | |
tree | 52d53991808122a908c80cb0270528c67893d2fd /lib | |
parent | 79e42eb2d646097198aed935042e289e53ff9876 (diff) | |
download | opensbi-2ea7799d563ed9bbaf3b677728e928a6cd8f580c.tar.xz |
lib: irqchip/plic: Constify plic_data pointers
None of the functions modify the passed-in plic_data, so mark it const.
Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/irqchip/plic.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/utils/irqchip/plic.c b/lib/utils/irqchip/plic.c index 0f58f3e..4c334ec 100644 --- a/lib/utils/irqchip/plic.c +++ b/lib/utils/irqchip/plic.c @@ -21,14 +21,14 @@ #define PLIC_CONTEXT_BASE 0x200000 #define PLIC_CONTEXT_STRIDE 0x1000 -static void plic_set_priority(struct plic_data *plic, u32 source, u32 val) +static void plic_set_priority(const struct plic_data *plic, u32 source, u32 val) { volatile void *plic_priority = (char *)plic->addr + PLIC_PRIORITY_BASE + 4 * source; writel(val, plic_priority); } -void plic_set_thresh(struct plic_data *plic, u32 cntxid, u32 val) +void plic_set_thresh(const struct plic_data *plic, u32 cntxid, u32 val) { volatile void *plic_thresh; @@ -40,7 +40,8 @@ void plic_set_thresh(struct plic_data *plic, u32 cntxid, u32 val) writel(val, plic_thresh); } -void plic_set_ie(struct plic_data *plic, u32 cntxid, u32 word_index, u32 val) +void plic_set_ie(const struct plic_data *plic, u32 cntxid, + u32 word_index, u32 val) { volatile char *plic_ie; @@ -52,7 +53,7 @@ void plic_set_ie(struct plic_data *plic, u32 cntxid, u32 word_index, u32 val) writel(val, plic_ie + word_index * 4); } -int plic_warm_irqchip_init(struct plic_data *plic, +int plic_warm_irqchip_init(const struct plic_data *plic, int m_cntx_id, int s_cntx_id) { size_t i, ie_words; @@ -85,7 +86,7 @@ int plic_warm_irqchip_init(struct plic_data *plic, return 0; } -int plic_cold_irqchip_init(struct plic_data *plic) +int plic_cold_irqchip_init(const struct plic_data *plic) { int i; |