Commit | Line | Data |
---|---|---|
c00a2289 JA |
1 | #ifndef FIO_OS_HPUX_H |
2 | #define FIO_OS_HPUX_H | |
3 | ||
4 | #include <errno.h> | |
5 | #include <unistd.h> | |
6 | #include <sys/ioctl.h> | |
7 | #include <sys/fcntl.h> | |
8 | #include <sys/fadvise.h> | |
9 | #include <sys/mman.h> | |
10 | #include <sys/mpctl.h> | |
564e49f3 | 11 | #include <sys/scsi.h> |
c00a2289 JA |
12 | |
13 | #include "../file.h" | |
14 | ||
15 | #define FIO_HAVE_POSIXAIO | |
16 | #define FIO_HAVE_ODIRECT | |
17 | #define FIO_USE_GENERIC_RAND | |
18 | #define FIO_HAVE_CLOCK_MONOTONIC | |
19 | #define FIO_HAVE_PSHARED_MUTEX | |
20 | #define FIO_HAVE_FADVISE | |
21 | ||
22 | #define OS_MAP_ANON MAP_ANONYMOUS | |
23 | #define OS_MSG_DONTWAIT 0 | |
24 | ||
25 | #define POSIX_MADV_DONTNEED MADV_DONTNEED | |
26 | #define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL | |
27 | #define POSIX_MADV_RANDOM MADV_RANDOM | |
28 | #define posix_madvise(ptr, sz, hint) madvise((ptr), (sz), (hint)) | |
29 | ||
30 | static inline int blockdev_invalidate_cache(struct fio_file *f) | |
31 | { | |
32 | return EINVAL; | |
33 | } | |
34 | ||
35 | static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) | |
36 | { | |
564e49f3 | 37 | struct capacity cap; |
c00a2289 | 38 | |
564e49f3 JA |
39 | if (!ioctl(f->fd, SIOC_CAPACITY, &cap) == -1) { |
40 | *bytes = cap.lba * cap.blksz; | |
c00a2289 JA |
41 | return 0; |
42 | } | |
43 | ||
564e49f3 | 44 | *bytes = 0; |
c00a2289 | 45 | return errno; |
c00a2289 JA |
46 | } |
47 | ||
48 | static inline unsigned long long os_phys_mem(void) | |
49 | { | |
50 | #if 0 | |
51 | long mem = sysconf(_SC_AIX_REALMEM); | |
52 | ||
53 | if (mem == -1) | |
54 | return 0; | |
55 | ||
56 | return (unsigned long long) mem * 1024; | |
57 | #else | |
58 | return 0; | |
59 | #endif | |
60 | } | |
61 | ||
62 | #define FIO_HAVE_CPU_ONLINE_SYSCONF | |
63 | ||
64 | static inline unsigned int cpus_online(void) | |
65 | { | |
66 | return mpctl(MPC_GETNUMSPUS, 0, NULL); | |
67 | } | |
68 | ||
69 | #endif |