JunyuanShen943 opened a new pull request, #22202:
URL: https://github.com/apache/nuttx/pull/22202
## Summary
* Why: class 1 (internal protection) traps, i.e. privilege and MPU
violations, always panic. A memory protection test therefore cannot
provoke an MPU fault on purpose and check that it fired.
* How: add `tricore_intprottrap_register_hook()`, mirroring the existing
`tricore_bustrap_register_hook()`. The hook gets the trap ID and the
saved lower context; returning OK resumes at the return address in A11
(the hook may advance it to skip the faulting instruction), ERROR falls
back to the default panic. With no hook registered the behavior is
unchanged.
## Impact
* New feature or changed behavior: YES, a new arch-internal hook API.
No change without a registered hook.
* User adaptation needed: NO.
* Build: NO.
* Hardware: TriCore only.
* Documentation: NO.
* Security: NO.
* Compatibility: NO.
## Testing
I confirm that changes are verified on local setup and works as intended:
* Build Host: Ubuntu 22.04 x86_64, gcc 13.1.0, tricore-elf-gcc
* Target: triboard_tc4x9_com:nsh, a2g-tc397-5v-tft:nsh (build only),
sim:nsh
Both TriCore configurations build on master and on this PR with no new
warnings in the changed files. sim:nsh make and CMake builds pass,
ostest exits with status 0, `tools/checkpatch.sh -m` is clean.
Not run on TriCore hardware for this PR.
## PR verification Self-Check
* [x] This PR introduces only one functional change.
* [x] I have updated all required description fields above.
* [x] My PR adheres to Contributing Guidelines and Documentation (git commit
title and message, coding standard, etc).
* [ ] My PR is still work in progress (not ready for review).
* [x] My PR is ready for review and can be safely merged into a codebase.
--
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]