blob: 3d677650934e8a762d6651f32cfa5ee096b47b69 [file] [log] [blame]
Cigy Cyriacbf2e8212010-08-10 19:51:11 -04001#ifndef FIO_OS_AIX_H
2#define FIO_OS_AIX_H
3
Jens Axboecca84642011-10-07 12:47:57 +02004#define FIO_OS os_aix
5
Cigy Cyriacbf2e8212010-08-10 19:51:11 -04006#include <errno.h>
7#include <unistd.h>
8#include <sys/devinfo.h>
9#include <sys/ioctl.h>
10
Jens Axboee2e58882011-01-04 08:36:06 +010011#include "../file.h"
12
Cigy Cyriacbf2e8212010-08-10 19:51:11 -040013#define FIO_HAVE_ODIRECT
14#define FIO_USE_GENERIC_RAND
Bruce Cran93bcfd22012-02-20 20:18:19 +010015#define FIO_USE_GENERIC_INIT_RANDOM_STATE
Jens Axboe282cc162010-08-11 16:14:56 -040016
Cigy Cyriacbf2e8212010-08-10 19:51:11 -040017#define FIO_HAVE_PSHARED_MUTEX
18
19#define OS_MAP_ANON MAP_ANON
Jens Axboe8e239ca2010-08-11 10:29:12 -040020#define OS_MSG_DONTWAIT 0
Cigy Cyriacbf2e8212010-08-10 19:51:11 -040021
Jens Axboea9df7072011-10-04 23:54:28 +020022#define FIO_USE_GENERIC_SWAP
23
Bruce Cran9b836562011-01-08 19:49:54 +010024static inline int blockdev_invalidate_cache(struct fio_file *f)
Cigy Cyriacbf2e8212010-08-10 19:51:11 -040025{
26 return EINVAL;
27}
28
Bruce Cranecc314b2011-01-04 10:59:30 +010029static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
Cigy Cyriacbf2e8212010-08-10 19:51:11 -040030{
31 struct devinfo info;
32
Bruce Cranecc314b2011-01-04 10:59:30 +010033 if (!ioctl(f->fd, IOCINFO, &info)) {
Cigy Cyriacbf2e8212010-08-10 19:51:11 -040034 *bytes = (unsigned long long)info.un.scdk.numblks *
35 info.un.scdk.blksize;
36 return 0;
37 }
38
39 return errno;
40}
41
42static inline unsigned long long os_phys_mem(void)
43{
44 long mem = sysconf(_SC_AIX_REALMEM);
45
46 if (mem == -1)
47 return 0;
48
49 return (unsigned long long) mem * 1024;
50}
51
52#endif