Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: gen_isr_tables.py: fix bad IRQ index computation for L3 interrupts #68781

Merged

Conversation

LaurentiuM1234
Copy link
Collaborator

@LaurentiuM1234 LaurentiuM1234 commented Feb 8, 2024

According to the Zephyr documentation, the multi-level interrupts are encoded as follows:
L1_ID | ((L2_ID + 1) << L2_BITS) | ((L3_ID + 1) << (L3_BITS + L2_BITS))
This means that when L3 interrupts are enabled, the gen_isr_table.py script will receive the value of L2_ID + 1. Currently, the script takes this value and directly compares it with the offsets set via CONFIG_3RD_LVL_INTR_xx_OFFSET. This is wrong because the values from said configurations are the same as L2_ID and because of that the script will generate an error. To fix this, use the value of L2_ID instead of L2_ID + 1.

To test this out simply enable L2 and L3 interrupts and statically connect an L3 interrupt. The build should break.

@LaurentiuM1234 LaurentiuM1234 force-pushed the gen_isr_script_fix branch 3 times, most recently from 5305566 to 8ef5488 Compare February 8, 2024 22:29
@LaurentiuM1234 LaurentiuM1234 changed the title build: gen_isr_table: fix bad IRQ index computation for L3 interrupts build: gen_isr_tables.py: fix bad IRQ index computation for L3 interrupts Feb 8, 2024
…upts

According to the Zephyr documentation, the multi-level interrupts
are encoded as follows:

`L1_ID | ((L2_ID + 1) << L2_BITS) | ((L3_ID + 1) << (L3_BITS + L2_BITS))`

This means that when L3 interrupts are enabled, the gen_isr_table.py
script will receive the value of L2_ID + 1. Currently, the script
takes this value and directly compares it with the offsets set via
`CONFIG_3RD_LVL_INTR_xx_OFFSET`. This is wrong because the values from
said configurations are the same as L2_ID and because of that the
script will generate an error. To fix this, use the value of L2_ID
instead of L2_ID + 1.

Signed-off-by: Laurentiu Mihalcea <[email protected]>
@LaurentiuM1234 LaurentiuM1234 marked this pull request as ready for review February 8, 2024 23:20
@zephyrbot zephyrbot added Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. area: Build System labels Feb 8, 2024
@tejlmand tejlmand requested a review from rakons February 14, 2024 21:24
@henrikbrixandersen henrikbrixandersen added the bug The issue is a bug, or the PR is fixing a bug label Feb 14, 2024
@henrikbrixandersen henrikbrixandersen merged commit 89a2a14 into zephyrproject-rtos:main Feb 14, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Build System bug The issue is a bug, or the PR is fixing a bug Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants