Merge branch 'master' of git://github.com/rootfs/fio
[fio.git] / arch / arch-s390.h
1 #ifndef ARCH_S390_H
2 #define ARCH_S390_H
3
4 #define FIO_ARCH        (arch_s390)
5
6 #ifndef __NR_ioprio_set
7 #define __NR_ioprio_set         282
8 #define __NR_ioprio_get         283
9 #endif
10
11 #ifndef __NR_fadvise64
12 #define __NR_fadvise64          253
13 #endif
14
15 #ifndef __NR_sys_splice
16 #define __NR_sys_splice         306
17 #define __NR_sys_tee            308
18 #define __NR_sys_vmsplice       309
19 #endif
20
21 #define nop             asm volatile("nop" : : : "memory")
22 #define read_barrier()  asm volatile("bcr 15,0" : : : "memory")
23 #define write_barrier() asm volatile("bcr 15,0" : : : "memory")
24
25 static inline unsigned long long get_cpu_clock(void)
26 {
27         unsigned long long clk;
28
29 #ifdef CONFIG_S390_Z196_FACILITIES
30         /*
31          * Fio needs monotonic (never lower), but not strict monotonic (never
32          * the same) so store clock fast is enough.
33          */
34         __asm__ __volatile__("stckf %0" : "=Q" (clk) : : "cc");
35 #else
36         __asm__ __volatile__("stck %0" : "=Q" (clk) : : "cc");
37 #endif
38         return clk>>12;
39 }
40
41 #define ARCH_CPU_CLOCK_CYCLES_PER_USEC 1
42 #define ARCH_HAVE_CPU_CLOCK
43
44 #define ARCH_HAVE_INIT
45 extern int tsc_reliable;
46 static inline int arch_init(char *envp[])
47 {
48         tsc_reliable = 1;
49         return 0;
50 }
51
52 #endif