Skip to content

Commit b202124

Browse files
kito-chengcmuellner
authored andcommitted
Speicfy length fields should initialized to zero if fails to detect the features
1 parent e1aa759 commit b202124

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/c-api.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,9 @@ The `__init_riscv_feature_bits` function updates `length`, `mvendorid`, `marchid
858858

859859
The `__init_riscv_feature_bits` function accepts an argument of type `void *`. This argument allows the platform to provide pre-computed data and access it without additional effort. For example, Linux could pass the vDSO object to avoid an extra system call.
860860

861-
NOTE: To detect failure of the `__init_riscv_feature_bits` function, it is recommended to check the bitmask for the `I` extension. The `I` extension must be supported in all valid RISC-V implementations.
861+
All `length` fields should be initialized to zero if `__init_riscv_feature_bits` fails to detect the features.
862+
863+
NOTE: To detect failure in the `__init_riscv_feature_bits` function, it is recommended to check that `__riscv_feature_bits.length` is non-zero.
862864

863865
Each queryable extension must have an associated `groupid` and `bitmask` that indicates its position within the features array.
864866

0 commit comments

Comments
 (0)