zhangyu-duck opened a new pull request, #21307:
URL: https://github.com/apache/nuttx/pull/21307

   *Note: Please adhere to [Contributing 
Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
   
   ## Summary
   
   TriCore irq rework for interrupt context and priority handling:
   
   - use PSW.IS instead of g_interrupt_context to determine interrupt context 
(relies on the independent interrupt stack)
   - do not use up_interrupt_context() in the trap handler, which is already in 
interrupt context
   - use ICR.CCPN threshold masking instead of ICR.IE when 
CONFIG_ARCH_HIPRI_INTERRUPT is enabled (similar to ARM BASEPRI)
   - add a per-CPU SRPN-to-IRQ map, decoupling interrupt priority (SRPN) from 
the IRQ number
   - add tricore_register_irq_srpn() to register SRC interrupts configured 
externally by MCAL
   - remove the up_irq_to_ndx implementation, which treated SRPN directly as NDX
   - irq: shrink g_irqrevmap and g_srpn_to_irq element types from int to irq_t 
to save memory (the tables are replicated per CPU under BMP)
   
   ## Dependency
   
   Depends on #21151. This branch is stacked on top of it, so it also contains 
the commits of the dependent PR(s); only the last 7 commit(s) belong to this PR:
   
   - arch/tricore: use psw.is to determine interrupt context
   - arch/tricore: do not use up_interrupt_context() in trap handler
   - arch/tricore: use ICR.CCPN instead of ICR.IE for interrupt masking
   - arch/tricore: add srpn_to_irq map vector
   - arch/tricore: add tricore_register_irq_srpn for MCAL IRQ integration
   - arch/tricore: remove up_irq_to_ndx implementation
   - irq: shrink IRQ mapping table element types to save memory
   
   ## Impact
   
   Mostly TriCore (arch/tricore). The last commit also touches the common irq 
code (include/nuttx/irq.h, sched/irq/irq_attach.c): the element type changes 
from int to irq_t, which is sized to hold the largest IRQ number, so there is 
no truncation and no behavior change for other architectures. Adds the 
tricore_register_irq_srpn() API.
   
   ## Testing
   
   Built triboard_tc4x9_com:nsh (TC4xx, cmake) and a2g-tc397-5v-tft:nsh (TC3xx, 
both make and cmake) with tricore-elf-gcc on Ubuntu host. Each commit passes 
checkpatch and builds on its own.
   
   Tested on both TC4xx (TC4x9) and TC3xx (TC397) boards: system boots normally 
and ostest passes.
   
   ```
   nsh> uname -a
   NuttX 13.1.0 a87769e85b5 Oct 31 2026 21:32:03 tricore triboard_tc4x9_com
   nsh> ostest
   ...
   ostest_main: Exiting with status 0
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to