diff options
author | Anup patel <anup.patel@wdc.com> | 2019-01-22 11:50:59 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2019-01-23 06:09:26 +0300 |
commit | 18ec89e46e3cf8011b30deded6ea8d77720bdb3c (patch) | |
tree | e2fcd2f5fa1928a0f9b7d2b2c2dc8b42296d5d1e /lib | |
parent | fea9e2b5f37446845bec3cc9e2edd6f8308c2332 (diff) | |
download | opensbi-18ec89e46e3cf8011b30deded6ea8d77720bdb3c.tar.xz |
lib: Remove source_hart and hartid parameter from IPI callbacks
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sbi_ecall.c | 11 | ||||
-rw-r--r-- | lib/sbi_hart.c | 2 | ||||
-rw-r--r-- | lib/sbi_init.c | 4 | ||||
-rw-r--r-- | lib/sbi_ipi.c | 17 | ||||
-rw-r--r-- | lib/sbi_trap.c | 2 |
5 files changed, 17 insertions, 19 deletions
diff --git a/lib/sbi_ecall.c b/lib/sbi_ecall.c index 731a665..dc90488 100644 --- a/lib/sbi_ecall.c +++ b/lib/sbi_ecall.c @@ -54,23 +54,20 @@ int sbi_ecall_handler(u32 hartid, ulong mcause, ret = 0; break; case SBI_ECALL_CLEAR_IPI: - sbi_ipi_clear_smode(scratch, hartid); + sbi_ipi_clear_smode(scratch); ret = 0; break; case SBI_ECALL_SEND_IPI: - ret = sbi_ipi_send_many(scratch, hartid, - (ulong *)regs->a0, + ret = sbi_ipi_send_many(scratch, (ulong *)regs->a0, SBI_IPI_EVENT_SOFT); break; case SBI_ECALL_REMOTE_FENCE_I: - ret = sbi_ipi_send_many(scratch, hartid, - (ulong *)regs->a0, + ret = sbi_ipi_send_many(scratch, (ulong *)regs->a0, SBI_IPI_EVENT_FENCE_I); break; case SBI_ECALL_REMOTE_SFENCE_VMA: case SBI_ECALL_REMOTE_SFENCE_VMA_ASID: - ret = sbi_ipi_send_many(scratch, hartid, - (ulong *)regs->a0, + ret = sbi_ipi_send_many(scratch, (ulong *)regs->a0, SBI_IPI_EVENT_SFENCE_VMA); break; case SBI_ECALL_SHUTDOWN: diff --git a/lib/sbi_hart.c b/lib/sbi_hart.c index 7e5df72..68e492c 100644 --- a/lib/sbi_hart.c +++ b/lib/sbi_hart.c @@ -331,7 +331,7 @@ void sbi_hart_wake_coldboot_harts(struct sbi_scratch *scratch, u32 hartid) /* send an IPI to every other hart */ spin_lock(&coldboot_wait_bitmap_lock); if ((i != hartid) && (coldboot_wait_bitmap & (1UL << i))) - sbi_platform_ipi_inject(plat, i, hartid); + sbi_platform_ipi_inject(plat, i); spin_unlock(&coldboot_wait_bitmap_lock); } } diff --git a/lib/sbi_init.c b/lib/sbi_init.c index 7ae5f8b..ad1ae8a 100644 --- a/lib/sbi_init.c +++ b/lib/sbi_init.c @@ -49,7 +49,7 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid) if (rc) sbi_hart_hang(); - rc = sbi_ipi_init(scratch, hartid, TRUE); + rc = sbi_ipi_init(scratch, TRUE); if (rc) sbi_hart_hang(); @@ -115,7 +115,7 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid) if (rc) sbi_hart_hang(); - rc = sbi_ipi_init(scratch, hartid, FALSE); + rc = sbi_ipi_init(scratch, FALSE); if (rc) sbi_hart_hang(); diff --git a/lib/sbi_ipi.c b/lib/sbi_ipi.c index a612027..4ff02c6 100644 --- a/lib/sbi_ipi.c +++ b/lib/sbi_ipi.c @@ -19,7 +19,7 @@ #include <sbi/sbi_unpriv.h> int sbi_ipi_send_many(struct sbi_scratch *scratch, - u32 hartid, ulong *pmask, u32 event) + ulong *pmask, u32 event) { ulong i, m; struct sbi_scratch *oth; @@ -31,29 +31,30 @@ int sbi_ipi_send_many(struct sbi_scratch *scratch, /* send IPIs to everyone */ for (i = 0, m = mask; m; i++, m >>= 1) { - if ((m & 1) && !sbi_platform_hart_disabled(plat, hartid)) { + if ((m & 1) && !sbi_platform_hart_disabled(plat, i)) { oth = sbi_hart_id_to_scratch(scratch, i); atomic_raw_set_bit(event, &oth->ipi_type); mb(); - sbi_platform_ipi_inject(plat, i, hartid); + sbi_platform_ipi_inject(plat, i); if (event != SBI_IPI_EVENT_SOFT) - sbi_platform_ipi_sync(plat, i, hartid); + sbi_platform_ipi_sync(plat, i); } } return 0; } -void sbi_ipi_clear_smode(struct sbi_scratch *scratch, u32 hartid) +void sbi_ipi_clear_smode(struct sbi_scratch *scratch) { csr_clear(mip, MIP_SSIP); } -void sbi_ipi_process(struct sbi_scratch *scratch, u32 hartid) +void sbi_ipi_process(struct sbi_scratch *scratch) { struct sbi_platform *plat = sbi_platform_ptr(scratch); volatile unsigned long ipi_type; unsigned int ipi_event; + u32 hartid = sbi_current_hartid(); sbi_platform_ipi_clear(plat, hartid); @@ -79,11 +80,11 @@ void sbi_ipi_process(struct sbi_scratch *scratch, u32 hartid) } while(ipi_type > 0); } -int sbi_ipi_init(struct sbi_scratch *scratch, u32 hartid, bool cold_boot) +int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot) { /* Enable software interrupts */ csr_set(mie, MIP_MSIP); return sbi_platform_ipi_init(sbi_platform_ptr(scratch), - hartid, cold_boot); + cold_boot); } diff --git a/lib/sbi_trap.c b/lib/sbi_trap.c index 3c01660..d628c4c 100644 --- a/lib/sbi_trap.c +++ b/lib/sbi_trap.c @@ -150,7 +150,7 @@ void sbi_trap_handler(struct sbi_trap_regs *regs, sbi_timer_process(scratch, hartid); break; case IRQ_M_SOFT: - sbi_ipi_process(scratch, hartid); + sbi_ipi_process(scratch); break; default: msg = "unhandled external interrupt"; |