summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2022-06-13 04:03:52 +0300
committerAnup Patel <anup@brainfault.org>2022-06-13 09:24:06 +0300
commit2b79b694a80513696daf072db0fd980e7573b212 (patch)
tree7e64f4ba642d226c35a0726f35841ed23bdb5644 /include
parent415ecf28f7ade7ba5a48a0cc9be8d45a7539dd89 (diff)
downloadopensbi-2b79b694a80513696daf072db0fd980e7573b212.tar.xz
lib: irqchip/plic: Add priority save/restore helpers
These can be used by platform code to save the PLIC priority state, if it would otherwise be lost during non-retentive suspend. The platform is responsible for allocating all necessary storage. As a space optimization, store the saved priority values as 8-bit integers, since that is large enough to hold any priority value on the relevant platforms. Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'include')
-rw-r--r--include/sbi_utils/irqchip/plic.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/sbi_utils/irqchip/plic.h b/include/sbi_utils/irqchip/plic.h
index 21b2266..48c24f0 100644
--- a/include/sbi_utils/irqchip/plic.h
+++ b/include/sbi_utils/irqchip/plic.h
@@ -17,6 +17,11 @@ struct plic_data {
unsigned long num_src;
};
+/* So far, priorities on all consumers of these functions fit in 8 bits. */
+void plic_priority_save(const struct plic_data *plic, u8 *priority);
+
+void plic_priority_restore(const struct plic_data *plic, const u8 *priority);
+
void plic_context_save(const struct plic_data *plic, int context_id,
u32 *enable, u32 *threshold);