forked from Mirrors/opensbi
lib: sbi: Rename sbi_hsm_hart_started_mask() function
A hart can take interrupt in the new HSM states introduced by the SBI HSM suspend function (such as SUSPENDED state) so we rename sbi_hsm_hart_started_mask() to something more generic such as sbi_hsm_hart_interruptible_mask(). Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
@@ -23,8 +23,8 @@ int sbi_hsm_hart_start(struct sbi_scratch *scratch,
|
|||||||
u32 hartid, ulong saddr, ulong smode, ulong priv);
|
u32 hartid, ulong saddr, ulong smode, ulong priv);
|
||||||
int sbi_hsm_hart_stop(struct sbi_scratch *scratch, bool exitnow);
|
int sbi_hsm_hart_stop(struct sbi_scratch *scratch, bool exitnow);
|
||||||
int sbi_hsm_hart_get_state(const struct sbi_domain *dom, u32 hartid);
|
int sbi_hsm_hart_get_state(const struct sbi_domain *dom, u32 hartid);
|
||||||
int sbi_hsm_hart_started_mask(const struct sbi_domain *dom,
|
int sbi_hsm_hart_interruptible_mask(const struct sbi_domain *dom,
|
||||||
ulong hbase, ulong *out_hmask);
|
ulong hbase, ulong *out_hmask);
|
||||||
void sbi_hsm_prepare_next_jump(struct sbi_scratch *scratch, u32 hartid);
|
void sbi_hsm_prepare_next_jump(struct sbi_scratch *scratch, u32 hartid);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -34,8 +34,8 @@ static int sbi_load_hart_mask_unpriv(ulong *pmask, ulong *hmask,
|
|||||||
if (uptrap->cause)
|
if (uptrap->cause)
|
||||||
return SBI_ETRAP;
|
return SBI_ETRAP;
|
||||||
} else {
|
} else {
|
||||||
sbi_hsm_hart_started_mask(sbi_domain_thishart_ptr(),
|
sbi_hsm_hart_interruptible_mask(sbi_domain_thishart_ptr(),
|
||||||
0, &mask);
|
0, &mask);
|
||||||
}
|
}
|
||||||
*hmask = mask;
|
*hmask = mask;
|
||||||
|
|
||||||
|
@@ -70,8 +70,8 @@ static bool sbi_hsm_hart_started(const struct sbi_domain *dom, u32 hartid)
|
|||||||
* @return 0 on success and SBI_Exxx (< 0) on failure
|
* @return 0 on success and SBI_Exxx (< 0) on failure
|
||||||
* Note: the output HART mask will be set to zero on failure as well.
|
* Note: the output HART mask will be set to zero on failure as well.
|
||||||
*/
|
*/
|
||||||
int sbi_hsm_hart_started_mask(const struct sbi_domain *dom,
|
int sbi_hsm_hart_interruptible_mask(const struct sbi_domain *dom,
|
||||||
ulong hbase, ulong *out_hmask)
|
ulong hbase, ulong *out_hmask)
|
||||||
{
|
{
|
||||||
ulong i, hmask, dmask;
|
ulong i, hmask, dmask;
|
||||||
ulong hend = sbi_scratch_last_hartid() + 1;
|
ulong hend = sbi_scratch_last_hartid() + 1;
|
||||||
|
@@ -82,7 +82,7 @@ int sbi_ipi_send_many(ulong hmask, ulong hbase, u32 event, void *data)
|
|||||||
struct sbi_scratch *scratch = sbi_scratch_thishart_ptr();
|
struct sbi_scratch *scratch = sbi_scratch_thishart_ptr();
|
||||||
|
|
||||||
if (hbase != -1UL) {
|
if (hbase != -1UL) {
|
||||||
rc = sbi_hsm_hart_started_mask(dom, hbase, &m);
|
rc = sbi_hsm_hart_interruptible_mask(dom, hbase, &m);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
m &= hmask;
|
m &= hmask;
|
||||||
@@ -94,7 +94,7 @@ int sbi_ipi_send_many(ulong hmask, ulong hbase, u32 event, void *data)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
hbase = 0;
|
hbase = 0;
|
||||||
while (!sbi_hsm_hart_started_mask(dom, hbase, &m)) {
|
while (!sbi_hsm_hart_interruptible_mask(dom, hbase, &m)) {
|
||||||
/* Send IPIs */
|
/* Send IPIs */
|
||||||
for (i = hbase; m; i++, m >>= 1) {
|
for (i = hbase; m; i++, m >>= 1) {
|
||||||
if (m & 1UL)
|
if (m & 1UL)
|
||||||
|
@@ -35,7 +35,7 @@ void __noreturn sbi_system_reset(u32 reset_type, u32 reset_reason)
|
|||||||
struct sbi_scratch *scratch = sbi_scratch_thishart_ptr();
|
struct sbi_scratch *scratch = sbi_scratch_thishart_ptr();
|
||||||
|
|
||||||
/* Send HALT IPI to every hart other than the current hart */
|
/* Send HALT IPI to every hart other than the current hart */
|
||||||
while (!sbi_hsm_hart_started_mask(dom, hbase, &hmask)) {
|
while (!sbi_hsm_hart_interruptible_mask(dom, hbase, &hmask)) {
|
||||||
if (hbase <= cur_hartid)
|
if (hbase <= cur_hartid)
|
||||||
hmask &= ~(1UL << (cur_hartid - hbase));
|
hmask &= ~(1UL << (cur_hartid - hbase));
|
||||||
if (hmask)
|
if (hmask)
|
||||||
|
Reference in New Issue
Block a user