diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-09-24 17:49:27 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-10-20 11:32:40 +0530 |
commit | e73b92d8623e9599245c6921025cfe0b40141f07 (patch) | |
tree | 0b0d25c7e5032c385c73f99a6fed8a174098d6b2 /lib/sbi/sbi_ipi.c | |
parent | b1678af210dc4b4e6d586d6d96617e9641618994 (diff) |
lib: sbi: Extend sbi_hsm_hart_started_mask() for domains
The sbi_hsm_hart_started_mask() API should take one more parameter
to allow caller specify domain under which started_mask is being
generated. Further, the sbi_hsm_hart_started_mask() depends on
sbi_hsm_hart_get_state() which also should return HART state under
specified domain.
This patch updates both sbi_hsm_hart_started_mask() and
sbi_hsm_hart_get_state() as-per above.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'lib/sbi/sbi_ipi.c')
-rw-r--r-- | lib/sbi/sbi_ipi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sbi/sbi_ipi.c b/lib/sbi/sbi_ipi.c index a27dea0..4347832 100644 --- a/lib/sbi/sbi_ipi.c +++ b/lib/sbi/sbi_ipi.c @@ -12,6 +12,7 @@ #include <sbi/riscv_atomic.h> #include <sbi/riscv_barrier.h> #include <sbi/sbi_bitops.h> +#include <sbi/sbi_domain.h> #include <sbi/sbi_error.h> #include <sbi/sbi_hart.h> #include <sbi/sbi_hsm.h> @@ -77,10 +78,11 @@ int sbi_ipi_send_many(ulong hmask, ulong hbase, u32 event, void *data) { int rc; ulong i, m; + struct sbi_domain *dom = sbi_domain_thishart_ptr(); struct sbi_scratch *scratch = sbi_scratch_thishart_ptr(); if (hbase != -1UL) { - rc = sbi_hsm_hart_started_mask(hbase, &m); + rc = sbi_hsm_hart_started_mask(dom, hbase, &m); if (rc) return rc; m &= hmask; @@ -92,7 +94,7 @@ int sbi_ipi_send_many(ulong hmask, ulong hbase, u32 event, void *data) } } else { hbase = 0; - while (!sbi_hsm_hart_started_mask(hbase, &m)) { + while (!sbi_hsm_hart_started_mask(dom, hbase, &m)) { /* Send IPIs */ for (i = hbase; m; i++, m >>= 1) { if (m & 1UL) |