lib: sbi: Extend sbi_hartmask to support both hartid and hartindex

Currently, the sbi_hartmask is indexed by hartid which puts a
limit on hartid to be less than SBI_HARTMASK_MAX_BITS.

We extend the sbi_hartmask implementation to use hartindex and
support updating sbi_hartmask using hartid. This removes the
limit on hartid and existing code works largely unmodified.

Signed-off-by: Xiang W <wxjstz@126.com>
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
This commit is contained in:
Xiang W
2023-08-31 11:39:30 +08:00
committed by Anup Patel
parent e6125c3c4f
commit 296e70d69d
7 changed files with 105 additions and 60 deletions

View File

@@ -342,7 +342,7 @@ static int __fdt_parse_domain(void *fdt, int domain_offset, void *opaque)
if (!fdt_node_is_enabled(fdt, cpu_offset))
continue;
sbi_hartmask_set_hart(val32, mask);
sbi_hartmask_set_hartid(val32, mask);
}
}
@@ -472,7 +472,7 @@ static int __fdt_parse_domain(void *fdt, int domain_offset, void *opaque)
}
if (doffset == domain_offset)
sbi_hartmask_set_hart(val32, &assign_mask);
sbi_hartmask_set_hartid(val32, &assign_mask);
}
/* Register the domain */