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>
19 #define FIO_HAVE_POSIXAIO
20 #define FIO_HAVE_ODIRECT
21 #define FIO_USE_GENERIC_RAND
22 #define FIO_HAVE_CLOCK_MONOTONIC
23 #define FIO_HAVE_PSHARED_MUTEX
24 #define FIO_HAVE_FADVISE
25 #define FIO_HAVE_CHARDEV_SIZE
26 #define FIO_HAVE_FALLOCATE
27 #define FIO_HAVE_POSIXAIO_FSYNC
28 #define FIO_HAVE_FDATASYNC
30 #define OS_MAP_ANON MAP_ANONYMOUS
31 #define OS_MSG_DONTWAIT 0
33 #define POSIX_MADV_DONTNEED MADV_DONTNEED
34 #define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
35 #define POSIX_MADV_RANDOM MADV_RANDOM
36 #define posix_madvise(ptr, sz, hint) madvise((ptr), (sz), (hint))
38 #ifndef CLOCK_MONOTONIC
39 #define CLOCK_MONOTONIC CLOCK_REALTIME
43 #define MSG_WAITALL 0x40
46 #define FIO_OS_HAVE_AIOCB_TYPEDEF
47 typedef struct aiocb64 os_aiocb_t;
49 static inline int blockdev_invalidate_cache(struct fio_file *f)
54 static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
56 disk_describe_type_ext_t dext;
58 if (!ioctl(f->fd, DIOC_DESCRIBE_EXT, &dext)) {
59 unsigned long long lba;
61 lba = ((uint64_t) dext.maxsva_high << 32) | dext.maxsva_low;
62 *bytes = lba * dext.lgblksz;
70 static inline int chardev_size(struct fio_file *f, unsigned long long *bytes)
72 return blockdev_size(f, bytes);
75 static inline unsigned long long os_phys_mem(void)
77 unsigned long long ret;
78 struct pst_static pst;
82 if (pstat(PSTAT_STATIC, pu, sizeof(pst), 0, 0) == -1)
85 ret = pst.physical_memory;
90 #define FIO_HAVE_CPU_ONLINE_SYSCONF
92 static inline unsigned int cpus_online(void)
94 return mpctl(MPC_GETNUMSPUS, 0, NULL);