The 2 macros are exactly the same (rep;nop = pause) so there is no need
to implement our own.
#include <sys/limits.h>
#include <sys/rman.h>
#include <machine/resource.h>
+#include <machine/cpu.h>
#include <xen/xen-os.h>
#include <xen/hypervisor.h>
while (!((flags = shared[ref].flags) & GTF_transfer_committed)) {
if ( synch_cmpxchg(&shared[ref].flags, flags, 0) == flags )
return (0);
- cpu_relax();
+ cpu_spinwait();
}
/* If a transfer is in progress then wait until it is completed. */
while (!(flags & GTF_transfer_completed)) {
flags = shared[ref].flags;
- cpu_relax();
+ cpu_spinwait();
}
/* Read the frame number /after/ reading completion status. */
/* Everything below this point is not included by assembler (.S) files. */
#ifndef __ASSEMBLY__
-/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
-static inline void rep_nop(void)
-{
- __asm__ __volatile__ ( "rep;nop" : : : "memory" );
-}
-#define cpu_relax() rep_nop()
-
#endif /* !__ASSEMBLY__ */
#endif /* _MACHINE_X86_XEN_XEN_OS_H_ */