Files
Yaya48 cf256aa081 Import QEMU upstream snapshot d2e570c
Upstream: https://gitlab.com/qemu-project/qemu.git

Upstream-Commit: d2e570cc0f97b936902a5b1b86b73c0f5998b475
2026-08-31 02:15:30 +02:00

26 lines
665 B
C

/*
* Copyright (C) 2016, Emilio G. Cota <[email protected]>
*
* License: GNU GPL, version 2.
* See the COPYING file in the top-level directory.
*/
#ifndef QEMU_PROCESSOR_H
#define QEMU_PROCESSOR_H
#if defined(__x86_64__)
# define cpu_relax() asm volatile("rep; nop" ::: "memory")
#elif defined(__aarch64__)
# define cpu_relax() asm volatile("yield" ::: "memory")
#elif defined(__powerpc64__)
/* set Hardware Multi-Threading (HMT) priority to low; then back to medium */
# define cpu_relax() asm volatile("or 1, 1, 1;" \
"or 2, 2, 2;" ::: "memory")
#else
# define cpu_relax() barrier()
#endif
#endif /* QEMU_PROCESSOR_H */