mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-03-16 03:41:24 +00:00
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:
parent
680b09872d
commit
db187d616c
5 changed files with 7 additions and 10 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue