X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=os%2Fos.h;h=a6bc17f09b5797632697de1b4c434f8f1a68482f;hp=1e924d3360b423201cab1cfce1288864d8559c5e;hb=c2acfbac7e9eb8ac5407ac024c0fd000614c77e2;hpb=135be493d843d4cae2966a35cbd22a3058ec8e4b diff --git a/os/os.h b/os/os.h index 1e924d33..a6bc17f0 100644 --- a/os/os.h +++ b/os/os.h @@ -17,6 +17,7 @@ enum { os_hpux, os_mac, os_netbsd, + os_openbsd, os_solaris, os_windows, os_android, @@ -30,6 +31,8 @@ enum { #include "os-linux.h" #elif defined(__FreeBSD__) #include "os-freebsd.h" +#elif defined(__OpenBSD__) +#include "os-openbsd.h" #elif defined(__NetBSD__) #include "os-netbsd.h" #elif defined(__sun__) @@ -77,7 +80,10 @@ typedef struct aiocb os_aiocb_t; #define fio_getaffinity(pid, mask) do { } while (0) #define fio_cpu_clear(mask, cpu) do { } while (0) #define fio_cpuset_exit(mask) (-1) +#define fio_cpus_split(mask, cpu) (0) typedef unsigned long os_cpu_mask_t; +#else +extern int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu); #endif #ifndef FIO_HAVE_IOPRIO @@ -90,6 +96,12 @@ typedef unsigned long os_cpu_mask_t; #define OS_O_DIRECT O_DIRECT #endif +#ifdef OS_O_ATOMIC +#define FIO_O_ATOMIC OS_O_ATOMIC +#else +#define FIO_O_ATOMIC 0 +#endif + #ifndef FIO_HAVE_HUGETLB #define SHM_HUGETLB 0 #define MAP_HUGETLB 0 @@ -127,7 +139,11 @@ typedef unsigned long os_cpu_mask_t; #endif #ifndef FIO_PREFERRED_CLOCK_SOURCE +#ifdef CONFIG_CLOCK_GETTIME #define FIO_PREFERRED_CLOCK_SOURCE CS_CGETTIME +#else +#define FIO_PREFERRED_CLOCK_SOURCE CS_GTOD +#endif #endif #ifndef FIO_MAX_JOBS @@ -210,12 +226,13 @@ static inline uint64_t fio_swap64(uint64_t val) }) #ifndef FIO_HAVE_BLKTRACE -static inline int is_blktrace(const char *fname) +static inline int is_blktrace(const char *fname, int *need_swap) { return 0; } struct thread_data; -static inline int load_blktrace(struct thread_data *td, const char *fname) +static inline int load_blktrace(struct thread_data *td, const char *fname, + int need_swap) { return 1; }