diff options
| author | Samuel Holland <samuel@sholland.org> | 2022-06-12 20:03:53 -0500 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2022-06-13 11:54:06 +0530 |
| commit | 69be3dff9df767c19a461fadf73ad7331b4bdb4c (patch) | |
| tree | 9ca1324a308731dd34dcb330d23b239d063b60ba /include | |
| parent | 2b79b694a80513696daf072db0fd980e7573b212 (diff) | |
| download | opensbi-69be3dff9df767c19a461fadf73ad7331b4bdb4c.zip opensbi-69be3dff9df767c19a461fadf73ad7331b4bdb4c.tar.gz opensbi-69be3dff9df767c19a461fadf73ad7331b4bdb4c.tar.bz2 | |
lib: utils/irqchip: Add FDT wrappers for PLIC save/restore functions
These functions save/restore the state of the PLIC associated with the
current hart. The context save/restore functions only manipulate a
single context, since most likely the M-mode context is unused and does
not need to be saved.
Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sbi_utils/irqchip/fdt_irqchip_plic.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/sbi_utils/irqchip/fdt_irqchip_plic.h b/include/sbi_utils/irqchip/fdt_irqchip_plic.h new file mode 100644 index 0000000..f158b02 --- /dev/null +++ b/include/sbi_utils/irqchip/fdt_irqchip_plic.h @@ -0,0 +1,20 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2022 Samuel Holland <samuel@sholland.org> + */ + +#ifndef __IRQCHIP_FDT_IRQCHIP_PLIC_H__ +#define __IRQCHIP_FDT_IRQCHIP_PLIC_H__ + +#include <sbi/sbi_types.h> + +void fdt_plic_priority_save(u8 *priority); + +void fdt_plic_priority_restore(const u8 *priority); + +void fdt_plic_context_save(bool smode, u32 *enable, u32 *threshold); + +void fdt_plic_context_restore(bool smode, const u32 *enable, u32 threshold); + +#endif |
