-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[libcpu][cortex-m3]The parameter passed to the unified rt_exception_hook is exception_stack. #10619
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
…ook is exception_stack.
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.
Pull Request Overview
This PR modifies the parameter passed to the unified rt_exception_hook
function in the Cortex-M3 CPU port. The change passes the exception stack frame directly instead of the full exception info structure.
- Changes the parameter from
exception_info
toexception_stack
for thert_exception_hook
call - Extracts the exception stack frame from the exception info structure before passing it to the hook
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@@ -294,13 +294,14 @@ void rt_hw_hard_fault_exception(struct exception_info * exception_info) | |||
#if defined(RT_USING_FINSH) && defined(MSH_USING_BUILT_IN_COMMANDS) | |||
extern long list_thread(void); | |||
#endif | |||
struct stack_frame* context = &exception_info->stack_frame; | |||
struct exception_stack_frame *exception_stack = &exception_info->stack_frame.exception_stack_frame; |
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.
This change appears to be a breaking API change for rt_exception_hook. The hook function signature may need to be updated to accept struct exception_stack_frame* instead of struct exception_info*, and all existing hook implementations will need to be updated accordingly.
Copilot uses AI. Check for mistakes.
|
||
if (rt_exception_hook != RT_NULL) | ||
{ | ||
rt_err_t result; | ||
|
||
result = rt_exception_hook(exception_info); | ||
result = rt_exception_hook(exception_stack); |
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.
[nitpick] The variable name 'exception_stack' is potentially confusing since it's actually a pointer to an exception_stack_frame structure, not a stack itself. Consider renaming to 'exception_frame' or 'stack_frame' for clarity.
Copilot uses AI. Check for mistakes.
…s exception_stack. (RT-Thread#10619)
The parameter passed to the unified rt_exception_hook is exception_stack.
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
你的解决方案是什么 (what is your solution)
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0
代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up