summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2022-06-13 04:03:51 +0300
committerAnup Patel <anup@brainfault.org>2022-06-13 09:24:06 +0300
commit415ecf28f7ade7ba5a48a0cc9be8d45a7539dd89 (patch)
treeaea0fe307ee8c36625d08b7cba90b971f3461346 /include
parent8c362e7d065eaf4d55da23a190a464ba870f89aa (diff)
downloadopensbi-415ecf28f7ade7ba5a48a0cc9be8d45a7539dd89.tar.xz
lib: irqchip/plic: Add context save/restore helpers
These can be used by platform code to save the PLIC context state, if it would otherwise be lost during non-retentive suspend. The platform is responsible for allocating all necessary storage. 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.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/sbi_utils/irqchip/plic.h b/include/sbi_utils/irqchip/plic.h
index 8f21af6..21b2266 100644
--- a/include/sbi_utils/irqchip/plic.h
+++ b/include/sbi_utils/irqchip/plic.h
@@ -17,6 +17,12 @@ struct plic_data {
unsigned long num_src;
};
+void plic_context_save(const struct plic_data *plic, int context_id,
+ u32 *enable, u32 *threshold);
+
+void plic_context_restore(const struct plic_data *plic, int context_id,
+ const u32 *enable, u32 threshold);
+
int plic_context_init(const struct plic_data *plic, int context_id,
bool enable, u32 threshold);