Wayne Thornton commented on a discussion on 
cpukit/score/cpu/x86_64/include/rtems/score/cpu.h: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1256#note_150896

 >  
 >  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

I would prefer to keep the `#define` as a way of providing a friendlier error 
message, as I have in the `dhrl.c` implementation. Example:

```
/* Enforce architectural hardware requirements at compile time */
#ifndef _CPU_Spin_wait
  #error "DHRL requires _CPU_Spin_wait() to be defined by the architecture."
#endif
```

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


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to