Skip to content

Commit

Permalink
Speicfy length fields should initialized to zero if fails to detect t…
Browse files Browse the repository at this point in the history
…he features
  • Loading branch information
kito-cheng committed Nov 8, 2024
1 parent e1aa759 commit ad1b5ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/c-api.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,9 @@ The `__init_riscv_feature_bits` function updates `length`, `mvendorid`, `marchid

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.

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.
All `length` fields should be initialized to zero if `__init_riscv_feature_bits` fails to detect the features.

NOTE: To detect failure in the `__init_riscv_feature_bits` function, it is recommended to check that `__riscv_feature_bits.length` is non-zero.

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

Expand Down

0 comments on commit ad1b5ec

Please sign in to comment.