forked from Mirrors/opensbi
		
	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 <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user