diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-03-26 18:35:38 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-03-28 13:32:41 +0530 |
commit | dd0f21c560f7139fc0c30bea1c264d8cb09144fe (patch) | |
tree | fb5ab64dec0e8a39fe0036ff6def06d5dffb0a0f /lib/sbi/sbi_init.c | |
parent | 5b6957eed75ca7842861e0f6765d0f6a64408e05 (diff) |
lib: sbi_scratch: Introduce sbi_scratch_last_hartid() API
The patch adds sbi_scratch_last_hartid() API which returns
last HART id having a scratch space. We can use this new API
to optimize places where we iterate over HART id from 0 to
SBI_HARTMASK_MAX_BITS.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/sbi/sbi_init.c')
-rw-r--r-- | lib/sbi/sbi_init.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c index f0ce209..f448b79 100644 --- a/lib/sbi/sbi_init.c +++ b/lib/sbi/sbi_init.c @@ -128,7 +128,7 @@ static void wake_coldboot_harts(struct sbi_scratch *scratch, u32 hartid) coldboot_done = 1; /* Send an IPI to all HARTs waiting for coldboot */ - for (int i = 0; i < SBI_HARTMASK_MAX_BITS; i++) { + for (int i = 0; i <= sbi_scratch_last_hartid(); i++) { if ((i != hartid) && sbi_hartmask_test_hart(i, &coldboot_wait_hmask)) sbi_platform_ipi_send(plat, i); |