Files
opensbi/include/sbi_utils/irqchip/plic.h
Samuel Holland 415ecf28f7 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>
2022-06-13 11:54:06 +05:30

35 lines
813 B
C

/*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2019 Western Digital Corporation or its affiliates.
*
* Authors:
* Anup Patel <anup.patel@wdc.com>
*/
#ifndef __IRQCHIP_PLIC_H__
#define __IRQCHIP_PLIC_H__
#include <sbi/sbi_types.h>
struct plic_data {
unsigned long addr;
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);
int plic_warm_irqchip_init(const struct plic_data *plic,
int m_cntx_id, int s_cntx_id);
int plic_cold_irqchip_init(const struct plic_data *plic);
#endif