-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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 arm assembly simplifications #19794
Arch arm assembly simplifications #19794
Conversation
ARM user space requires ARM_MPU. We can, therefore, remove the unnecessary #ifdef CONFIG_ARM_MPU blocks in userspace.S. In addition, we do minor refactoring in z_arm_userspace_enter(), and z_arm_pendsv(), and z_arm_svc(), aiming at reducing the push/pop overhead as much as possible. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
arch/arm/core/swap_helper.S
Outdated
@@ -427,7 +427,7 @@ SECTION_FUNC(TEXT, z_arm_svc) | |||
|
|||
ldr r1, [r0, #24] /* grab address of PC from stack frame */ | |||
/* SVC is a two-byte instruction, point to it and read encoding */ |
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.
change this comment to reference reading the lower byte of SVC
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.
Right, thanks. Fixed now
Add more documentation and inline explanatory comments in assembly sources swap_helper.S and userspace.S and remove redundant/wrong documentation when applicable. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Some assembly simplifications, to make code common for ARMv6 and ARMv7 architecture. We can use ldrb, directly for reading the SVC encoding; this removes the need for ANDing the result with 0xff right below. We remove an immediate value of 0 from an str instruction, as it's redundant. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
877dc98
to
5029e44
Compare
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.
@agansari pls, take a look once more, and thanks for reviewing
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.
cool!
Preliminaries for #19689