summaryrefslogtreecommitdiff
path: root/lib/sbi/sbi_system.c
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-09-24 15:19:27 +0300
committerAnup Patel <anup@brainfault.org>2020-10-20 09:02:40 +0300
commite73b92d8623e9599245c6921025cfe0b40141f07 (patch)
tree0b0d25c7e5032c385c73f99a6fed8a174098d6b2 /lib/sbi/sbi_system.c
parentb1678af210dc4b4e6d586d6d96617e9641618994 (diff)
downloadopensbi-e73b92d8623e9599245c6921025cfe0b40141f07.tar.xz
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_system.c')
-rw-r--r--lib/sbi/sbi_system.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sbi/sbi_system.c b/lib/sbi/sbi_system.c
index 6f7be14..a938003 100644
--- a/lib/sbi/sbi_system.c
+++ b/lib/sbi/sbi_system.c
@@ -10,6 +10,7 @@
#include <sbi/riscv_asm.h>
#include <sbi/sbi_bitops.h>
+#include <sbi/sbi_domain.h>
#include <sbi/sbi_hart.h>
#include <sbi/sbi_hsm.h>
#include <sbi/sbi_platform.h>
@@ -21,10 +22,11 @@ void __noreturn sbi_system_reset(u32 platform_reset_type)
{
ulong hbase = 0, hmask;
u32 cur_hartid = current_hartid();
+ struct sbi_domain *dom = sbi_domain_thishart_ptr();
struct sbi_scratch *scratch = sbi_scratch_thishart_ptr();
/* Send HALT IPI to every hart other than the current hart */
- while (!sbi_hsm_hart_started_mask(hbase, &hmask)) {
+ while (!sbi_hsm_hart_started_mask(dom, hbase, &hmask)) {
if (hbase <= cur_hartid)
hmask &= ~(1UL << (cur_hartid - hbase));
if (hmask)