forked from Mirrors/opensbi
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:
@@ -26,9 +26,12 @@ int sbi_scratch_init(struct sbi_scratch *scratch)
|
|||||||
u32 i;
|
u32 i;
|
||||||
const struct sbi_platform *plat = sbi_platform_ptr(scratch);
|
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] =
|
hartid_to_scratch_table[i] =
|
||||||
((hartid2scratch)scratch->hartid_to_scratch)(i);
|
((hartid2scratch)scratch->hartid_to_scratch)(i);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user