RTEMS | cpukit/score/.../cpu.h: Implement _CPU_Spin_wait() (!1256)

Gedare Bloom (@gedare) gitlab at rtems.org
Fri May 22 21:25:40 UTC 2026




Gedare Bloom started a new discussion on cpukit/score/cpu/x86_64/include/rtems/score/cpu.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1256#note_150887

 >  
 >  typedef uintptr_t CPU_Uint32ptr;
 >  
 > +/**
 > + * Pauses the CPU pipeline to prevent aggressive speculative execution
 > + * and reduce thermal load during spin-wait loops.
 > + */
 > +static inline void _CPU_Spin_wait( void )
 > +{
 > +  __asm__ volatile( "pause" ::: "memory" );
 > +}
 > +
 > +/* Explicitly define the macro so the preprocessor can see it in DHRL API */
 > +#define _CPU_Spin_wait _CPU_Spin_wait

This is probably unnecessary. Attempting to use the function will be enough to cause a compilation failure, unless you feel you need a friendlier error message.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1256#note_150887
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260522/422abeb0/attachment.htm>


More information about the bugs mailing list