mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 09:38:37 +08:00
arm64/common: Critical Section Optimization.
Replace critical_section with spinlock. The benefits of doing this are: 1. It makes the code logic clearer, with different resources protected by different locks. 2. It improves system responsiveness and avoids contention issues caused by acquiring the same large lock. Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
This commit is contained in:
@@ -60,16 +60,10 @@
|
|||||||
|
|
||||||
void arm64_fork_fpureg_save(struct fork_s *context)
|
void arm64_fork_fpureg_save(struct fork_s *context)
|
||||||
{
|
{
|
||||||
irqstate_t flags;
|
|
||||||
|
|
||||||
/* Take a snapshot of the thread fpu reg context right now */
|
/* Take a snapshot of the thread fpu reg context right now */
|
||||||
|
|
||||||
flags = enter_critical_section();
|
|
||||||
|
|
||||||
arm64_fpu_save(context->fpu);
|
arm64_fpu_save(context->fpu);
|
||||||
UP_DSB();
|
UP_DSB();
|
||||||
|
|
||||||
leave_critical_section(flags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user