8 #include <sys/fadvise.h>
10 #include <sys/mpctl.h>
11 #include <sys/diskio.h>
12 #include <sys/param.h>
13 #include <sys/pstat.h>
20 #define FIO_HAVE_POSIXAIO
21 #define FIO_HAVE_ODIRECT
22 #define FIO_USE_GENERIC_RAND
23 #define FIO_HAVE_CLOCK_MONOTONIC
24 #define FIO_HAVE_PSHARED_MUTEX
25 #define FIO_HAVE_FADVISE
26 #define FIO_HAVE_CHARDEV_SIZE
27 #define FIO_HAVE_FALLOCATE
28 #define FIO_HAVE_POSIXAIO_FSYNC
29 #define FIO_HAVE_FDATASYNC
31 #define OS_MAP_ANON MAP_ANONYMOUS
32 #define OS_MSG_DONTWAIT 0
34 #define POSIX_MADV_DONTNEED MADV_DONTNEED
35 #define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
36 #define POSIX_MADV_RANDOM MADV_RANDOM
37 #define posix_madvise(ptr, sz, hint) madvise((ptr), (sz), (hint))
39 #ifndef CLOCK_MONOTONIC
40 #define CLOCK_MONOTONIC CLOCK_REALTIME
44 #define MSG_WAITALL 0x40
48 #define FIO_LITTLE_ENDIAN
50 #define FIO_BIG_ENDIAN
53 #define FIO_USE_GENERIC_SWAP
55 #define FIO_OS_HAVE_AIOCB_TYPEDEF
56 typedef struct aiocb64 os_aiocb_t;
58 static inline int blockdev_invalidate_cache(struct fio_file *f)
63 static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
65 disk_describe_type_ext_t dext;
67 if (!ioctl(f->fd, DIOC_DESCRIBE_EXT, &dext)) {
68 unsigned long long lba;
70 lba = ((uint64_t) dext.maxsva_high << 32) | dext.maxsva_low;
71 *bytes = lba * dext.lgblksz;
79 static inline int chardev_size(struct fio_file *f, unsigned long long *bytes)
81 return blockdev_size(f, bytes);
84 static inline unsigned long long os_phys_mem(void)
86 unsigned long long ret;
87 struct pst_static pst;
91 if (pstat(PSTAT_STATIC, pu, sizeof(pst), 0, 0) == -1)
94 ret = pst.physical_memory;
99 #define FIO_HAVE_CPU_ONLINE_SYSCONF
101 static inline unsigned int cpus_online(void)
103 return mpctl(MPC_GETNUMSPUS, 0, NULL);