lib: sbi_scratch: Don't set hartid_to_scratch table for disabled HART

As a step towards supporting discontinuous and sparse HART ids, we
don't set hartid_to_scratch table for disabled HARTs.

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:
Anup Patel 2020-03-14 19:21:24 +05:30 committed by Anup Patel
parent bd6ef02d47
commit c9f60fc6b7
1 changed files with 4 additions and 1 deletions

View File

@ -26,9 +26,12 @@ int sbi_scratch_init(struct sbi_scratch *scratch)
u32 i;
const struct sbi_platform *plat = sbi_platform_ptr(scratch);
for (i = 0; i < sbi_platform_hart_count(plat); i++)
for (i = 0; i < sbi_platform_hart_count(plat); i++) {
if (sbi_platform_hart_disabled(plat, i))
continue;
hartid_to_scratch_table[i] =
((hartid2scratch)scratch->hartid_to_scratch)(i);
}
return 0;
}