Update all Windows files except dobuild.cmd to use LF line endings
[fio.git] / os / os-hpux.h
index c65fea69db22e1555a88be51a0f1ea0c8f04afc4..82acd1105fc51aa22f3976643a18999b245ebb3e 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef FIO_OS_HPUX_H
 #define FIO_OS_HPUX_H
 
+#define        FIO_OS  os_hpux
+
 #include <errno.h>
 #include <unistd.h>
 #include <sys/ioctl.h>
 #include <sys/fadvise.h>
 #include <sys/mman.h>
 #include <sys/mpctl.h>
-#include <sys/scsi.h>
+#include <sys/diskio.h>
 #include <sys/param.h>
 #include <sys/pstat.h>
 #include <time.h>
 #include <aio.h>
+#include <arm.h>
 
 #include "../file.h"
 
-#define FIO_HAVE_POSIXAIO
 #define FIO_HAVE_ODIRECT
 #define FIO_USE_GENERIC_RAND
-#define FIO_HAVE_CLOCK_MONOTONIC
+#define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_PSHARED_MUTEX
-#define FIO_HAVE_FADVISE
+#define FIO_HAVE_CHARDEV_SIZE
 
 #define OS_MAP_ANON            MAP_ANONYMOUS
 #define OS_MSG_DONTWAIT                0
 #define POSIX_MADV_RANDOM      MADV_RANDOM
 #define posix_madvise(ptr, sz, hint)   madvise((ptr), (sz), (hint))
 
-#ifndef CLOCK_MONOTONIC
-#define CLOCK_MONOTONIC                CLOCK_REALTIME
-#endif
-
 #ifndef MSG_WAITALL
 #define MSG_WAITALL    0x40
 #endif
 
+#define FIO_USE_GENERIC_SWAP
+
+#define FIO_OS_HAVE_AIOCB_TYPEDEF
+typedef struct aiocb64 os_aiocb_t;
+
 static inline int blockdev_invalidate_cache(struct fio_file *f)
 {
        return EINVAL;
@@ -46,10 +49,13 @@ static inline int blockdev_invalidate_cache(struct fio_file *f)
 
 static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
 {
-       struct capacity cap;
+       disk_describe_type_ext_t dext;
 
-       if (!ioctl(f->fd, SIOC_CAPACITY, &cap) == -1) {
-               *bytes = cap.lba * cap.blksz;
+       if (!ioctl(f->fd, DIOC_DESCRIBE_EXT, &dext)) {
+               unsigned long long lba;
+
+               lba = ((uint64_t) dext.maxsva_high << 32) | dext.maxsva_low;
+               *bytes = lba * dext.lgblksz;
                return 0;
        }
 
@@ -57,6 +63,11 @@ static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
        return errno;
 }
 
+static inline int chardev_size(struct fio_file *f, unsigned long long *bytes)
+{
+       return blockdev_size(f, bytes);
+}
+
 static inline unsigned long long os_phys_mem(void)
 {
        unsigned long long ret;