fix(aia): external interrupt priority from PLIC or IMSIC #785
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 current external interrupts come from two sources,
PLIC
andIMSIC
.The external interrupt priority number of PLIC is
0
, and the external interrupt priority number of IMSIC is1~2047
.We use the global variable
external_interrupt_select
to determine the source of the external interrupt.If the external interrupt comes from PLIC,
external_interrupt_select
= false;if the external interrupt comes from IMSIC,
external_interrupt_select
= true.The case where the priority number is greater than
255
is added to the interrupt priority comparison method.The priority number of each interrupt in the
iprios array
occupies8
bits, and its read data is masked by the corresponding bit of thexie
register, so when writing thexie
register, theread data
of theiprios array
needs to be updated.