diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-03-18 15:20:12 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-03-19 09:23:12 +0530 |
commit | db187d616c6bfd9f01bbc566117bf5a6241660c1 (patch) | |
tree | 0a2ece0447e963d8ebe04fb31e0196a0331a49e8 | |
parent | 680b09872dd9fe43adfaa29dd95d0d035f5e0ac2 (diff) |
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>
-rw-r--r-- | include/sbi/sbi_hsm.h | 3 | ||||
-rw-r--r-- | lib/sbi/sbi_ecall_legacy.c | 2 | ||||
-rw-r--r-- | lib/sbi/sbi_hsm.c | 4 | ||||
-rw-r--r-- | lib/sbi/sbi_ipi.c | 4 | ||||
-rw-r--r-- | lib/sbi/sbi_system.c | 4 |
5 files changed, 7 insertions, 10 deletions
diff --git a/include/sbi/sbi_hsm.h b/include/sbi/sbi_hsm.h index 65aff9f..f2f39ba 100644 --- a/include/sbi/sbi_hsm.h +++ b/include/sbi/sbi_hsm.h @@ -28,8 +28,7 @@ int sbi_hsm_hart_stop(struct sbi_scratch *scratch, bool exitnow); int sbi_hsm_hart_get_state(u32 hartid); int sbi_hsm_hart_state_to_status(int state); bool sbi_hsm_hart_started(u32 hartid); -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); void sbi_hsm_prepare_next_jump(struct sbi_scratch *scratch, u32 hartid); #endif diff --git a/lib/sbi/sbi_ecall_legacy.c b/lib/sbi/sbi_ecall_legacy.c index cffef23..bd7ee5a 100644 --- a/lib/sbi/sbi_ecall_legacy.c +++ b/lib/sbi/sbi_ecall_legacy.c @@ -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; diff --git a/lib/sbi/sbi_hsm.c b/lib/sbi/sbi_hsm.c index 906a8eb..4a457ce 100644 --- a/lib/sbi/sbi_hsm.c +++ b/lib/sbi/sbi_hsm.c @@ -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; diff --git a/lib/sbi/sbi_ipi.c b/lib/sbi/sbi_ipi.c index 78db752..c60d34b 100644 --- a/lib/sbi/sbi_ipi.c +++ b/lib/sbi/sbi_ipi.c @@ -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) diff --git a/lib/sbi/sbi_system.c b/lib/sbi/sbi_system.c index 061cbf6..46ec36f 100644 --- a/lib/sbi/sbi_system.c +++ b/lib/sbi/sbi_system.c @@ -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) |