nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

inline restore_critical_section and add parameters to restore_critical_section

Open hujun260 opened this issue 1 year ago • 1 comments

Summary

In the SMP, when a context switch occurs, restore_critical_section is executed. In order to reduce the time taken for context switching, we inline the restore_critical_section function and we directly pass the required parameters to restore_critical_section instead of acquiring them repeatedly. Given that restore_critical_section is small in size and is called from only one location, inlining it does not increase the size of the image.

Impact

none

Testing

ostest

hujun260 avatar Aug 29 '24 03:08 hujun260

Please include a commit log explaining why to implement it as inline macro instead of just changing the function to inline

ok

hujun260 avatar Aug 30 '24 02:08 hujun260

@hujun260 please fix the conflict

xiaoxiang781216 avatar Sep 07 '24 10:09 xiaoxiang781216