forked from Mirrors/opensbi
		
	lib: sbi_hsm: Remove scratch parameter from hart_started_mask() API
The scratch parameter in sbi_hsm_hart_started_mask() API is now redundant hence removing it. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
		@@ -33,7 +33,7 @@ static int sbi_load_hart_mask_unpriv(struct sbi_scratch *scratch,
 | 
			
		||||
		if (uptrap->cause)
 | 
			
		||||
			return SBI_ETRAP;
 | 
			
		||||
	} else {
 | 
			
		||||
		sbi_hsm_hart_started_mask(scratch, 0, &mask);
 | 
			
		||||
		sbi_hsm_hart_started_mask(0, &mask);
 | 
			
		||||
	}
 | 
			
		||||
	*hmask = mask;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -80,14 +80,12 @@ bool sbi_hsm_hart_started(u32 hartid)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Get ulong HART mask for given HART base ID
 | 
			
		||||
 * @param scratch the per-HART scratch pointer
 | 
			
		||||
 * @param hbase the HART base ID
 | 
			
		||||
 * @param out_hmask the output ulong HART mask
 | 
			
		||||
 * @return 0 on success and SBI_Exxx (< 0) on failure
 | 
			
		||||
 * Note: the output HART mask will be set to zero on failure as well.
 | 
			
		||||
 */
 | 
			
		||||
int sbi_hsm_hart_started_mask(struct sbi_scratch *scratch,
 | 
			
		||||
			      ulong hbase, ulong *out_hmask)
 | 
			
		||||
int sbi_hsm_hart_started_mask(ulong hbase, ulong *out_hmask)
 | 
			
		||||
{
 | 
			
		||||
	ulong i;
 | 
			
		||||
	ulong hcount = SBI_HARTMASK_MAX_BITS;
 | 
			
		||||
 
 | 
			
		||||
@@ -80,7 +80,7 @@ int sbi_ipi_send_many(struct sbi_scratch *scratch, ulong hmask, ulong hbase,
 | 
			
		||||
	ulong i, m;
 | 
			
		||||
 | 
			
		||||
	if (hbase != -1UL) {
 | 
			
		||||
		rc = sbi_hsm_hart_started_mask(scratch, hbase, &m);
 | 
			
		||||
		rc = sbi_hsm_hart_started_mask(hbase, &m);
 | 
			
		||||
		if (rc)
 | 
			
		||||
			return rc;
 | 
			
		||||
		m &= hmask;
 | 
			
		||||
@@ -92,7 +92,7 @@ int sbi_ipi_send_many(struct sbi_scratch *scratch, ulong hmask, ulong hbase,
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		hbase = 0;
 | 
			
		||||
		while (!sbi_hsm_hart_started_mask(scratch, hbase, &m)) {
 | 
			
		||||
		while (!sbi_hsm_hart_started_mask(hbase, &m)) {
 | 
			
		||||
			/* Send IPIs */
 | 
			
		||||
			for (i = hbase; m; i++, m >>= 1) {
 | 
			
		||||
				if (m & 1UL)
 | 
			
		||||
 
 | 
			
		||||
@@ -43,7 +43,7 @@ void __noreturn sbi_system_reboot(struct sbi_scratch *scratch, u32 type)
 | 
			
		||||
	u32 cur_hartid = current_hartid();
 | 
			
		||||
 | 
			
		||||
	/* Send HALT IPI to every hart other than the current hart */
 | 
			
		||||
	while (!sbi_hsm_hart_started_mask(scratch, hbase, &hmask)) {
 | 
			
		||||
	while (!sbi_hsm_hart_started_mask(hbase, &hmask)) {
 | 
			
		||||
		if (hbase <= cur_hartid)
 | 
			
		||||
			hmask &= ~(1UL << (cur_hartid - hbase));
 | 
			
		||||
		if (hmask)
 | 
			
		||||
@@ -67,7 +67,7 @@ void __noreturn sbi_system_shutdown(struct sbi_scratch *scratch, u32 type)
 | 
			
		||||
	u32 cur_hartid = current_hartid();
 | 
			
		||||
 | 
			
		||||
	/* Send HALT IPI to every hart other than the current hart */
 | 
			
		||||
	while (!sbi_hsm_hart_started_mask(scratch, hbase, &hmask)) {
 | 
			
		||||
	while (!sbi_hsm_hart_started_mask(hbase, &hmask)) {
 | 
			
		||||
		if (hbase <= cur_hartid)
 | 
			
		||||
			hmask &= ~(1UL << (cur_hartid - hbase));
 | 
			
		||||
		if (hmask)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user