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:
humzak711
2026-01-30 03:16:42 +00:00
committed by Alan C. Assis
parent 97b64010cd
commit 46e03d0471
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -41,6 +41,8 @@
/* Include architecture-specific definitions */
#include <arch/barriers.h>
#ifdef CONFIG_ARCH_INTEL64
# include <arch/intel64/arch.h>
#endif
+1
View File
@@ -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 */