-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: inline up_switch_context,in arm arm64 #13644
Conversation
@@ -76,6 +77,17 @@ | |||
|
|||
#ifndef __ASSEMBLY__ | |||
|
|||
#ifndef up_switch_context | |||
#define up_switch_context(tcb, rtcb) \ |
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.
why not use inline function?
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.
If we use inline, we need to see the definition of struct tcb_s, but irq.h can't include nuttx/sched.h
[Experimental Bot, please feedback here] No, this PR does not meet the NuttX Requirements. Missing Information:
Recommendations:
By addressing these points, your PR will be better aligned with NuttX's requirements and easier for reviewers to evaluate. |
4534662
to
656a877
Compare
@hujun260 modifications in the context switch requires deep testing, only ostest (you didn't say which arch was used) is not enough. History shows it always introduces regression. |
Please remove reference to VELAPLATFO-38287 |
I understand your concerns. We've tested this PR on multiple products internally. |
reason: when a context switch occurs, up_switch_context is executed. In order to reduce the time taken for context switching, we inline the up_switch_context function. Signed-off-by: hujun5 <hujun5@xiaomi.com>
compile error: Register: ostest Register: nsh Register: sh Register: hello Register: getprime In file included from /home/hujun5/downloads1/vela_sim/nuttx/include/arch/irq.h:35, from /home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/irq.h:37, from /home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/sched.h:40, from /home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/arch.h:87, from common/arm_signal_dispatch.c:26: common/arm_signal_dispatch.c: In function 'up_signal_dispatch': common/arm_signal_dispatch.c:72:3: error: 'asm' operand has impossible constraints 72 | sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo, | ^~~~~~~~~ make[1]: *** [Makefile:168:arm_signal_dispatch.o] error 1 Signed-off-by: hujun5 <hujun5@xiaomi.com>
@@ -423,6 +424,15 @@ static inline_function void up_set_current_regs(uint64_t *regs) | |||
__asm__ volatile ("msr " "tpidr_el1" ", %0" : : "r" (regs)); | |||
} | |||
|
|||
#define up_switch_context(tcb, rtcb) \ |
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.
let's create a new patch to inline other arch too
Summary
inline up_switch_context,in arm arm64
when a context switch occurs, up_switch_context is executed. In order to reduce the time taken for context switching, we inline the up_switch_context function.
Impact
arm,arm64
Testing
ostest