mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-25 07:41:42 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user