summaryrefslogtreecommitdiff
path: root/arch/riscv/lib/sbi_ipi.c
blob: abafca9e5c1366d18608272f328d1cc79560dd02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (C) 2019 Fraunhofer AISEC,
 * Lukas Auer <lukas.auer@aisec.fraunhofer.de>
 */

#include <common.h>
#include <asm/encoding.h>
#include <asm/sbi.h>

int riscv_send_ipi(int hart)
{
	ulong mask;

	mask = 1UL << hart;
	sbi_send_ipi(&mask);

	return 0;
}

int riscv_clear_ipi(int hart)
{
	csr_clear(CSR_SIP, SIP_SSIP);

	return 0;
}

int riscv_get_ipi(int hart, int *pending)
{
	/*
	 * The SBI does not support reading the IPI status. We always return 0
	 * to indicate that no IPI is pending.
	 */
	*pending = 0;

	return 0;
}