forked from Mirrors/opensbi
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>
This commit is contained in:
@@ -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:
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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();
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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";
|
||||
|
Reference in New Issue
Block a user