mirror of
https://github.com/apache/nuttx.git
synced 2026-10-08 23:05:20 +00:00
arch/x86_64: use pause to reduce power consumption in spin wait loops
Signed-off-by: humzak711 <humzak711@gmail.com> This commit defines the UP_WFE() macro as the 'pause' instruction for x86_64. This optimization reduces power consumption and prevents pipeline flushes caused by memory ordering violations during contended spinlock acqusitions
This commit is contained in:
parent
97b64010cd
commit
46e03d0471
2 changed files with 3 additions and 0 deletions
|
|
@ -41,6 +41,8 @@
|
|||
|
||||
/* Include architecture-specific definitions */
|
||||
|
||||
#include <arch/barriers.h>
|
||||
|
||||
#ifdef CONFIG_ARCH_INTEL64
|
||||
# include <arch/intel64/arch.h>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -29,5 +29,6 @@
|
|||
#define UP_DMB() __asm__ __volatile__ ("mfence" ::: "memory")
|
||||
#define UP_RMB() __asm__ __volatile__ ("lfence" ::: "memory")
|
||||
#define UP_WMB() __asm__ __volatile__ ("sfence" ::: "memory")
|
||||
#define UP_WFE() __asm__ __volatile__ ("pause")
|
||||
|
||||
#endif /* __ARCH_X86_64_INCLUDE_BARRIERS_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue