]> git.proxmox.com Git - mirror_qemu.git/blame - include/qemu/processor.h
qapi: Fix dangling references to docs/devel/qapi-code-gen.txt
[mirror_qemu.git] / include / qemu / processor.h
CommitLineData
462cda50
EC
1/*
2 * Copyright (C) 2016, Emilio G. Cota <cota@braap.org>
3 *
4 * License: GNU GPL, version 2.
5 * See the COPYING file in the top-level directory.
6 */
7#ifndef QEMU_PROCESSOR_H
8#define QEMU_PROCESSOR_H
9
462cda50
EC
10#if defined(__i386__) || defined(__x86_64__)
11# define cpu_relax() asm volatile("rep; nop" ::: "memory")
12
462cda50
EC
13#elif defined(__aarch64__)
14# define cpu_relax() asm volatile("yield" ::: "memory")
15
16#elif defined(__powerpc64__)
17/* set Hardware Multi-Threading (HMT) priority to low; then back to medium */
18# define cpu_relax() asm volatile("or 1, 1, 1;" \
19 "or 2, 2, 2;" ::: "memory")
20
21#else
22# define cpu_relax() barrier()
23#endif
24
25#endif /* QEMU_PROCESSOR_H */