2015-11-26 09:52:51 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/* @brief improves contention in spinlocks
|
|
|
|
* hints the processor that we're in a spinlock and not doing much
|
|
|
|
*/
|
|
|
|
inline void cpu_relax()
|
|
|
|
{
|
2016-08-10 16:39:02 +08:00
|
|
|
// if IBMPower
|
|
|
|
// HMT_very_low()
|
|
|
|
// http://stackoverflow.com/questions/5425506/equivalent-of-x86-pause-instruction-for-ppc
|
2015-11-26 09:52:51 +08:00
|
|
|
asm("PAUSE");
|
|
|
|
}
|