diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/virtio/ringtest/main.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/virtio/ringtest/main.h b/tools/virtio/ringtest/main.h index 34e63cc4c572..14142faf040b 100644 --- a/tools/virtio/ringtest/main.h +++ b/tools/virtio/ringtest/main.h | |||
@@ -26,6 +26,16 @@ static inline void wait_cycles(unsigned long long cycles) | |||
26 | #define VMEXIT_CYCLES 500 | 26 | #define VMEXIT_CYCLES 500 |
27 | #define VMENTRY_CYCLES 500 | 27 | #define VMENTRY_CYCLES 500 |
28 | 28 | ||
29 | #elif defined(__s390x__) | ||
30 | static inline void wait_cycles(unsigned long long cycles) | ||
31 | { | ||
32 | asm volatile("0: brctg %0,0b" : : "d" (cycles)); | ||
33 | } | ||
34 | |||
35 | /* tweak me */ | ||
36 | #define VMEXIT_CYCLES 200 | ||
37 | #define VMENTRY_CYCLES 200 | ||
38 | |||
29 | #else | 39 | #else |
30 | static inline void wait_cycles(unsigned long long cycles) | 40 | static inline void wait_cycles(unsigned long long cycles) |
31 | { | 41 | { |
@@ -81,6 +91,8 @@ extern unsigned ring_size; | |||
81 | /* Is there a portable way to do this? */ | 91 | /* Is there a portable way to do this? */ |
82 | #if defined(__x86_64__) || defined(__i386__) | 92 | #if defined(__x86_64__) || defined(__i386__) |
83 | #define cpu_relax() asm ("rep; nop" ::: "memory") | 93 | #define cpu_relax() asm ("rep; nop" ::: "memory") |
94 | #elif defined(__s390x__) | ||
95 | #define cpu_relax() barrier() | ||
84 | #else | 96 | #else |
85 | #define cpu_relax() assert(0) | 97 | #define cpu_relax() assert(0) |
86 | #endif | 98 | #endif |