-
Notifications
You must be signed in to change notification settings - Fork 3k
Refactoring fault handler implementation #8332
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good. Refactor like this should contain more info in the commit msg
Mbed Fault Handler was originally placed under rtos folder because of its dependency on some of the RTX data structures for capturing the thread info. But with the new error handling in place thread info collection on hardfaults has been moved to Mbed_error handler. There is no point for fault handler implementation to exist under rtos and can be used for RTOS-less builds as well. So moving under platform folder. Also removing some references to RTX data structs like osRtxInfo from fault handler implementation.
Can this be added there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
6b5539f
to
a873ef8
Compare
@0xc0170 - Commit msg has been updated, please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if adding TARGET_ and TOOLCHAIN_ specific folders in platform is a good idea. I would rather move Cortex-M specific toolchain dependent code to CMSIS folder (if not dependent on RTOS)
I would not expect to have these folders in platform or drivers. CMSIS sounds as a good place to have these in. What others think? |
I don't mind moving these under CMSIS, but the exception handler is no longer RTOS specific or CMSIS-specific and can be used by RTOS-less or CMSIS-less builds as well. The only reason I can think of is usage of SCB struct which we can get rid of as well. Should we still move it out? |
Yes @SenRamakri though it is not Cmsis dependent but core specific code is in CMSIS.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any particular reason why we couldn't have TARGET_ folders under platform, and this code is more closely related to platform than anything in cmsis.
But then the start up code which calls mbed_main and main is over in there, and this exception stuff calling mbed_fault_handler probably belongs alongside it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to save a couple of words, I'm wondering why
LDR R3,=mbed_fault_handler
BLX R3
and not just
BL mbed_fault_handler
(Actually, there are tons of potential savings in this assembler, but that's a straightforward de-obfustication.)
a873ef8
to
0b41a28
Compare
Changes addressed. Please re-review.
… its dependency on some of the RTX data structures for capturing the thread info. But with the new error handling in place thread info collection on hardfaults has been moved to Mbed_error handler. There is no point for fault handler implementation to exist under rtos and can be used for RTOS-less builds as well. So moving under platform folder. Also removing some references to RTX data structs like osRtxInfo from fault handler implementation.
0b41a28
to
230ba03
Compare
Please review, I have addressed the review comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
I think the particular reason for that would be that it would require a tweak of the tools to handle the updated structure. In any case, it looks like your optimization comments have been addressed. /morph build |
Build : SUCCESSBuild number : 3447 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 3068 |
New greentea tests should be complete within two hours. |
Test : SUCCESSBuild number : 3238 |
Yes not they are, waiting for CI ! |
Description
Mbed Fault Handler was originally placed under rtos folder because of its dependency on some of the RTX data structures for capturing the thread info. But with the new error handling in place thread info collection on hardfaults has been moved to Mbed_error handler. There is no point for fault handler implementation to exist under rtos and can be used for RTOS-less builds as well. So moving under platform folder. Also removing some references to RTX data structs like osRtxInfo from fault handler implementation.
Pull request type