mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 23:41:23 +01:00
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:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user