unix: implement cpu_relax() for riscv64 (#5019)
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
This commit is contained in:
parent
885613f1fe
commit
e50d4e672e
@ -414,5 +414,7 @@ static void uv__cpu_relax(void) {
|
|||||||
__asm volatile ("" : : : "memory");
|
__asm volatile ("" : : : "memory");
|
||||||
#elif !defined(__APPLE__) && (defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__))
|
#elif !defined(__APPLE__) && (defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__))
|
||||||
__asm__ __volatile__ ("or 1,1,1; or 2,2,2" ::: "memory");
|
__asm__ __volatile__ ("or 1,1,1; or 2,2,2" ::: "memory");
|
||||||
|
#elif defined(__riscv) && __riscv_xlen == 64
|
||||||
|
__asm__ volatile(".insn 0x0100000f" ::: "memory"); /* FENCE */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user