aboutsummaryrefslogtreecommitdiff
path: root/include/sbi/sbi_ipi.h
AgeCommit message (Collapse)Author
2021-04-28lib: sbi: Simplify ipi platform operationsAnup Patel
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>
2020-03-28include: sbi_ipi: Remove scratch parameter from most functionsAnup Patel
This patch removes scratch parameter from most sbi_ipi functions. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-03-10lib: sbi: Fix coding style issuesBin Meng
This fixes various coding style issues found in the SBI codes. No functional changes. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2020-01-22lib: Introduce sbi_ipi_event_create/destroy() APIsAnup Patel
This patch introduces sbi_ipi_event_create/destroy() APIs and struct sbi_ipi_event_ops for creating/destroying IPI events at runtime based of event operations. This new APIs will help platform code and utils code to create custom IPI events which are not part of generic OpenSBI library. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-01-22lib: Introduce sbi_ipi_send_halt() APIAnup Patel
Instead of directly calling sbi_ipi_send_many(), we introduce sbi_ipi_send_halt() for halting a set of HARTs. This way in future we can assign any IPI event number for HART halting within sbi_ipi.c only. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-01-22lib: Introduce sbi_ipi_send_smode() APIAnup Patel
Instead of directly calling sbi_ipi_send_many(), we introduce sbi_ipi_send_smode() for injecting S-mode software interrupts. This way in future we can assign any IPI event number for S-mode IPIs within sbi_ipi.c only. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-01-22lib: Move struct sbi_ipi_data definition to sbi_ipi.cAnup Patel
The struct sbi_ipi_data is only used in sbi_ipi.c so move it to sbi_ipi.c from sbi_ipi.h. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-01-07lib: Add ipi exit APIAnup Patel
We add sbi_ipi_exit() API for exit path handling in sbi_exit() implementation. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2019-12-23lib: Add IPI extension in SBIAtish Patra
This patch adds new IPI extension which replaces ipi related v0.1 extensions. This also adds a new API for ipi sending as trap handling is not necessary in v0.2 SBI IPI related extensions. It also modifies the IPI sending code which now accepts hart mask as a value instead of S-mode virtual address. Thus, the caller should set it to exact hart mask value everytime. Signed-off-by: Atish Patra <atish.patra@wdc.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2019-12-23lib: Remove redundant IPI typesAtish Patra
We just need to distinguish only between FENCE and non FENCE related IPIs as all of the fence related requests are handled via fifo now. Remove the unnecessary IPI types related to individual fence types. Signed-off-by: Atish Patra <atish.patra@wdc.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2019-11-21lib: Better naming of unpriv APIs for wider useAnup Patel
The unpriv APIs can be useful to external firmware and out-of-tree platform support code. This patch adds "sbi_" prefix to unpriv load/store APIs and rename struct riscv_unpriv to struct sbi_trap_info everywhere. We also place struct sbi_trap_info in sbi/sbi_trap.h so that we can use it for sbi_trap_redirect() as well. Overall, this patch will make naming of unpriv APIs consistent with other OpenSBI APIs. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2019-05-24lib: Handle page/access fault caused by unpriv load/storeAnup Patel
The unpriv load/store instruction from M-mode can cause page/access fault to M-mode if S-mode page table did not have mappings OR it did not have PMP access permission. To tackle this, we redirect trap back to S-mode if unpriv load/store instruction traps in M-mode. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2019-05-24lib: Factor-out TLB management from IPI managementAnup Patel
This patch factor-out TLB management from IPI management to separate sources sbi_tlb.c and sbi_tlb.h. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2019-04-24all: run clang-format and update checked-in filesOlof Johansson
Noisy commit, no functional changes. Generated with an current upstream clang-format and: clang-format -i $(find . -name \*.[ch]) Signed-off-by: Olof Johansson <olof@lixom.net>
2019-04-24all: Annotate some tables to have clang-format leave them aloneOlof Johansson
One of the shortcomings of clang-format is that it doesn't allow for aligned define tables, which is used for a number of constants. Add annotation to disable the automatic formatting where needed. Signed-off-by: Olof Johansson <olof@lixom.net>
2019-04-03lib: Use a fifo to keep track of sfence related IPIs.Atish Patra
Currently, there is no provision for tracking multiple IPIs sent to a single hart at the same time by different harts. Use a fifo manage the outstanding requests. While dequeueing, read all the entries once, because we have only 1 bit to track the type of IPI. Once the queue is full, busy wait until the there is space available in queue. This is not the most elegant approach. It should be changed in favor of a wakeup event once available in opensbi. Signed-off-by: Atish Patra <atish.patra@wdc.com>
2019-04-03lib: Introduce a tlb info type.Atish Patra
Add a tlb info to distinguish between different type of tlb flush request pending. Signed-off-by: Atish Patra <atish.patra@wdc.com>
2019-03-12lib: Implement sfence.vma correctly.Atish Patra
Currently, OpenSBI doesn't distinguish between sfence.vma and sfence.vm asid calls. Moreover, it ignores the page ranges and just flush entire TLB everytime. Fix the sfence implementation by keeping all the tlb flush info in scratch area. The relevant Linux kernel code was added by https://patchwork.kernel.org/project/linux-riscv/list/?series=89695 However, this patch is backward compatible with older version kernel that doesn't have the above patches as well. Fixes #87 Signed-off-by: Atish Patra <atish.patra@wdc.com>
2019-01-24all: Update copyright header in all filesAnup patel
This patch updates copyright header in all files as follows: 1. Makes "SPDX-License-Identifier: BSD-2-Clause" as first line 2. Change copyright year to 2019 for Western Digital Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-01-23lib: Remove source_hart and hartid parameter from IPI callbacksAnup patel
The source_hart and hartid parameter is really not required in IPI callbacks of sbi_platform because current hartid can always be obtained by calling sbi_current_hartid() API. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2018-12-27lib: Simplify sbi_platform ipi_init() hooksAnup Patel
Instead of having separate ipi_init() hooks for cold and warm boot, this patch updates struct sbi_platform to have just one ipi_init() hook. The type of boot (cold or warm) is now a boolean flag parameter for the updated ipi_init() hook. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2018-12-11Initial commit.Anup Patel
Signed-off-by: Anup Patel <anup.patel@wdc.com>