forked from Mirrors/opensbi
lib: sbi: Simplify ipi platform operations
Instead of having ipi_send() and ipi_clear() callbacks in platform operations, it will be much simpler for ipi driver to directly register these operations as a device to sbi_ipi implementation. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
@@ -17,35 +17,15 @@ static struct fdt_ipi *ipi_drivers[] = {
|
||||
&fdt_ipi_clint
|
||||
};
|
||||
|
||||
static void dummy_send(u32 target_hart)
|
||||
{
|
||||
}
|
||||
|
||||
static void dummy_clear(u32 target_hart)
|
||||
{
|
||||
}
|
||||
|
||||
static struct fdt_ipi dummy = {
|
||||
.match_table = NULL,
|
||||
.cold_init = NULL,
|
||||
.warm_init = NULL,
|
||||
.exit = NULL,
|
||||
.send = dummy_send,
|
||||
.clear = dummy_clear
|
||||
};
|
||||
|
||||
static struct fdt_ipi *current_driver = &dummy;
|
||||
|
||||
void fdt_ipi_send(u32 target_hart)
|
||||
{
|
||||
current_driver->send(target_hart);
|
||||
}
|
||||
|
||||
void fdt_ipi_clear(u32 target_hart)
|
||||
{
|
||||
current_driver->clear(target_hart);
|
||||
}
|
||||
|
||||
void fdt_ipi_exit(void)
|
||||
{
|
||||
if (current_driver->exit)
|
||||
|
Reference in New Issue
Block a user