diff options
| author | Xiang W <[email protected]> | 2023-10-31 00:39:40 +0800 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2023-11-17 13:23:49 +0530 |
| commit | 6602e11de375b761d778808cc38645fce314c4fa (patch) | |
| tree | 534c8de289a207d5a58fa5ee6d1bd6abf4990d5b /include | |
| parent | 6e5b0cfb4520d0c2d36ae1005770f2537970e90a (diff) | |
lib: sbi: change sbi_hart_features.extensions as an array
In the future there may be a lot of ISA extensions, a 'long' may not
be able to accommodate, changed to an array for the future.
Addresses-Coverity-ID: 1568357 Out-of-bounds access
Fixes: 6259b2ec2d09 ("lib: utils/fdt: Fix fdt_parse_isa_extensions()
implementation")
Signed-off-by: Xiang W <[email protected]>
Reviewed-by: Heinrich Schuchardt <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sbi/sbi_hart.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h index fe1124ab..6ee49ffc 100644 --- a/include/sbi/sbi_hart.h +++ b/include/sbi/sbi_hart.h @@ -11,6 +11,7 @@ #define __SBI_HART_H__ #include <sbi/sbi_types.h> +#include <sbi/sbi_bitops.h> /** Possible privileged specification versions of a hart */ enum sbi_hart_priv_versions { @@ -67,7 +68,7 @@ enum sbi_hart_extensions { struct sbi_hart_features { bool detected; int priv_version; - unsigned long extensions; + unsigned long extensions[BITS_TO_LONGS(SBI_HART_EXT_MAX)]; unsigned int pmp_count; unsigned int pmp_addr_bits; unsigned long pmp_gran; |
