10 #include <sys/fadvise.h>
12 #include <sys/mpctl.h>
13 #include <sys/diskio.h>
14 #include <sys/param.h>
15 #include <sys/pstat.h>
22 #define FIO_HAVE_POSIXAIO
23 #define FIO_HAVE_ODIRECT
24 #define FIO_USE_GENERIC_RAND
25 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
26 #define FIO_HAVE_CLOCK_MONOTONIC
27 #define FIO_HAVE_PSHARED_MUTEX
28 #define FIO_HAVE_FADVISE
29 #define FIO_HAVE_CHARDEV_SIZE
30 #define FIO_HAVE_FALLOCATE
31 #define FIO_HAVE_POSIXAIO_FSYNC
32 #define FIO_HAVE_FDATASYNC
34 #define OS_MAP_ANON MAP_ANONYMOUS
35 #define OS_MSG_DONTWAIT 0
37 #define POSIX_MADV_DONTNEED MADV_DONTNEED
38 #define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
39 #define POSIX_MADV_RANDOM MADV_RANDOM
40 #define posix_madvise(ptr, sz, hint) madvise((ptr), (sz), (hint))
42 #ifndef CLOCK_MONOTONIC
43 #define CLOCK_MONOTONIC CLOCK_REALTIME
47 #define MSG_WAITALL 0x40
51 #define FIO_LITTLE_ENDIAN
53 #define FIO_BIG_ENDIAN
56 #define FIO_USE_GENERIC_SWAP
58 #define FIO_OS_HAVE_AIOCB_TYPEDEF
59 typedef struct aiocb64 os_aiocb_t;
61 #define FIO_OS_HAVE_SOCKLEN_T
62 typedef int fio_socklen_t;
64 static inline int blockdev_invalidate_cache(struct fio_file *f)
69 static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
71 disk_describe_type_ext_t dext;
73 if (!ioctl(f->fd, DIOC_DESCRIBE_EXT, &dext)) {
74 unsigned long long lba;
76 lba = ((uint64_t) dext.maxsva_high << 32) | dext.maxsva_low;
77 *bytes = lba * dext.lgblksz;
85 static inline int chardev_size(struct fio_file *f, unsigned long long *bytes)
87 return blockdev_size(f, bytes);
90 static inline unsigned long long os_phys_mem(void)
92 unsigned long long ret;
93 struct pst_static pst;
97 if (pstat(PSTAT_STATIC, pu, sizeof(pst), 0, 0) == -1)
100 ret = pst.physical_memory;
101 ret *= pst.page_size;
105 #define FIO_HAVE_CPU_ONLINE_SYSCONF
107 static inline unsigned int cpus_online(void)
109 return mpctl(MPC_GETNUMSPUS, 0, NULL);