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>
This commit is contained in:
Samuel Holland 2022-06-12 20:03:51 -05:00 committed by Anup Patel
parent 8c362e7d06
commit 415ecf28f7
2 changed files with 54 additions and 3 deletions

View file

@ -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);