implement get_cpu_clock() for s390/s390x
[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
JA
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
9a9c63f1
JA
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
b12ebc65 21#define nop asm volatile ("diag 0,0,68" : : : "memory")
db6defc7 22#define read_barrier() asm volatile("bcr 15,0" : : : "memory")
44c47feb 23#define write_barrier() asm volatile("bcr 15,0" : : : "memory")
ebac4655 24
15cf40b2
DH
25static inline unsigned long long get_cpu_clock(void)
26{
27 unsigned long long clk;
28
29 __asm__ __volatile__("stck %0" : "=Q" (clk) : : "cc");
30 return clk;
31}
32
33#define ARCH_HAVE_INIT
34extern int tsc_reliable;
35static inline int arch_init(char *envp[])
36{
37 tsc_reliable = 1;
38 return 0;
39}
40
41#define ARCH_HAVE_CPU_CLOCK
42
ebac4655 43#endif