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_ODIRECT
23 #define FIO_USE_GENERIC_RAND
24 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
25 #define FIO_HAVE_PSHARED_MUTEX
26 #define FIO_HAVE_CHARDEV_SIZE
28 #define OS_MAP_ANON MAP_ANONYMOUS
29 #define OS_MSG_DONTWAIT 0
31 #define POSIX_MADV_DONTNEED MADV_DONTNEED
32 #define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
33 #define POSIX_MADV_RANDOM MADV_RANDOM
34 #define posix_madvise(ptr, sz, hint) madvise((ptr), (sz), (hint))
37 #define MSG_WAITALL 0x40
40 #define FIO_USE_GENERIC_SWAP
42 #define FIO_OS_HAVE_AIOCB_TYPEDEF
43 typedef struct aiocb64 os_aiocb_t;
45 static inline int blockdev_invalidate_cache(struct fio_file *f)
50 static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
52 disk_describe_type_ext_t dext;
54 if (!ioctl(f->fd, DIOC_DESCRIBE_EXT, &dext)) {
55 unsigned long long lba;
57 lba = ((uint64_t) dext.maxsva_high << 32) | dext.maxsva_low;
58 *bytes = lba * dext.lgblksz;
66 static inline int chardev_size(struct fio_file *f, unsigned long long *bytes)
68 return blockdev_size(f, bytes);
71 static inline unsigned long long os_phys_mem(void)
73 unsigned long long ret;
74 struct pst_static pst;
78 if (pstat(PSTAT_STATIC, pu, sizeof(pst), 0, 0) == -1)
81 ret = pst.physical_memory;
86 #define FIO_HAVE_CPU_ONLINE_SYSCONF
88 static inline unsigned int cpus_online(void)
90 return mpctl(MPC_GETNUMSPUS, 0, NULL);