blob: f4464c48b2fa146b6386d8c49cab5179f7484692 [file] [log] [blame]
Jens Axboeebac4652005-12-08 15:25:21 +01001#ifndef ARCH_IA64_H
2#define ARCH_IA64_H
3
Jens Axboecca84642011-10-07 12:47:57 +02004#define FIO_ARCH (arch_ia64)
Jens Axboeebac4652005-12-08 15:25:21 +01005
6#ifndef __NR_ioprio_set
7#define __NR_ioprio_set 1274
8#define __NR_ioprio_get 1275
9#endif
10
11#ifndef __NR_fadvise64
12#define __NR_fadvise64 1234
13#endif
14
Jens Axboe8756e4d2006-05-27 20:24:53 +020015#ifndef __NR_sys_splice
16#define __NR_sys_splice 1297
17#define __NR_sys_tee 1301
18#define __NR_sys_vmsplice 1302
19#endif
20
Jens Axboedb6defc2007-12-11 08:55:53 +010021#define nop asm volatile ("hint @pause" ::: "memory");
22#define read_barrier() asm volatile ("mf" ::: "memory")
Jens Axboe783500a2009-09-15 19:54:43 +020023#define write_barrier() asm volatile ("mf" ::: "memory")
Jens Axboeebac4652005-12-08 15:25:21 +010024
Jens Axboe8f7e39d2008-06-01 19:45:10 +020025#define ia64_popcnt(x) \
26({ \
27 unsigned long ia64_intri_res; \
28 asm ("popcnt %0=%1" : "=r" (ia64_intri_res) : "r" (x)); \
29 ia64_intri_res; \
30})
31
32static inline unsigned long arch_ffz(unsigned long bitmask)
33{
34 return ia64_popcnt(bitmask & (~bitmask - 1));
35}
Jens Axboeab480042010-03-24 13:35:28 +010036
37static inline unsigned long get_cpu_clock(void)
38{
39 unsigned long ret;
40
41 __asm__ __volatile__("mov %0=ar.itc" : "=r" (ret) : : "memory");
42 return ret;
43}
44
Jens Axboe8f7e39d2008-06-01 19:45:10 +020045#define ARCH_HAVE_FFZ
Jens Axboeab480042010-03-24 13:35:28 +010046#define ARCH_HAVE_CPU_CLOCK
Jens Axboe8f7e39d2008-06-01 19:45:10 +020047
Jens Axboeebac4652005-12-08 15:25:21 +010048#endif