X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=os%2Fos-hpux.h;h=9f3d76f50719736c998e76dbe4e30f1cfdd067e6;hb=a967e54d34afe3bb10cd521d78bcaea2dd8c7cdc;hp=38a1441db292627379ab2f301daea5979e92e27c;hpb=d48a9799a3d3cbe3c41658d6e41d6791b33e926c;p=fio.git diff --git a/os/os-hpux.h b/os/os-hpux.h index 38a1441d..9f3d76f5 100644 --- a/os/os-hpux.h +++ b/os/os-hpux.h @@ -1,25 +1,27 @@ #ifndef FIO_OS_HPUX_H #define FIO_OS_HPUX_H +#define FIO_OS os_hpux + #include #include #include -#include +#include #include #include #include -#include +#include +#include +#include #include #include +#include #include "../file.h" -#define FIO_HAVE_POSIXAIO #define FIO_HAVE_ODIRECT -#define FIO_USE_GENERIC_RAND -#define FIO_HAVE_CLOCK_MONOTONIC -#define FIO_HAVE_PSHARED_MUTEX -#define FIO_HAVE_FADVISE +#define FIO_USE_GENERIC_INIT_RANDOM_STATE +#define FIO_HAVE_CHARDEV_SIZE #define OS_MAP_ANON MAP_ANONYMOUS #define OS_MSG_DONTWAIT 0 @@ -29,25 +31,36 @@ #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 + +#ifdef CONFIG_PTHREAD_GETAFFINITY +#define FIO_HAVE_GET_THREAD_AFFINITY +#define fio_get_thread_affinity(mask) \ + pthread_getaffinity_np(pthread_self(), sizeof(mask), &(mask)) +#endif + +typedef struct aiocb64 os_aiocb_t; + static inline int blockdev_invalidate_cache(struct fio_file *f) { - return EINVAL; + return ENOTSUP; } 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, DIOC_DESCRIBE_EXT, &dext)) { + unsigned long long lba; - if (!ioctl(f->fd, SIOC_CAPACITY, &cap) == -1) { - *bytes = cap.lba * cap.blksz; + lba = ((uint64_t) dext.maxsva_high << 32) | dext.maxsva_low; + *bytes = lba * dext.lgblksz; return 0; } @@ -55,23 +68,29 @@ 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) { -#if 0 - long mem = sysconf(_SC_AIX_REALMEM); + unsigned long long ret; + struct pst_static pst; + union pstun pu; - if (mem == -1) + pu.pst_static = &pst; + if (pstat(PSTAT_STATIC, pu, sizeof(pst), 0, 0) == -1) return 0; - return (unsigned long long) mem * 1024; -#else - return 0; -#endif + ret = pst.physical_memory; + ret *= pst.page_size; + return ret; } -#define FIO_HAVE_CPU_ONLINE_SYSCONF +#define FIO_HAVE_CPU_CONF_SYSCONF -static inline unsigned int cpus_online(void) +static inline unsigned int cpus_configured(void) { return mpctl(MPC_GETNUMSPUS, 0, NULL); }