diff options
| author | Anup Patel <[email protected]> | 2020-01-15 11:02:14 +0530 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2020-01-22 12:10:35 +0530 |
| commit | 3d2aaac69a967ff1986f57862c4048d42acfe1ec (patch) | |
| tree | 9dc5ca7ed831638a1504ea6b715d8dfb9601af1a /lib | |
| parent | 046cc16e8be254e18df49da63fa521d2f54e3ce1 (diff) | |
lib: Introduce sbi_ipi_send_smode() API
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 <[email protected]>
Reviewed-by: Atish Patra <[email protected]>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sbi/sbi_ecall.c | 6 | ||||
| -rw-r--r-- | lib/sbi/sbi_ipi.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/sbi/sbi_ecall.c b/lib/sbi/sbi_ecall.c index 30e47c3f..6bf33ad3 100644 --- a/lib/sbi/sbi_ecall.c +++ b/lib/sbi/sbi_ecall.c @@ -155,8 +155,7 @@ int sbi_ecall_ipi_handler(struct sbi_scratch *scratch, unsigned long funcid, int ret = 0; if (funcid == SBI_EXT_IPI_SEND_IPI) - ret = sbi_ipi_send_many(scratch, args[0], args[1], - SBI_IPI_EVENT_SOFT, NULL); + ret = sbi_ipi_send_smode(scratch, args[0], args[1]); else ret = SBI_ENOTSUPP; @@ -282,8 +281,7 @@ int sbi_ecall_0_1_handler(struct sbi_scratch *scratch, unsigned long extid, ret = sbi_load_hart_mask_unpriv(scratch, (ulong *)args[0], &hmask, out_trap); if (ret != SBI_ETRAP) - ret = sbi_ipi_send_many(scratch, hmask, 0, - SBI_IPI_EVENT_SOFT, NULL); + ret = sbi_ipi_send_smode(scratch, hmask, 0); break; case SBI_EXT_0_1_REMOTE_FENCE_I: tlb_info.start = 0; diff --git a/lib/sbi/sbi_ipi.c b/lib/sbi/sbi_ipi.c index e5ebfb5d..701b49b9 100644 --- a/lib/sbi/sbi_ipi.c +++ b/lib/sbi/sbi_ipi.c @@ -101,6 +101,12 @@ int sbi_ipi_send_many(struct sbi_scratch *scratch, ulong hmask, ulong hbase, return 0; } +int sbi_ipi_send_smode(struct sbi_scratch *scratch, ulong hmask, ulong hbase) +{ + return sbi_ipi_send_many(scratch, hmask, hbase, + SBI_IPI_EVENT_SOFT, NULL); +} + void sbi_ipi_clear_smode(struct sbi_scratch *scratch) { csr_clear(CSR_MIP, MIP_SSIP); |
