Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 1 | #ifndef ARCH_S390_H |
| 2 | #define ARCH_S390_H |
| 3 | |
Jens Axboe | cca8464 | 2011-10-07 12:47:57 +0200 | [diff] [blame] | 4 | #define FIO_ARCH (arch_s390) |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 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 | |
Jens Axboe | 9a9c63f | 2008-06-04 14:48:29 +0200 | [diff] [blame] | 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 | |
Christian Ehrhardt | 1cffeb6 | 2014-04-08 17:52:01 +0200 | [diff] [blame] | 21 | #define nop asm volatile("nop" : : : "memory") |
Jens Axboe | db6defc | 2007-12-11 08:55:53 +0100 | [diff] [blame] | 22 | #define read_barrier() asm volatile("bcr 15,0" : : : "memory") |
Jens Axboe | 44c47fe | 2008-06-04 14:31:25 +0200 | [diff] [blame] | 23 | #define write_barrier() asm volatile("bcr 15,0" : : : "memory") |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 24 | |
Dan Horák | 15cf40b | 2012-12-30 17:03:36 -0500 | [diff] [blame] | 25 | static inline unsigned long long get_cpu_clock(void) |
| 26 | { |
| 27 | unsigned long long clk; |
| 28 | |
Christian Ehrhardt | 81795ce | 2014-04-10 15:09:47 +0200 | [diff] [blame] | 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 | */ |
Christian Ehrhardt | 919e789 | 2014-04-08 17:52:00 +0200 | [diff] [blame] | 34 | __asm__ __volatile__("stckf %0" : "=Q" (clk) : : "cc"); |
Christian Ehrhardt | 81795ce | 2014-04-10 15:09:47 +0200 | [diff] [blame] | 35 | #else |
| 36 | __asm__ __volatile__("stck %0" : "=Q" (clk) : : "cc"); |
| 37 | #endif |
Christian Ehrhardt | 919e789 | 2014-04-08 17:52:00 +0200 | [diff] [blame] | 38 | return clk>>12; |
Dan Horák | 15cf40b | 2012-12-30 17:03:36 -0500 | [diff] [blame] | 39 | } |
| 40 | |
Christian Ehrhardt | 919e789 | 2014-04-08 17:52:00 +0200 | [diff] [blame] | 41 | #define ARCH_CPU_CLOCK_CYCLES_PER_USEC 1 |
| 42 | #define ARCH_HAVE_CPU_CLOCK |
Christian Ehrhardt | bbc1f06 | 2015-02-27 08:20:46 -0700 | [diff] [blame] | 43 | #undef ARCH_CPU_CLOCK_WRAPS |
Christian Ehrhardt | 919e789 | 2014-04-08 17:52:00 +0200 | [diff] [blame] | 44 | |
Dan Horák | 15cf40b | 2012-12-30 17:03:36 -0500 | [diff] [blame] | 45 | #define ARCH_HAVE_INIT |
| 46 | extern int tsc_reliable; |
| 47 | static inline int arch_init(char *envp[]) |
| 48 | { |
| 49 | tsc_reliable = 1; |
| 50 | return 0; |
| 51 | } |
| 52 | |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 53 | #endif |