include: sbi_ipi: Remove scratch parameter from most functions
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>
This commit is contained in:
parent
54b2779cfe
commit
9e52a45f4b
|
@ -49,20 +49,19 @@ struct sbi_ipi_event_ops {
|
|||
void (* process)(struct sbi_scratch *scratch);
|
||||
};
|
||||
|
||||
int sbi_ipi_send_many(struct sbi_scratch *scratch, ulong hmask,
|
||||
ulong hbase, u32 event, void *data);
|
||||
int sbi_ipi_send_many(ulong hmask, ulong hbase, u32 event, void *data);
|
||||
|
||||
int sbi_ipi_event_create(const struct sbi_ipi_event_ops *ops);
|
||||
|
||||
void sbi_ipi_event_destroy(u32 event);
|
||||
|
||||
int sbi_ipi_send_smode(struct sbi_scratch *scratch, ulong hmask, ulong hbase);
|
||||
int sbi_ipi_send_smode(ulong hmask, ulong hbase);
|
||||
|
||||
void sbi_ipi_clear_smode(struct sbi_scratch *scratch);
|
||||
void sbi_ipi_clear_smode(void);
|
||||
|
||||
int sbi_ipi_send_halt(struct sbi_scratch *scratch, ulong hmask, ulong hbase);
|
||||
int sbi_ipi_send_halt(ulong hmask, ulong hbase);
|
||||
|
||||
void sbi_ipi_process(struct sbi_scratch *scratch);
|
||||
void sbi_ipi_process(void);
|
||||
|
||||
int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot);
|
||||
|
||||
|
|
|
@ -66,13 +66,13 @@ static int sbi_ecall_legacy_handler(unsigned long extid, unsigned long funcid,
|
|||
ret = sbi_getc();
|
||||
break;
|
||||
case SBI_EXT_0_1_CLEAR_IPI:
|
||||
sbi_ipi_clear_smode(scratch);
|
||||
sbi_ipi_clear_smode();
|
||||
break;
|
||||
case SBI_EXT_0_1_SEND_IPI:
|
||||
ret = sbi_load_hart_mask_unpriv((ulong *)args[0],
|
||||
&hmask, out_trap);
|
||||
if (ret != SBI_ETRAP)
|
||||
ret = sbi_ipi_send_smode(scratch, hmask, 0);
|
||||
ret = sbi_ipi_send_smode(hmask, 0);
|
||||
break;
|
||||
case SBI_EXT_0_1_REMOTE_FENCE_I:
|
||||
ret = sbi_load_hart_mask_unpriv((ulong *)args[0],
|
||||
|
|
|
@ -113,8 +113,7 @@ static int sbi_ecall_ipi_handler(unsigned long extid, unsigned long funcid,
|
|||
int ret = 0;
|
||||
|
||||
if (funcid == SBI_EXT_IPI_SEND_IPI)
|
||||
ret = sbi_ipi_send_smode(sbi_scratch_thishart_ptr(),
|
||||
args[0], args[1]);
|
||||
ret = sbi_ipi_send_smode(args[0], args[1]);
|
||||
else
|
||||
ret = SBI_ENOTSUPP;
|
||||
|
||||
|
|
|
@ -73,11 +73,11 @@ static int sbi_ipi_send(struct sbi_scratch *scratch, u32 remote_hartid,
|
|||
* set to all online harts if the intention is to send IPIs to all the harts.
|
||||
* If hmask is zero, no IPIs will be sent.
|
||||
*/
|
||||
int sbi_ipi_send_many(struct sbi_scratch *scratch, ulong hmask, ulong hbase,
|
||||
u32 event, void *data)
|
||||
int sbi_ipi_send_many(ulong hmask, ulong hbase, u32 event, void *data)
|
||||
{
|
||||
int rc;
|
||||
ulong i, m;
|
||||
struct sbi_scratch *scratch = sbi_scratch_thishart_ptr();
|
||||
|
||||
if (hbase != -1UL) {
|
||||
rc = sbi_hsm_hart_started_mask(hbase, &m);
|
||||
|
@ -143,12 +143,12 @@ static struct sbi_ipi_event_ops ipi_smode_ops = {
|
|||
|
||||
static u32 ipi_smode_event = SBI_IPI_EVENT_MAX;
|
||||
|
||||
int sbi_ipi_send_smode(struct sbi_scratch *scratch, ulong hmask, ulong hbase)
|
||||
int sbi_ipi_send_smode(ulong hmask, ulong hbase)
|
||||
{
|
||||
return sbi_ipi_send_many(scratch, hmask, hbase, ipi_smode_event, NULL);
|
||||
return sbi_ipi_send_many(hmask, hbase, ipi_smode_event, NULL);
|
||||
}
|
||||
|
||||
void sbi_ipi_clear_smode(struct sbi_scratch *scratch)
|
||||
void sbi_ipi_clear_smode(void)
|
||||
{
|
||||
csr_clear(CSR_MIP, MIP_SSIP);
|
||||
}
|
||||
|
@ -165,16 +165,17 @@ static struct sbi_ipi_event_ops ipi_halt_ops = {
|
|||
|
||||
static u32 ipi_halt_event = SBI_IPI_EVENT_MAX;
|
||||
|
||||
int sbi_ipi_send_halt(struct sbi_scratch *scratch, ulong hmask, ulong hbase)
|
||||
int sbi_ipi_send_halt(ulong hmask, ulong hbase)
|
||||
{
|
||||
return sbi_ipi_send_many(scratch, hmask, hbase, ipi_halt_event, NULL);
|
||||
return sbi_ipi_send_many(hmask, hbase, ipi_halt_event, NULL);
|
||||
}
|
||||
|
||||
void sbi_ipi_process(struct sbi_scratch *scratch)
|
||||
void sbi_ipi_process(void)
|
||||
{
|
||||
unsigned long ipi_type;
|
||||
unsigned int ipi_event;
|
||||
const struct sbi_ipi_event_ops *ipi_ops;
|
||||
struct sbi_scratch *scratch = sbi_scratch_thishart_ptr();
|
||||
const struct sbi_platform *plat = sbi_platform_ptr(scratch);
|
||||
struct sbi_ipi_data *ipi_data =
|
||||
sbi_scratch_offset_ptr(scratch, ipi_data_off);
|
||||
|
@ -244,7 +245,7 @@ void sbi_ipi_exit(struct sbi_scratch *scratch)
|
|||
csr_clear(CSR_MIE, MIP_MSIP);
|
||||
|
||||
/* Process pending IPIs */
|
||||
sbi_ipi_process(scratch);
|
||||
sbi_ipi_process();
|
||||
|
||||
/* Platform exit */
|
||||
sbi_platform_ipi_exit(sbi_platform_ptr(scratch));
|
||||
|
|
|
@ -47,7 +47,7 @@ void __noreturn sbi_system_reboot(struct sbi_scratch *scratch, u32 type)
|
|||
if (hbase <= cur_hartid)
|
||||
hmask &= ~(1UL << (cur_hartid - hbase));
|
||||
if (hmask)
|
||||
sbi_ipi_send_halt(scratch, hmask, hbase);
|
||||
sbi_ipi_send_halt(hmask, hbase);
|
||||
hbase += BITS_PER_LONG;
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ void __noreturn sbi_system_shutdown(struct sbi_scratch *scratch, u32 type)
|
|||
if (hbase <= cur_hartid)
|
||||
hmask &= ~(1UL << (cur_hartid - hbase));
|
||||
if (hmask)
|
||||
sbi_ipi_send_halt(scratch, hmask, hbase);
|
||||
sbi_ipi_send_halt(hmask, hbase);
|
||||
hbase += BITS_PER_LONG;
|
||||
}
|
||||
|
||||
|
|
|
@ -377,8 +377,7 @@ static u32 tlb_event = SBI_IPI_EVENT_MAX;
|
|||
|
||||
int sbi_tlb_request(ulong hmask, ulong hbase, struct sbi_tlb_info *tinfo)
|
||||
{
|
||||
return sbi_ipi_send_many(sbi_scratch_thishart_ptr(),
|
||||
hmask, hbase, tlb_event, tinfo);
|
||||
return sbi_ipi_send_many(hmask, hbase, tlb_event, tinfo);
|
||||
}
|
||||
|
||||
int sbi_tlb_init(struct sbi_scratch *scratch, bool cold_boot)
|
||||
|
|
|
@ -232,7 +232,7 @@ void sbi_trap_handler(struct sbi_trap_regs *regs)
|
|||
sbi_timer_process(sbi_scratch_thishart_ptr());
|
||||
break;
|
||||
case IRQ_M_SOFT:
|
||||
sbi_ipi_process(sbi_scratch_thishart_ptr());
|
||||
sbi_ipi_process();
|
||||
break;
|
||||
default:
|
||||
msg = "unhandled external interrupt";
|
||||
|
|
Loading…
Reference in New Issue