Merge branch 'armv6' of https://github.com/sitsofe/fio
[fio.git] / arch / arch-s390.h
CommitLineData
ebac4655
JA
1#ifndef ARCH_S390_H
2#define ARCH_S390_H
3
cca84643 4#define FIO_ARCH (arch_s390)
ebac4655 5
1cffeb6f 6#define nop asm volatile("nop" : : : "memory")
db6defc7 7#define read_barrier() asm volatile("bcr 15,0" : : : "memory")
44c47feb 8#define write_barrier() asm volatile("bcr 15,0" : : : "memory")
ebac4655 9
15cf40b2
DH
10static inline unsigned long long get_cpu_clock(void)
11{
12 unsigned long long clk;
13
81795ce3
CE
14#ifdef CONFIG_S390_Z196_FACILITIES
15 /*
16 * Fio needs monotonic (never lower), but not strict monotonic (never
17 * the same) so store clock fast is enough.
18 */
919e789d 19 __asm__ __volatile__("stckf %0" : "=Q" (clk) : : "cc");
81795ce3
CE
20#else
21 __asm__ __volatile__("stck %0" : "=Q" (clk) : : "cc");
22#endif
919e789d 23 return clk>>12;
15cf40b2
DH
24}
25
919e789d
CE
26#define ARCH_CPU_CLOCK_CYCLES_PER_USEC 1
27#define ARCH_HAVE_CPU_CLOCK
96170421 28#undef ARCH_CPU_CLOCK_WRAPS
919e789d 29
15cf40b2 30#define ARCH_HAVE_INIT
24575392 31extern bool tsc_reliable;
15cf40b2
DH
32static inline int arch_init(char *envp[])
33{
24575392 34 tsc_reliable = true;
15cf40b2
DH
35 return 0;
36}
37
ebac4655 38#endif