diff options
author | Vivian Wang <dramforever@live.com> | 2022-11-09 09:53:37 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2022-11-15 14:14:03 +0300 |
commit | 14f5c4cb4d2b9a5839a156c957f77a19a2f3eda7 (patch) | |
tree | 4dada732c9e07ab3bf4aadff4c68a60cbe729f0f /lib/sbi/sbi_ecall_ipi.c | |
parent | 7b29264f11b8ac9aef0df23122feed763f803779 (diff) | |
download | opensbi-14f5c4cb4d2b9a5839a156c957f77a19a2f3eda7.tar.xz |
lib: sbi_ecall: Split up sbi_ecall_replace
Split up sbi_ecall_replace so that each extension is in its individual
file.
Also reorganize the corresponding section in lib/sbi/objects.mk so
that it is grouped by extension, now that the object file targets are
split up.
Signed-off-by: Vivian Wang <dramforever@live.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/sbi/sbi_ecall_ipi.c')
-rw-r--r-- | lib/sbi/sbi_ecall_ipi.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/sbi/sbi_ecall_ipi.c b/lib/sbi/sbi_ecall_ipi.c new file mode 100644 index 0000000..f4797e1 --- /dev/null +++ b/lib/sbi/sbi_ecall_ipi.c @@ -0,0 +1,36 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 Western Digital Corporation or its affiliates. + * + * Authors: + * Anup Patel <anup.patel@wdc.com> + * Atish Patra <atish.patra@wdc.com> + */ + +#include <sbi/sbi_error.h> +#include <sbi/sbi_ecall.h> +#include <sbi/sbi_ecall_interface.h> +#include <sbi/sbi_trap.h> +#include <sbi/sbi_ipi.h> + +static int sbi_ecall_ipi_handler(unsigned long extid, unsigned long funcid, + const struct sbi_trap_regs *regs, + unsigned long *out_val, + struct sbi_trap_info *out_trap) +{ + int ret = 0; + + if (funcid == SBI_EXT_IPI_SEND_IPI) + ret = sbi_ipi_send_smode(regs->a0, regs->a1); + else + ret = SBI_ENOTSUPP; + + return ret; +} + +struct sbi_ecall_extension ecall_ipi = { + .extid_start = SBI_EXT_IPI, + .extid_end = SBI_EXT_IPI, + .handle = sbi_ecall_ipi_handler, +}; |