-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
arch: _callee_saved_t
→ struct arch_csf
& pass csf
to fatal handling APIs
#78029
Conversation
Rename every architecture's `struct _callee_saved` to `struct arch_csf`. Signed-off-by: Yong Cong Sin <ycsin@meta.com> Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
_callee_savedt
-> struct arch_csf
& pass csf
to fatal handling APIs_callee_savedt
→ struct arch_csf
& pass csf
to fatal handling APIs
_callee_savedt
→ struct arch_csf
& pass csf
to fatal handling APIs_callee_saved_t
→ struct arch_csf
& pass csf
to fatal handling APIs
Make `struct arch_csf` compulsory for all architectures by declaring it in the `arch_interface.h` header. Update all references of `_callee_saved_t` internally to `struct arch_csf`. Update offsets generation with `struct arch_csf`. Signed-off-by: Yong Cong Sin <ycsin@meta.com> Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Add a note about the introduction of `struct arch_csf` and the deprecation of `_callee_saved_t`. Signed-off-by: Yong Cong Sin <ycsin@meta.com> Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
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.
Would maybe a cleaner way to do this be to move all the register block info out of the core kernel interface entirely? Then each arch can define its own arch-specific region of the stack frame struct (potentially even as a pointer to the context save data in the thread struct, avoiding some copies we currently have to do), and get the core kernel out of the business of trying to define what lives there?
Basically not loving the extra argument to z_fatal_error() -- that API should be getting less complicated, not more, IMHO.
I have a nagging impression that this is just too much churn. Why not simply adding a field in the esf structure for a csf pointer instead? Those architectures who care can do it, those who don't may ignore it, and |
Change `k_sys_fatal_error_handler()` & `z_fatal_error()` API to accept an additional `struct arch_csf` argument, which can be helpful to debug an error. Signed-off-by: Yong Cong Sin <ycsin@meta.com> Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
`ztest_post_fatal_error_hook()` now accepts an additional `struct arch_csf *pCsf` argument. Signed-off-by: Yong Cong Sin <ycsin@meta.com> Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
I did something similar internally by (ab)using the |
Sorry, I don't quite get this, could you elaborate this a little more, maybe with an arch as an example? |
True enough, though to be honest some churn here wouldn't be a bad thing. The "callee_saved" region is a weird mess, and very old. A clean abstraction for "how to pass arch-dependent exception data to the app fatal error handler" would definitely be a good thing. |
Is the rename of |
_callee_saved_t
struct _callee_saved
tostruct arch_csf
, and add it to thearch_interface.h
The goal is to pass arch-agnostic callee-saved-registers to
k_sys_fatal_error_handler
&z_fatal_error
, so that the error handlers can do more.This is somewhat similar to #73593