diff options
author | Lukas Auer <lukas.auer@aisec.fraunhofer.de> | 2019-12-08 23:28:50 +0100 |
---|---|---|
committer | Andes <uboot@andestech.com> | 2019-12-10 08:23:10 +0800 |
commit | 8b3e97badf97d6e399014fb4a152031f8a0c94ba (patch) | |
tree | 63c6e428e63506f5c1010b905159c67b178332f0 /arch/riscv/lib/smp.c | |
parent | b86f6d1e649f237849297b5ec6b5566b7a92b2b4 (diff) |
riscv: add functions for reading the IPI status
Add the function riscv_get_ipi() for reading the pending status of IPIs.
The supported controllers are Andes' Platform Level Interrupt Controller
(PLIC), the Supervisor Binary Interface (SBI), and SiFive's Core Local
Interruptor (CLINT).
Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Rick Chen <rick@andestech.com>
Diffstat (limited to 'arch/riscv/lib/smp.c')
-rw-r--r-- | arch/riscv/lib/smp.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/riscv/lib/smp.c b/arch/riscv/lib/smp.c index 705437862a..188a7e34bd 100644 --- a/arch/riscv/lib/smp.c +++ b/arch/riscv/lib/smp.c @@ -32,6 +32,18 @@ extern int riscv_send_ipi(int hart); */ extern int riscv_clear_ipi(int hart); +/** + * riscv_get_ipi() - Get status of inter-processor interrupt (IPI) + * + * Platform code must provide this function. + * + * @hart: Hart ID of hart to be checked + * @pending: Pointer to variable with result of the check, + * 1 if IPI is pending, 0 otherwise + * @return 0 if OK, -ve on error + */ +extern int riscv_get_ipi(int hart, int *pending); + static int send_ipi_many(struct ipi_data *ipi) { ofnode node, cpus; |