riscv64: replace deprecated legacy extensions to SBI 2.0 extensions #1088
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The SBI legacy extensions are deprecated 4 years ago ( riscv-non-isa/riscv-sbi-doc@705e955 ). We replace it using functions from SBI 2.0 extensions. Specifically:
By updating to SBI 2.0, this commit supports to send IPI to hart IDs greater than 63 (on 64-bit devices). The current code encodes hart_id parameter in bit-vector like
1 << hart_id
, which will cause the bit to be shifted out fromusize
range whenhart_id >= 64
. SBI 2.0 fixed this problem by adding ahart_mask_base
parameter, allowing us to specify any hart ID withinusize
range when is provided as an SBI IPI hart mask.