diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-03-14 16:51:24 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-03-19 06:47:08 +0300 |
commit | c9f60fc6b7d940c970d4562656424aa9519e9b90 (patch) | |
tree | 775074d420e9d30950e5004457acdbabfd5c2cba /lib | |
parent | bd6ef02d47015706bc7a79cc16b3f19946889a3b (diff) | |
download | opensbi-c9f60fc6b7d940c970d4562656424aa9519e9b90.tar.xz |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sbi/sbi_scratch.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sbi/sbi_scratch.c b/lib/sbi/sbi_scratch.c index 2d03a60..fe0856e 100644 --- a/lib/sbi/sbi_scratch.c +++ b/lib/sbi/sbi_scratch.c @@ -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; } |