Skip to content

arch/tricore: enter svcall by jump and add bus error hook - #21150

Merged
xiaoxiang781216 merged 3 commits into
apache:masterfrom
zhangyu981027:tricore_trap_p1_1027
Nov 2, 2026
Merged

xiaoxiang781216 merged 3 commits into
apache:masterfrom
zhangyu981027:tricore_trap_p1_1027

Conversation

@zhangyu981027

@zhangyu981027 zhangyu981027 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Note: Please adhere to Contributing Guidelines.

Summary

TriCore trap handling preparation, independent of iLLD:

  • use 'ji' instead of 'call' to enter the svcall handler, saving one CSA per svcall
  • return from trapcall by jump, since it is now entered by jump
  • add a bus error hook so that safety bus tests can handle the expected bus error trap

Dependency

Depends on #21305.

Impact

TriCore architecture only (arch/tricore). No impact on other architectures.

Testing

Built triboard_tc4x9_com:nsh (TC4xx) and a2g-tc397-5v-tft:nsh (TC3xx) with tricore-elf-gcc on Ubuntu host (TC3xx with both make and cmake), each commit passes checkpatch.

Tested on both TC3xx (TC397) and TC4xx (TC4x9) boards: system boots normally, ostest passes, svcall/context switch and trap cases work as expected.

nsh> uname -a
NuttX 13.1.0 4017f750e76 Oct 30 2026 10:21:39 tricore a2g-tc397-5v-tft
nsh> ostest
...
ostest_main: Exiting with status 0

zhangyu981027 and others added 3 commits October 30, 2026 11:00
When a svcall trap is taken, the trap entry has already saved the
context into CSAs, and then the svcall handler is executed by 'call',
which allocates one more CSA that is not needed.

Use 'ji' to jump to the svcall handler instead, so one CSA is saved
for each svcall.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
The current trapcall function comes in through the jump instruction, so
the return method needs to be modified.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
Add tricore_bustrap_register_hook() so that safety test modules can
intercept expected bus errors during self-tests. If the registered
hook handles the trap, tricore_bustrap returns normally instead of
triggering a system panic.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
@github-actions github-actions Bot added Area: Tooling Arch: tricore Issues related to the TriCore architecture from Infineon Size: M The size of the change in this PR is medium labels Oct 30, 2026
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

@xiaoxiang781216
xiaoxiang781216 merged commit d738596 into apache:master Nov 2, 2026
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: tricore Issues related to the TriCore architecture from Infineon Area: Tooling Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants