tests: Fixes test-io-channel-file by mask only owner file state mask bits
[qemu/ar7.git] / include / qemu / processor.h
blob8e16c9277dbc7f52391bd69de6551ddb4bff3ed5
1 /*
2 * Copyright (C) 2016, Emilio G. Cota <cota@braap.org>
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
10 #include "qemu/atomic.h"
12 #if defined(__i386__) || defined(__x86_64__)
13 # define cpu_relax() asm volatile("rep; nop" ::: "memory")
15 #elif defined(__aarch64__)
16 # define cpu_relax() asm volatile("yield" ::: "memory")
18 #elif defined(__powerpc64__)
19 /* set Hardware Multi-Threading (HMT) priority to low; then back to medium */
20 # define cpu_relax() asm volatile("or 1, 1, 1;" \
21 "or 2, 2, 2;" ::: "memory")
23 #else
24 # define cpu_relax() barrier()
25 #endif
27 #endif /* QEMU_PROCESSOR_H */