-
Notifications
You must be signed in to change notification settings - Fork 8
Don't trash the LR returned from _undefined_handler. #30
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
Don't trash the LR returned from _undefined_handler. #30
Conversation
Also modifies the undef-exception test to make sure we can actually recover from an undef exception. And updates the abt-exception test to also check returning, and dealing with both A32 and T32 modes.
e85d1f2
to
4c451f6
Compare
< DFAR (Faulting Address Register): Dfar(39853)
---
> DFAR (Faulting Address Register): Dfar(39685)
12c12
< DFAR (Faulting Address Register): Dfar(39853)
---
> DFAR (Faulting Address Register): Dfar(39685) OK - we shouldn't print the address of linker allocated variables because they can move. |
The linker doesn't give a consistent address for the value used for the abort test, so check the address but don't print the address.
cortex-r-rt/src/lib.rs
Outdated
@@ -487,6 +483,8 @@ core::arch::global_asm!( | |||
"#, | |||
restore_context!(), | |||
r#" | |||
// overwrite the saved LR with the adjusted one |
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.
Am I understanding it correctly that the LR returned by the C/Rust handler is stored here, which does not necessarily have to be the adjusted LR?
Maybe "overwrite the saved LR with the one returned by the C handler" is better?
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.
yeah, fair, the handler could have but might not have adjusted the value
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.
fixed
Also modifies the undef-exception test to make sure we can actually recover from an undef exception. And updates the abt-exception test to also check returning, and dealing with both A32 and T32 modes.