Changeset 5751a56


Ignore:
Timestamp:
Jul 23, 2020, 1:33:29 PM (17 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
54eb5ebd
Parents:
d9c2284
Message:

Changed handling of io_uring support to handle op codes in configure.
Kernel probing for op codes, not supported yet.

Location:
libcfa
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • libcfa/configure

    rd9c2284 r5751a56  
    677677AMDEP_FALSE
    678678AMDEP_TRUE
    679 am__quote
    680679am__include
    681680DEPDIR
     
    784783PACKAGE_NAME
    785784PATH_SEPARATOR
    786 SHELL'
     785SHELL
     786am__quote'
    787787ac_subst_files=''
    788788ac_user_opts='
     
    20542054
    20552055} # ac_fn_c_check_header_mongrel
     2056
     2057# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
     2058# ---------------------------------------------
     2059# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
     2060# accordingly.
     2061ac_fn_c_check_decl ()
     2062{
     2063  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
     2064  as_decl_name=`echo $2|sed 's/ *(.*//'`
     2065  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
     2066  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
     2067$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
     2068if eval \${$3+:} false; then :
     2069  $as_echo_n "(cached) " >&6
     2070else
     2071  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     2072/* end confdefs.h.  */
     2073$4
     2074int
     2075main ()
     2076{
     2077#ifndef $as_decl_name
     2078#ifdef __cplusplus
     2079  (void) $as_decl_use;
     2080#else
     2081  (void) $as_decl_name;
     2082#endif
     2083#endif
     2084
     2085  ;
     2086  return 0;
     2087}
     2088_ACEOF
     2089if ac_fn_c_try_compile "$LINENO"; then :
     2090  eval "$3=yes"
     2091else
     2092  eval "$3=no"
     2093fi
     2094rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     2095fi
     2096eval ac_res=\$$3
     2097               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
     2098$as_echo "$ac_res" >&6; }
     2099  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
     2100
     2101} # ac_fn_c_check_decl
    20562102cat >config.log <<_ACEOF
    20572103This file contains any messages produced by compilers while
     
    24862532
    24872533
    2488 am__api_version='1.15'
     2534am__api_version='1.16'
    24892535
    24902536# Find a good install program.  We prefer a C program (faster),
     
    29633009# For better backward compatibility.  To be removed once Automake 1.9.x
    29643010# dies out for good.  For more background, see:
    2965 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
    2966 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
     3011# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
     3012# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
    29673013mkdir_p='$(MKDIR_P)'
    29683014
     
    30153061
    30163062You can download and install GNU coreutils to get an 'rm' implementation
    3017 that behaves properly: <http://www.gnu.org/software/coreutils/>.
     3063that behaves properly: <https://www.gnu.org/software/coreutils/>.
    30183064
    30193065If you want to complete the configuration process using your problematic
     
    33993445ac_config_commands="$ac_config_commands depfiles"
    34003446
    3401 
    3402 am_make=${MAKE-make}
    3403 cat > confinc << 'END'
     3447{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
     3448$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
     3449cat > confinc.mk << 'END'
    34043450am__doit:
    3405         @echo this is the am__doit target
     3451        @echo this is the am__doit target >confinc.out
    34063452.PHONY: am__doit
    34073453END
    3408 # If we don't find an include directive, just comment out the code.
    3409 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
    3410 $as_echo_n "checking for style of include used by $am_make... " >&6; }
    34113454am__include="#"
    34123455am__quote=
    3413 _am_result=none
    3414 # First try GNU make style include.
    3415 echo "include confinc" > confmf
    3416 # Ignore all kinds of additional output from 'make'.
    3417 case `$am_make -s -f confmf 2> /dev/null` in #(
    3418 *the\ am__doit\ target*)
    3419   am__include=include
    3420   am__quote=
    3421   _am_result=GNU
    3422   ;;
     3456# BSD make does it like this.
     3457echo '.include "confinc.mk" # ignored' > confmf.BSD
     3458# Other make implementations (GNU, Solaris 10, AIX) do it like this.
     3459echo 'include confinc.mk # ignored' > confmf.GNU
     3460_am_result=no
     3461for s in GNU BSD; do
     3462  { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
     3463   (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
     3464   ac_status=$?
     3465   echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3466   (exit $ac_status); }
     3467  case $?:`cat confinc.out 2>/dev/null` in #(
     3468  '0:this is the am__doit target') :
     3469    case $s in #(
     3470  BSD) :
     3471    am__include='.include' am__quote='"' ;; #(
     3472  *) :
     3473    am__include='include' am__quote='' ;;
     3474esac ;; #(
     3475  *) :
     3476     ;;
    34233477esac
    3424 # Now try BSD make style include.
    3425 if test "$am__include" = "#"; then
    3426    echo '.include "confinc"' > confmf
    3427    case `$am_make -s -f confmf 2> /dev/null` in #(
    3428    *the\ am__doit\ target*)
    3429      am__include=.include
    3430      am__quote="\""
    3431      _am_result=BSD
    3432      ;;
    3433    esac
    3434 fi
    3435 
    3436 
    3437 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
    3438 $as_echo "$_am_result" >&6; }
    3439 rm -f confinc confmf
     3478  if test "$am__include" != "#"; then
     3479    _am_result="yes ($s style)"
     3480    break
     3481  fi
     3482done
     3483rm -f confinc.* confmf.*
     3484{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
     3485$as_echo "${_am_result}" >&6; }
    34403486
    34413487# Check whether --enable-dependency-tracking was given.
     
    59415987
    59425988: ${AR=ar}
    5943 : ${AR_FLAGS=cru}
     5989: ${AR_FLAGS=cr}
    59445990
    59455991
     
    64426488    # Now try to grab the symbols.
    64436489    nlist=conftest.nm
    6444     if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
    6445   (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
    6446   ac_status=$?
    6447   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    6448   test $ac_status = 0; } && test -s "$nlist"; then
     6490    $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5
     6491    if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then
    64496492      # Try sorting and uniquifying the output.
    64506493      if sort "$nlist" | uniq > "$nlist"T; then
     
    76657708      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
    76667709      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
    7667       echo "$AR cru libconftest.a conftest.o" >&5
    7668       $AR cru libconftest.a conftest.o 2>&5
     7710      echo "$AR cr libconftest.a conftest.o" >&5
     7711      $AR cr libconftest.a conftest.o 2>&5
    76697712      echo "$RANLIB libconftest.a" >&5
    76707713      $RANLIB libconftest.a 2>&5
     
    87928835        lt_prog_compiler_wl='-Wl,'
    87938836        lt_prog_compiler_pic='-KPIC'
     8837        lt_prog_compiler_static='-static'
     8838        ;;
     8839      # flang / f18. f95 an alias for gfortran or flang on Debian
     8840      flang* | f18* | f95*)
     8841        lt_prog_compiler_wl='-Wl,'
     8842        lt_prog_compiler_pic='-fPIC'
    87948843        lt_prog_compiler_static='-static'
    87958844        ;;
     
    1315413203      # what "hidden" libraries, object files and flags are used when
    1315513204      # linking a shared library.
    13156       output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
     13205      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
    1315713206
    1315813207    else
     
    1364613695            # from the output so that they don't get included in the library
    1364713696            # dependencies.
    13648             output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
     13697            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
    1364913698            ;;
    1365013699          *)
     
    1371113760            # from the output so that they don't get included in the library
    1371213761            # dependencies.
    13713             output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
     13762            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
    1371413763            ;;
    1371513764          *)
     
    1405014099              # what "hidden" libraries, object files and flags are used when
    1405114100              # linking a shared library.
    14052               output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
     14101              output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
    1405314102
    1405414103            else
     
    1413414183                # what "hidden" libraries, object files and flags are used when
    1413514184                # linking a shared library.
    14136                 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
     14185                output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
    1413714186              else
    1413814187                # g++ 2.7 appears to require '-G' NOT '-shared' on this
     
    1414514194                # what "hidden" libraries, object files and flags are used when
    1414614195                # linking a shared library.
    14147                 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
     14196                output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
    1414814197              fi
    1414914198
     
    1696217011
    1696317012
     17013
     17014
     17015#io_uring 5.4 and earlier uses defines
     17016#io_uring 5.5 uses enum values
     17017#io_uring 5.6 and later uses probes
     17018
    1696417019for ac_header in linux/io_uring.h
    1696517020do :
     
    1696917024#define HAVE_LINUX_IO_URING_H 1
    1697017025_ACEOF
     17026
     17027        $as_echo "#define CFA_HAVE_LINUX_IO_URING_H 1" >>confdefs.h
     17028
     17029        # AC_CHECK_HEADER([liburing.h], [
     17030        #       AC_CHECK_LIB([uring], [io_uring_get_probe])
     17031        # ])
     17032
     17033                ac_fn_c_check_decl "$LINENO" "IORING_OP_NOP" "ac_cv_have_decl_IORING_OP_NOP" "#include <linux/io_uring.h>
     17034"
     17035if test "x$ac_cv_have_decl_IORING_OP_NOP" = xyes; then :
     17036  $as_echo "#define CFA_HAVE_IORING_OP_NOP 1" >>confdefs.h
     17037
     17038fi
     17039
     17040
     17041                ac_fn_c_check_decl "$LINENO" "IORING_OP_READV" "ac_cv_have_decl_IORING_OP_READV" "#include <linux/io_uring.h>
     17042"
     17043if test "x$ac_cv_have_decl_IORING_OP_READV" = xyes; then :
     17044  $as_echo "#define CFA_HAVE_IORING_OP_READV 1" >>confdefs.h
     17045
     17046fi
     17047
     17048
     17049                ac_fn_c_check_decl "$LINENO" "IORING_OP_WRITEV" "ac_cv_have_decl_IORING_OP_WRITEV" "#include <linux/io_uring.h>
     17050"
     17051if test "x$ac_cv_have_decl_IORING_OP_WRITEV" = xyes; then :
     17052  $as_echo "#define CFA_HAVE_IORING_OP_WRITEV 1" >>confdefs.h
     17053
     17054fi
     17055
     17056
     17057                ac_fn_c_check_decl "$LINENO" "IORING_OP_FSYNC" "ac_cv_have_decl_IORING_OP_FSYNC" "#include <linux/io_uring.h>
     17058"
     17059if test "x$ac_cv_have_decl_IORING_OP_FSYNC" = xyes; then :
     17060  $as_echo "#define CFA_HAVE_IORING_OP_FSYNC 1" >>confdefs.h
     17061
     17062fi
     17063
     17064
     17065                ac_fn_c_check_decl "$LINENO" "IORING_OP_READ_FIXED" "ac_cv_have_decl_IORING_OP_READ_FIXED" "#include <linux/io_uring.h>
     17066"
     17067if test "x$ac_cv_have_decl_IORING_OP_READ_FIXED" = xyes; then :
     17068  $as_echo "#define CFA_HAVE_IORING_OP_READ_FIXED 1" >>confdefs.h
     17069
     17070fi
     17071
     17072
     17073                ac_fn_c_check_decl "$LINENO" "IORING_OP_WRITE_FIXED" "ac_cv_have_decl_IORING_OP_WRITE_FIXED" "#include <linux/io_uring.h>
     17074"
     17075if test "x$ac_cv_have_decl_IORING_OP_WRITE_FIXED" = xyes; then :
     17076  $as_echo "#define CFA_HAVE_IORING_OP_WRITE_FIXED 1" >>confdefs.h
     17077
     17078fi
     17079
     17080
     17081                ac_fn_c_check_decl "$LINENO" "IORING_OP_POLL_ADD" "ac_cv_have_decl_IORING_OP_POLL_ADD" "#include <linux/io_uring.h>
     17082"
     17083if test "x$ac_cv_have_decl_IORING_OP_POLL_ADD" = xyes; then :
     17084  $as_echo "#define CFA_HAVE_IORING_OP_POLL_ADD 1" >>confdefs.h
     17085
     17086fi
     17087
     17088
     17089                ac_fn_c_check_decl "$LINENO" "IORING_OP_POLL_REMOVE" "ac_cv_have_decl_IORING_OP_POLL_REMOVE" "#include <linux/io_uring.h>
     17090"
     17091if test "x$ac_cv_have_decl_IORING_OP_POLL_REMOVE" = xyes; then :
     17092  $as_echo "#define CFA_HAVE_IORING_OP_POLL_REMOVE 1" >>confdefs.h
     17093
     17094fi
     17095
     17096
     17097                ac_fn_c_check_decl "$LINENO" "IORING_OP_SYNC_FILE_RANGE" "ac_cv_have_decl_IORING_OP_SYNC_FILE_RANGE" "#include <linux/io_uring.h>
     17098"
     17099if test "x$ac_cv_have_decl_IORING_OP_SYNC_FILE_RANGE" = xyes; then :
     17100  $as_echo "#define CFA_HAVE_IORING_OP_SYNC_FILE_RANGE 1" >>confdefs.h
     17101
     17102fi
     17103
     17104
     17105                ac_fn_c_check_decl "$LINENO" "IORING_OP_SENDMSG" "ac_cv_have_decl_IORING_OP_SENDMSG" "#include <linux/io_uring.h>
     17106"
     17107if test "x$ac_cv_have_decl_IORING_OP_SENDMSG" = xyes; then :
     17108  $as_echo "#define CFA_HAVE_IORING_OP_SENDMSG 1" >>confdefs.h
     17109
     17110fi
     17111
     17112
     17113                ac_fn_c_check_decl "$LINENO" "IORING_OP_RECVMSG" "ac_cv_have_decl_IORING_OP_RECVMSG" "#include <linux/io_uring.h>
     17114"
     17115if test "x$ac_cv_have_decl_IORING_OP_RECVMSG" = xyes; then :
     17116  $as_echo "#define CFA_HAVE_IORING_OP_RECVMSG 1" >>confdefs.h
     17117
     17118fi
     17119
     17120
     17121                ac_fn_c_check_decl "$LINENO" "IORING_OP_TIMEOUT" "ac_cv_have_decl_IORING_OP_TIMEOUT" "#include <linux/io_uring.h>
     17122"
     17123if test "x$ac_cv_have_decl_IORING_OP_TIMEOUT" = xyes; then :
     17124  $as_echo "#define CFA_HAVE_IORING_OP_TIMEOUT 1" >>confdefs.h
     17125
     17126fi
     17127
     17128
     17129                ac_fn_c_check_decl "$LINENO" "IORING_OP_TIMEOUT_REMOVE" "ac_cv_have_decl_IORING_OP_TIMEOUT_REMOVE" "#include <linux/io_uring.h>
     17130"
     17131if test "x$ac_cv_have_decl_IORING_OP_TIMEOUT_REMOVE" = xyes; then :
     17132  $as_echo "#define CFA_HAVE_IORING_OP_TIMEOUT_REMOVE 1" >>confdefs.h
     17133
     17134fi
     17135
     17136
     17137                ac_fn_c_check_decl "$LINENO" "IORING_OP_ACCEPT" "ac_cv_have_decl_IORING_OP_ACCEPT" "#include <linux/io_uring.h>
     17138"
     17139if test "x$ac_cv_have_decl_IORING_OP_ACCEPT" = xyes; then :
     17140  $as_echo "#define CFA_HAVE_IORING_OP_ACCEPT 1" >>confdefs.h
     17141
     17142fi
     17143
     17144
     17145                ac_fn_c_check_decl "$LINENO" "IORING_OP_ASYNC_CANCEL" "ac_cv_have_decl_IORING_OP_ASYNC_CANCEL" "#include <linux/io_uring.h>
     17146"
     17147if test "x$ac_cv_have_decl_IORING_OP_ASYNC_CANCEL" = xyes; then :
     17148  $as_echo "#define CFA_HAVE_IORING_OP_ASYNC_CANCEL 1" >>confdefs.h
     17149
     17150fi
     17151
     17152
     17153                ac_fn_c_check_decl "$LINENO" "IORING_OP_LINK_TIMEOUT" "ac_cv_have_decl_IORING_OP_LINK_TIMEOUT" "#include <linux/io_uring.h>
     17154"
     17155if test "x$ac_cv_have_decl_IORING_OP_LINK_TIMEOUT" = xyes; then :
     17156  $as_echo "#define CFA_HAVE_IORING_OP_LINK_TIMEOUT 1" >>confdefs.h
     17157
     17158fi
     17159
     17160
     17161                ac_fn_c_check_decl "$LINENO" "IORING_OP_CONNECT" "ac_cv_have_decl_IORING_OP_CONNECT" "#include <linux/io_uring.h>
     17162"
     17163if test "x$ac_cv_have_decl_IORING_OP_CONNECT" = xyes; then :
     17164  $as_echo "#define CFA_HAVE_IORING_OP_CONNECT 1" >>confdefs.h
     17165
     17166fi
     17167
     17168
     17169                ac_fn_c_check_decl "$LINENO" "IORING_OP_FALLOCATE" "ac_cv_have_decl_IORING_OP_FALLOCATE" "#include <linux/io_uring.h>
     17170"
     17171if test "x$ac_cv_have_decl_IORING_OP_FALLOCATE" = xyes; then :
     17172  $as_echo "#define CFA_HAVE_IORING_OP_FALLOCATE 1" >>confdefs.h
     17173
     17174fi
     17175
     17176
     17177                ac_fn_c_check_decl "$LINENO" "IORING_OP_OPENAT" "ac_cv_have_decl_IORING_OP_OPENAT" "#include <linux/io_uring.h>
     17178"
     17179if test "x$ac_cv_have_decl_IORING_OP_OPENAT" = xyes; then :
     17180  $as_echo "#define CFA_HAVE_IORING_OP_OPENAT 1" >>confdefs.h
     17181
     17182fi
     17183
     17184
     17185                ac_fn_c_check_decl "$LINENO" "IORING_OP_CLOSE" "ac_cv_have_decl_IORING_OP_CLOSE" "#include <linux/io_uring.h>
     17186"
     17187if test "x$ac_cv_have_decl_IORING_OP_CLOSE" = xyes; then :
     17188  $as_echo "#define CFA_HAVE_IORING_OP_CLOSE 1" >>confdefs.h
     17189
     17190fi
     17191
     17192
     17193                ac_fn_c_check_decl "$LINENO" "IORING_OP_FILES_UPDATE" "ac_cv_have_decl_IORING_OP_FILES_UPDATE" "#include <linux/io_uring.h>
     17194"
     17195if test "x$ac_cv_have_decl_IORING_OP_FILES_UPDATE" = xyes; then :
     17196  $as_echo "#define CFA_HAVE_IORING_OP_FILES_UPDATE 1" >>confdefs.h
     17197
     17198fi
     17199
     17200
     17201                ac_fn_c_check_decl "$LINENO" "IORING_OP_STATX" "ac_cv_have_decl_IORING_OP_STATX" "#include <linux/io_uring.h>
     17202"
     17203if test "x$ac_cv_have_decl_IORING_OP_STATX" = xyes; then :
     17204  $as_echo "#define CFA_HAVE_IORING_OP_STATX 1" >>confdefs.h
     17205
     17206fi
     17207
     17208
     17209                ac_fn_c_check_decl "$LINENO" "IORING_OP_READ" "ac_cv_have_decl_IORING_OP_READ" "#include <linux/io_uring.h>
     17210"
     17211if test "x$ac_cv_have_decl_IORING_OP_READ" = xyes; then :
     17212  $as_echo "#define CFA_HAVE_IORING_OP_READ 1" >>confdefs.h
     17213
     17214fi
     17215
     17216
     17217                ac_fn_c_check_decl "$LINENO" "IORING_OP_WRITE" "ac_cv_have_decl_IORING_OP_WRITE" "#include <linux/io_uring.h>
     17218"
     17219if test "x$ac_cv_have_decl_IORING_OP_WRITE" = xyes; then :
     17220  $as_echo "#define CFA_HAVE_IORING_OP_WRITE 1" >>confdefs.h
     17221
     17222fi
     17223
     17224
     17225                ac_fn_c_check_decl "$LINENO" "IORING_OP_FADVISE" "ac_cv_have_decl_IORING_OP_FADVISE" "#include <linux/io_uring.h>
     17226"
     17227if test "x$ac_cv_have_decl_IORING_OP_FADVISE" = xyes; then :
     17228  $as_echo "#define CFA_HAVE_IORING_OP_FADVISE 1" >>confdefs.h
     17229
     17230fi
     17231
     17232
     17233                ac_fn_c_check_decl "$LINENO" "IORING_OP_MADVISE" "ac_cv_have_decl_IORING_OP_MADVISE" "#include <linux/io_uring.h>
     17234"
     17235if test "x$ac_cv_have_decl_IORING_OP_MADVISE" = xyes; then :
     17236  $as_echo "#define CFA_HAVE_IORING_OP_MADVISE 1" >>confdefs.h
     17237
     17238fi
     17239
     17240
     17241                ac_fn_c_check_decl "$LINENO" "IORING_OP_SEND" "ac_cv_have_decl_IORING_OP_SEND" "#include <linux/io_uring.h>
     17242"
     17243if test "x$ac_cv_have_decl_IORING_OP_SEND" = xyes; then :
     17244  $as_echo "#define CFA_HAVE_IORING_OP_SEND 1" >>confdefs.h
     17245
     17246fi
     17247
     17248
     17249                ac_fn_c_check_decl "$LINENO" "IORING_OP_RECV" "ac_cv_have_decl_IORING_OP_RECV" "#include <linux/io_uring.h>
     17250"
     17251if test "x$ac_cv_have_decl_IORING_OP_RECV" = xyes; then :
     17252  $as_echo "#define CFA_HAVE_IORING_OP_RECV 1" >>confdefs.h
     17253
     17254fi
     17255
     17256
     17257                ac_fn_c_check_decl "$LINENO" "IORING_OP_OPENAT2" "ac_cv_have_decl_IORING_OP_OPENAT2" "#include <linux/io_uring.h>
     17258"
     17259if test "x$ac_cv_have_decl_IORING_OP_OPENAT2" = xyes; then :
     17260  $as_echo "#define CFA_HAVE_IORING_OP_OPENAT2 1" >>confdefs.h
     17261
     17262fi
     17263
     17264
     17265                ac_fn_c_check_decl "$LINENO" "IORING_OP_EPOLL_CTL" "ac_cv_have_decl_IORING_OP_EPOLL_CTL" "#include <linux/io_uring.h>
     17266"
     17267if test "x$ac_cv_have_decl_IORING_OP_EPOLL_CTL" = xyes; then :
     17268  $as_echo "#define CFA_HAVE_IORING_OP_EPOLL_CTL 1" >>confdefs.h
     17269
     17270fi
     17271
     17272
     17273                ac_fn_c_check_decl "$LINENO" "IORING_OP_SPLICE" "ac_cv_have_decl_IORING_OP_SPLICE" "#include <linux/io_uring.h>
     17274"
     17275if test "x$ac_cv_have_decl_IORING_OP_SPLICE" = xyes; then :
     17276  $as_echo "#define CFA_HAVE_IORING_OP_SPLICE 1" >>confdefs.h
     17277
     17278fi
     17279
     17280
     17281                ac_fn_c_check_decl "$LINENO" "IORING_OP_PROVIDE_BUFFERS" "ac_cv_have_decl_IORING_OP_PROVIDE_BUFFERS" "#include <linux/io_uring.h>
     17282"
     17283if test "x$ac_cv_have_decl_IORING_OP_PROVIDE_BUFFERS" = xyes; then :
     17284  $as_echo "#define CFA_HAVE_IORING_OP_PROVIDE_BUFFERS 1" >>confdefs.h
     17285
     17286fi
     17287
     17288
     17289                ac_fn_c_check_decl "$LINENO" "IORING_OP_REMOVE_BUFFER" "ac_cv_have_decl_IORING_OP_REMOVE_BUFFER" "#include <linux/io_uring.h>
     17290"
     17291if test "x$ac_cv_have_decl_IORING_OP_REMOVE_BUFFER" = xyes; then :
     17292  $as_echo "#define CFA_HAVE_IORING_OP_REMOVE_BUFFER 1" >>confdefs.h
     17293
     17294fi
     17295
     17296
    1697117297
    1697217298fi
     
    1772818054# INIT-COMMANDS
    1772918055#
    17730 AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
     18056AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
    1773118057
    1773218058
     
    1872419050  # are listed without --file.  Let's play safe and only enable the eval
    1872519051  # if we detect the quoting.
    18726   case $CONFIG_FILES in
    18727   *\'*) eval set x "$CONFIG_FILES" ;;
    18728   *)   set x $CONFIG_FILES ;;
    18729   esac
     19052  # TODO: see whether this extra hack can be removed once we start
     19053  # requiring Autoconf 2.70 or later.
     19054  case $CONFIG_FILES in #(
     19055  *\'*) :
     19056    eval set x "$CONFIG_FILES" ;; #(
     19057  *) :
     19058    set x $CONFIG_FILES ;; #(
     19059  *) :
     19060     ;;
     19061esac
    1873019062  shift
    18731   for mf
     19063  # Used to flag and report bootstrapping failures.
     19064  am_rc=0
     19065  for am_mf
    1873219066  do
    1873319067    # Strip MF so we end up with the name of the file.
    18734     mf=`echo "$mf" | sed -e 's/:.*$//'`
    18735     # Check whether this is an Automake generated Makefile or not.
    18736     # We used to match only the files named 'Makefile.in', but
    18737     # some people rename them; so instead we look at the file content.
    18738     # Grep'ing the first line is not enough: some people post-process
    18739     # each Makefile.in and add a new line on top of each file to say so.
    18740     # Grep'ing the whole file is not good either: AIX grep has a line
     19068    am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
     19069    # Check whether this is an Automake generated Makefile which includes
     19070    # dependency-tracking related rules and includes.
     19071    # Grep'ing the whole file directly is not great: AIX grep has a line
    1874119072    # limit of 2048, but all sed's we know have understand at least 4000.
    18742     if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
    18743       dirpart=`$as_dirname -- "$mf" ||
    18744 $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
    18745          X"$mf" : 'X\(//\)[^/]' \| \
    18746          X"$mf" : 'X\(//\)$' \| \
    18747          X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
    18748 $as_echo X"$mf" |
     19073    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
     19074      || continue
     19075    am_dirpart=`$as_dirname -- "$am_mf" ||
     19076$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
     19077         X"$am_mf" : 'X\(//\)[^/]' \| \
     19078         X"$am_mf" : 'X\(//\)$' \| \
     19079         X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
     19080$as_echo X"$am_mf" |
    1874919081    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
    1875019082            s//\1/
     
    1876419096          }
    1876519097          s/.*/./; q'`
    18766     else
    18767       continue
    18768     fi
    18769     # Extract the definition of DEPDIR, am__include, and am__quote
    18770     # from the Makefile without running 'make'.
    18771     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
    18772     test -z "$DEPDIR" && continue
    18773     am__include=`sed -n 's/^am__include = //p' < "$mf"`
    18774     test -z "$am__include" && continue
    18775     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
    18776     # Find all dependency output files, they are included files with
    18777     # $(DEPDIR) in their names.  We invoke sed twice because it is the
    18778     # simplest approach to changing $(DEPDIR) to its actual value in the
    18779     # expansion.
    18780     for file in `sed -n "
    18781       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
    18782          sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
    18783       # Make sure the directory exists.
    18784       test -f "$dirpart/$file" && continue
    18785       fdir=`$as_dirname -- "$file" ||
    18786 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
    18787          X"$file" : 'X\(//\)[^/]' \| \
    18788          X"$file" : 'X\(//\)$' \| \
    18789          X"$file" : 'X\(/\)' \| . 2>/dev/null ||
    18790 $as_echo X"$file" |
    18791     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
     19098    am_filepart=`$as_basename -- "$am_mf" ||
     19099$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
     19100         X"$am_mf" : 'X\(//\)$' \| \
     19101         X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
     19102$as_echo X/"$am_mf" |
     19103    sed '/^.*\/\([^/][^/]*\)\/*$/{
    1879219104            s//\1/
    1879319105            q
    1879419106          }
    18795           /^X\(\/\/\)[^/].*/{
     19107          /^X\/\(\/\/\)$/{
    1879619108            s//\1/
    1879719109            q
    1879819110          }
    18799           /^X\(\/\/\)$/{
    18800             s//\1/
    18801             q
    18802           }
    18803           /^X\(\/\).*/{
     19111          /^X\/\(\/\).*/{
    1880419112            s//\1/
    1880519113            q
    1880619114          }
    1880719115          s/.*/./; q'`
    18808       as_dir=$dirpart/$fdir; as_fn_mkdir_p
    18809       # echo "creating $dirpart/$file"
    18810       echo '# dummy' > "$dirpart/$file"
    18811     done
     19116    { echo "$as_me:$LINENO: cd "$am_dirpart" \
     19117      && sed -e '/# am--include-marker/d' "$am_filepart" \
     19118        | $MAKE -f - am--depfiles" >&5
     19119   (cd "$am_dirpart" \
     19120      && sed -e '/# am--include-marker/d' "$am_filepart" \
     19121        | $MAKE -f - am--depfiles) >&5 2>&5
     19122   ac_status=$?
     19123   echo "$as_me:$LINENO: \$? = $ac_status" >&5
     19124   (exit $ac_status); } || am_rc=$?
    1881219125  done
     19126  if test $am_rc -ne 0; then
     19127    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
     19128$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
     19129as_fn_error $? "Something went wrong bootstrapping makefile fragments
     19130    for automatic dependency tracking.  Try re-running configure with the
     19131    '--disable-dependency-tracking' option to at least be able to build
     19132    the package (albeit without support for automatic dependency tracking).
     19133See \`config.log' for more details" "$LINENO" 5; }
     19134  fi
     19135  { am_dirpart=; unset am_dirpart;}
     19136  { am_filepart=; unset am_filepart;}
     19137  { am_mf=; unset am_mf;}
     19138  { am_rc=; unset am_rc;}
     19139  rm -f conftest-deps.mk
    1881319140}
    1881419141 ;;
     
    1882819155#! $SHELL
    1882919156# Generated automatically by $as_me ($PACKAGE) $VERSION
    18830 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
    1883119157# NOTE: Changes made to this file will be lost: look at ltmain.sh.
    1883219158
  • libcfa/configure.ac

    rd9c2284 r5751a56  
    123123AC_PROG_MAKE_SET
    124124
    125 AC_CHECK_HEADERS([linux/io_uring.h])
     125
     126
     127#io_uring 5.4 and earlier uses defines
     128#io_uring 5.5 uses enum values
     129#io_uring 5.6 and later uses probes
     130
     131AC_CHECK_HEADERS([linux/io_uring.h], [
     132        AC_DEFINE(CFA_HAVE_LINUX_IO_URING_H)
     133        # AC_CHECK_HEADER([liburing.h], [
     134        #       AC_CHECK_LIB([uring], [io_uring_get_probe])
     135        # ])
     136        m4_foreach([op], [IORING_OP_NOP,IORING_OP_READV,IORING_OP_WRITEV,IORING_OP_FSYNC,IORING_OP_READ_FIXED,IORING_OP_WRITE_FIXED,IORING_OP_POLL_ADD,IORING_OP_POLL_REMOVE,IORING_OP_SYNC_FILE_RANGE,IORING_OP_SENDMSG,IORING_OP_RECVMSG,IORING_OP_TIMEOUT,IORING_OP_TIMEOUT_REMOVE,IORING_OP_ACCEPT,IORING_OP_ASYNC_CANCEL,IORING_OP_LINK_TIMEOUT,IORING_OP_CONNECT,IORING_OP_FALLOCATE,IORING_OP_OPENAT,IORING_OP_CLOSE,IORING_OP_FILES_UPDATE,IORING_OP_STATX,IORING_OP_READ,IORING_OP_WRITE,IORING_OP_FADVISE,IORING_OP_MADVISE,IORING_OP_SEND,IORING_OP_RECV,IORING_OP_OPENAT2,IORING_OP_EPOLL_CTL,IORING_OP_SPLICE,IORING_OP_PROVIDE_BUFFERS,IORING_OP_REMOVE_BUFFER], [
     137                AC_CHECK_DECL(op, [AC_DEFINE([CFA_HAVE_]op)], [], [[#include <linux/io_uring.h>]])
     138        ])
     139])
    126140AC_CHECK_FUNCS([preadv2 pwritev2])
    127141
  • libcfa/prelude/defines.hfa.in

    rd9c2284 r5751a56  
    1414//
    1515
    16 #undef HAVE_LINUX_IO_URING_H
     16#undef CFA_HAVE_LINUX_IO_URING_H
     17
     18#undef CFA_HAVE_IORING_OP_NOP
     19#undef CFA_HAVE_IORING_OP_READV
     20#undef CFA_HAVE_IORING_OP_WRITEV
     21#undef CFA_HAVE_IORING_OP_FSYNC
     22#undef CFA_HAVE_IORING_OP_READ_FIXED
     23#undef CFA_HAVE_IORING_OP_WRITE_FIXED
     24#undef CFA_HAVE_IORING_OP_POLL_ADD
     25#undef CFA_HAVE_IORING_OP_POLL_REMOVE
     26#undef CFA_HAVE_IORING_OP_SYNC_FILE_RANGE
     27#undef CFA_HAVE_IORING_OP_SENDMSG
     28#undef CFA_HAVE_IORING_OP_RECVMSG
     29#undef CFA_HAVE_IORING_OP_TIMEOUT
     30#undef CFA_HAVE_IORING_OP_TIMEOUT_REMOVE
     31#undef CFA_HAVE_IORING_OP_ACCEPT
     32#undef CFA_HAVE_IORING_OP_ASYNC_CANCEL
     33#undef CFA_HAVE_IORING_OP_LINK_TIMEOUT
     34#undef CFA_HAVE_IORING_OP_CONNECT
     35#undef CFA_HAVE_IORING_OP_FALLOCATE
     36#undef CFA_HAVE_IORING_OP_OPENAT
     37#undef CFA_HAVE_IORING_OP_CLOSE
     38#undef CFA_HAVE_IORING_OP_FILES_UPDATE
     39#undef CFA_HAVE_IORING_OP_STATX
     40#undef CFA_HAVE_IORING_OP_READ
     41#undef CFA_HAVE_IORING_OP_WRITE
     42#undef CFA_HAVE_IORING_OP_FADVISE
     43#undef CFA_HAVE_IORING_OP_MADVISE
     44#undef CFA_HAVE_IORING_OP_SEND
     45#undef CFA_HAVE_IORING_OP_RECV
     46#undef CFA_HAVE_IORING_OP_OPENAT2
     47#undef CFA_HAVE_IORING_OP_EPOLL_CTL
     48#undef CFA_HAVE_IORING_OP_SPLICE
     49#undef CFA_HAVE_IORING_OP_PROVIDE_BUFFERS
     50#undef CFA_HAVE_IORING_OP_REMOVE_BUFFER
    1751
    1852#undef HAVE_PREADV2
  • libcfa/src/concurrency/io.cfa

    rd9c2284 r5751a56  
    1616#if defined(__CFA_DEBUG__)
    1717        // #define __CFA_DEBUG_PRINT_IO__
    18         #define __CFA_DEBUG_PRINT_IO_CORE__
     18        // #define __CFA_DEBUG_PRINT_IO_CORE__
    1919#endif
    2020
     
    2222#include "bitmanip.hfa"
    2323
    24 #if !defined(HAVE_LINUX_IO_URING_H)
     24#if !defined(CFA_HAVE_LINUX_IO_URING_H)
    2525        void __kernel_io_startup( cluster &, unsigned, bool ) {
    2626                // Nothing to do without io_uring
     
    490490        static uint32_t __release_consumed_submission( struct __io_data & ring );
    491491
     492        static inline void process(struct io_uring_cqe & cqe, struct __processor_id_t * id ) {
     493                struct __io_user_data_t * data = (struct __io_user_data_t *)(uintptr_t)cqe.user_data;
     494                __cfadbg_print_safe( io, "Kernel I/O : Syscall completed : cqe %p, result %d for %p\n", data, cqe.res, data->thrd );
     495
     496                data->result = cqe.res;
     497                if(!id) { unpark(     data->thrd __cfaabi_dbg_ctx2 ); }
     498                else  { __unpark( id, data->thrd __cfaabi_dbg_ctx2 ); }
     499        }
     500
    492501        // Process a single completion message from the io_uring
    493502        // This is NOT thread-safe
     
    538547                        /* paranoid */ verify(&cqe);
    539548
    540                         struct __io_user_data_t * data = (struct __io_user_data_t *)(uintptr_t)cqe.user_data;
    541                         __cfadbg_print_safe( io, "Kernel I/O : Performed reading io cqe %p, result %d for %p\n", data, cqe.res, data->thrd );
    542 
    543                         data->result = cqe.res;
    544                         if(!mask) { unpark( data->thrd __cfaabi_dbg_ctx2 ); }
    545                         else      { __unpark( &ring.poller.slow.id, data->thrd __cfaabi_dbg_ctx2 ); }
     549                        process( cqe, !mask ? (struct __processor_id_t *)0p : &ring.poller.slow.id );
    546550                }
    547551
  • libcfa/src/concurrency/iocall.cfa

    rd9c2284 r5751a56  
    2020//=============================================================================================
    2121
    22 #if defined(HAVE_LINUX_IO_URING_H)
     22#if defined(CFA_HAVE_LINUX_IO_URING_H)
    2323        #include <stdint.h>
    2424        #include <linux/io_uring.h>
     
    122122#if defined(HAVE_PREADV2)
    123123        ssize_t cfa_preadv2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags) {
    124                 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_READV)
     124                #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_READV)
    125125                        return preadv2(fd, iov, iovcnt, offset, flags);
    126126                #else
     
    134134
    135135        ssize_t cfa_preadv2_fixed(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags) {
    136                 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_READV)
     136                #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_READV)
    137137                        return preadv2(fd, iov, iovcnt, offset, flags);
    138138                #else
     
    149149#if defined(HAVE_PWRITEV2)
    150150        ssize_t cfa_pwritev2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags) {
    151                 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_WRITEV)
     151                #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_WRITEV)
    152152                        return pwritev2(fd, iov, iovcnt, offset, flags);
    153153                #else
     
    162162
    163163int cfa_fsync(int fd) {
    164         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_FSYNC)
     164        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_FSYNC)
    165165                return fsync(fd);
    166166        #else
     
    174174
    175175int cfa_sync_file_range(int fd, int64_t offset, int64_t nbytes, unsigned int flags) {
    176         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_SYNC_FILE_RANGE)
     176        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_SYNC_FILE_RANGE)
    177177                return sync_file_range(fd, offset, nbytes, flags);
    178178        #else
     
    190190
    191191ssize_t cfa_sendmsg(int sockfd, const struct msghdr *msg, int flags) {
    192         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_SENDMSG)
     192        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_SENDMSG)
    193193                return sendmsg(sockfd, msg, flags);
    194194        #else
     
    203203
    204204ssize_t cfa_recvmsg(int sockfd, struct msghdr *msg, int flags) {
    205         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_RECVMSG)
     205        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_RECVMSG)
    206206                return recvmsg(sockfd, msg, flags);
    207207        #else
     
    216216
    217217ssize_t cfa_send(int sockfd, const void *buf, size_t len, int flags) {
    218         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_SEND)
     218        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_SEND)
    219219                return send( sockfd, buf, len, flags );
    220220        #else
     
    231231
    232232ssize_t cfa_recv(int sockfd, void *buf, size_t len, int flags) {
    233         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_RECV)
     233        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_RECV)
    234234                return recv( sockfd, buf, len, flags );
    235235        #else
     
    246246
    247247int cfa_accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags) {
    248         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_ACCEPT)
     248        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_ACCEPT)
    249249                return accept4( sockfd, addr, addrlen, flags );
    250250        #else
     
    261261
    262262int cfa_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
    263         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_CONNECT)
     263        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_CONNECT)
    264264                return connect( sockfd, addr, addrlen );
    265265        #else
     
    275275
    276276int cfa_fallocate(int fd, int mode, uint64_t offset, uint64_t len) {
    277         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_FALLOCATE)
     277        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_FALLOCATE)
    278278                return fallocate( fd, mode, offset, len );
    279279        #else
     
    290290
    291291int cfa_fadvise(int fd, uint64_t offset, uint64_t len, int advice) {
    292         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_FADVISE)
     292        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_FADVISE)
    293293                return posix_fadvise( fd, offset, len, advice );
    294294        #else
     
    305305
    306306int cfa_madvise(void *addr, size_t length, int advice) {
    307         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_MADVISE)
     307        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_MADVISE)
    308308                return madvise( addr, length, advice );
    309309        #else
     
    320320
    321321int cfa_openat(int dirfd, const char *pathname, int flags, mode_t mode) {
    322         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_OPENAT)
     322        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_OPENAT)
    323323                return openat( dirfd, pathname, flags, mode );
    324324        #else
     
    335335
    336336int cfa_close(int fd) {
    337         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_CLOSE)
     337        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_CLOSE)
    338338                return close( fd );
    339339        #else
     
    349349struct statx;
    350350int cfa_statx(int dirfd, const char *pathname, int flags, unsigned int mask, struct statx *statxbuf) {
    351         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_STATX)
     351        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_STATX)
    352352                #if defined(__NR_statx)
    353353                        return syscall( __NR_statx, dirfd, pathname, flags, mask, statxbuf );
     
    367367
    368368ssize_t cfa_read(int fd, void *buf, size_t count) {
    369         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_READ)
     369        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_READ)
    370370                return read( fd, buf, count );
    371371        #else
     
    379379
    380380ssize_t cfa_write(int fd, void *buf, size_t count) {
    381         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_WRITE)
     381        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_WRITE)
    382382                return read( fd, buf, count );
    383383        #else
     
    391391
    392392ssize_t cfa_splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags) {
    393         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_SPLICE)
     393        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_SPLICE)
    394394                return splice( fd_in, off_in, fd_out, off_out, len, flags );
    395395        #else
     
    405405}
    406406
     407ssize_t cfa_splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags, int in_flags, int out_flags) {
     408        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_SPLICE)
     409                return splice( fd_in, off_in, fd_out, off_out, len, flags );
     410        #else
     411                __submit_prelude
     412
     413                (*sqe){ IORING_OP_SPLICE, fd_out, 0p, len, off_out };
     414                sqe->splice_fd_in  = fd_in;
     415                sqe->splice_off_in = off_in;
     416                sqe->splice_flags  = flags | out_flags;
     417                sqe->flags = in_flags;
     418
     419                __submit_wait
     420        #endif
     421}
     422
    407423ssize_t cfa_tee(int fd_in, int fd_out, size_t len, unsigned int flags) {
    408         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_TEE)
     424        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_TEE)
    409425                return tee( fd_in, fd_out, len, flags );
    410426        #else
     
    429445
    430446bool has_user_level_blocking( fptr_t func ) {
    431         #if defined(HAVE_LINUX_IO_URING_H)
     447        #if defined(CFA_HAVE_LINUX_IO_URING_H)
    432448                #if defined(HAVE_PREADV2)
    433449                        if( /*func == (fptr_t)preadv2 || */
    434450                                func == (fptr_t)cfa_preadv2 )
    435                                 #define _CFA_IO_FEATURE_IORING_OP_READV ,
    436                                 return IS_DEFINED(IORING_OP_READV);
     451                                #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_READV ,
     452                                return IS_DEFINED(CFA_HAVE_IORING_OP_READV);
    437453                #endif
    438454
     
    440456                        if( /*func == (fptr_t)pwritev2 || */
    441457                                func == (fptr_t)cfa_pwritev2 )
    442                                 #define _CFA_IO_FEATURE_IORING_OP_WRITEV ,
    443                                 return IS_DEFINED(IORING_OP_WRITEV);
     458                                #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_WRITEV ,
     459                                return IS_DEFINED(CFA_HAVE_IORING_OP_WRITEV);
    444460                #endif
    445461
    446462                if( /*func == (fptr_t)fsync || */
    447463                        func == (fptr_t)cfa_fsync )
    448                         #define _CFA_IO_FEATURE_IORING_OP_FSYNC ,
    449                         return IS_DEFINED(IORING_OP_FSYNC);
     464                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_FSYNC ,
     465                        return IS_DEFINED(CFA_HAVE_IORING_OP_FSYNC);
    450466
    451467                if( /*func == (fptr_t)ync_file_range || */
    452468                        func == (fptr_t)cfa_sync_file_range )
    453                         #define _CFA_IO_FEATURE_IORING_OP_SYNC_FILE_RANGE ,
    454                         return IS_DEFINED(IORING_OP_SYNC_FILE_RANGE);
     469                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_SYNC_FILE_RANGE ,
     470                        return IS_DEFINED(CFA_HAVE_IORING_OP_SYNC_FILE_RANGE);
    455471
    456472                if( /*func == (fptr_t)sendmsg || */
    457473                        func == (fptr_t)cfa_sendmsg )
    458                         #define _CFA_IO_FEATURE_IORING_OP_SENDMSG ,
    459                         return IS_DEFINED(IORING_OP_SENDMSG);
     474                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_SENDMSG ,
     475                        return IS_DEFINED(CFA_HAVE_IORING_OP_SENDMSG);
    460476
    461477                if( /*func == (fptr_t)recvmsg || */
    462478                        func == (fptr_t)cfa_recvmsg )
    463                         #define _CFA_IO_FEATURE_IORING_OP_RECVMSG ,
    464                         return IS_DEFINED(IORING_OP_RECVMSG);
     479                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_RECVMSG ,
     480                        return IS_DEFINED(CFA_HAVE_IORING_OP_RECVMSG);
    465481
    466482                if( /*func == (fptr_t)send || */
    467483                        func == (fptr_t)cfa_send )
    468                         #define _CFA_IO_FEATURE_IORING_OP_SEND ,
    469                         return IS_DEFINED(IORING_OP_SEND);
     484                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_SEND ,
     485                        return IS_DEFINED(CFA_HAVE_IORING_OP_SEND);
    470486
    471487                if( /*func == (fptr_t)recv || */
    472488                        func == (fptr_t)cfa_recv )
    473                         #define _CFA_IO_FEATURE_IORING_OP_RECV ,
    474                         return IS_DEFINED(IORING_OP_RECV);
     489                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_RECV ,
     490                        return IS_DEFINED(CFA_HAVE_IORING_OP_RECV);
    475491
    476492                if( /*func == (fptr_t)accept4 || */
    477493                        func == (fptr_t)cfa_accept4 )
    478                         #define _CFA_IO_FEATURE_IORING_OP_ACCEPT ,
    479                         return IS_DEFINED(IORING_OP_ACCEPT);
     494                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_ACCEPT ,
     495                        return IS_DEFINED(CFA_HAVE_IORING_OP_ACCEPT);
    480496
    481497                if( /*func == (fptr_t)connect || */
    482498                        func == (fptr_t)cfa_connect )
    483                         #define _CFA_IO_FEATURE_IORING_OP_CONNECT ,
    484                         return IS_DEFINED(IORING_OP_CONNECT);
     499                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_CONNECT ,
     500                        return IS_DEFINED(CFA_HAVE_IORING_OP_CONNECT);
    485501
    486502                if( /*func == (fptr_t)fallocate || */
    487503                        func == (fptr_t)cfa_fallocate )
    488                         #define _CFA_IO_FEATURE_IORING_OP_FALLOCATE ,
    489                         return IS_DEFINED(IORING_OP_FALLOCATE);
     504                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_FALLOCATE ,
     505                        return IS_DEFINED(CFA_HAVE_IORING_OP_FALLOCATE);
    490506
    491507                if( /*func == (fptr_t)posix_fadvise || */
    492508                        func == (fptr_t)cfa_fadvise )
    493                         #define _CFA_IO_FEATURE_IORING_OP_FADVISE ,
    494                         return IS_DEFINED(IORING_OP_FADVISE);
     509                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_FADVISE ,
     510                        return IS_DEFINED(CFA_HAVE_IORING_OP_FADVISE);
    495511
    496512                if( /*func == (fptr_t)madvise || */
    497513                        func == (fptr_t)cfa_madvise )
    498                         #define _CFA_IO_FEATURE_IORING_OP_MADVISE ,
    499                         return IS_DEFINED(IORING_OP_MADVISE);
     514                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_MADVISE ,
     515                        return IS_DEFINED(CFA_HAVE_IORING_OP_MADVISE);
    500516
    501517                if( /*func == (fptr_t)openat || */
    502518                        func == (fptr_t)cfa_openat )
    503                         #define _CFA_IO_FEATURE_IORING_OP_OPENAT ,
    504                         return IS_DEFINED(IORING_OP_OPENAT);
     519                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_OPENAT ,
     520                        return IS_DEFINED(CFA_HAVE_IORING_OP_OPENAT);
    505521
    506522                if( /*func == (fptr_t)close || */
    507523                        func == (fptr_t)cfa_close )
    508                         #define _CFA_IO_FEATURE_IORING_OP_CLOSE ,
    509                         return IS_DEFINED(IORING_OP_CLOSE);
     524                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_CLOSE ,
     525                        return IS_DEFINED(CFA_HAVE_IORING_OP_CLOSE);
    510526
    511527                if( /*func == (fptr_t)read || */
    512528                        func == (fptr_t)cfa_read )
    513                         #define _CFA_IO_FEATURE_IORING_OP_READ ,
    514                         return IS_DEFINED(IORING_OP_READ);
     529                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_READ ,
     530                        return IS_DEFINED(CFA_HAVE_IORING_OP_READ);
    515531
    516532                if( /*func == (fptr_t)write || */
    517533                        func == (fptr_t)cfa_write )
    518                         #define _CFA_IO_FEATURE_IORING_OP_WRITE ,
    519                         return IS_DEFINED(IORING_OP_WRITE);
     534                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_WRITE ,
     535                        return IS_DEFINED(CFA_HAVE_IORING_OP_WRITE);
    520536
    521537                if( /*func == (fptr_t)splice || */
    522                         func == (fptr_t)cfa_splice )
    523                         #define _CFA_IO_FEATURE_IORING_OP_SPLICE ,
    524                         return IS_DEFINED(IORING_OP_SPLICE);
     538                        func == (fptr_t)(ssize_t (*)(int, loff_t *, int, loff_t *, size_t, unsigned int))cfa_splice,
     539                        func == (fptr_t)(ssize_t (*)(int, loff_t *, int, loff_t *, size_t, unsigned int, int, int))cfa_splice )
     540                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_SPLICE ,
     541                        return IS_DEFINED(CFA_HAVE_IORING_OP_SPLICE);
    525542
    526543                if( /*func == (fptr_t)tee || */
    527544                        func == (fptr_t)cfa_tee )
    528                         #define _CFA_IO_FEATURE_IORING_OP_TEE ,
    529                         return IS_DEFINED(IORING_OP_TEE);
     545                        #define _CFA_IO_FEATURE_CFA_HAVE_IORING_OP_TEE ,
     546                        return IS_DEFINED(CFA_HAVE_IORING_OP_TEE);
    530547        #endif
    531548
  • libcfa/src/concurrency/stats.cfa

    rd9c2284 r5751a56  
    2424                stats->ready.sleep.exits   = 0;
    2525
    26                 #if defined(HAVE_LINUX_IO_URING_H)
     26                #if defined(CFA_HAVE_LINUX_IO_URING_H)
    2727                        stats->io.submit_q.submit_avg.rdy = 0;
    2828                        stats->io.submit_q.submit_avg.csm = 0;
     
    5959                __atomic_fetch_add( &cltr->ready.sleep.exits  , proc->ready.sleep.exits  , __ATOMIC_SEQ_CST );
    6060
    61                 #if defined(HAVE_LINUX_IO_URING_H)
     61                #if defined(CFA_HAVE_LINUX_IO_URING_H)
    6262                        __atomic_fetch_add( &cltr->io.submit_q.submit_avg.rdy          , proc->io.submit_q.submit_avg.rdy          , __ATOMIC_SEQ_CST );
    6363                        __atomic_fetch_add( &cltr->io.submit_q.submit_avg.csm          , proc->io.submit_q.submit_avg.csm          , __ATOMIC_SEQ_CST );
     
    121121                }
    122122
    123                 #if defined(HAVE_LINUX_IO_URING_H)
     123                #if defined(CFA_HAVE_LINUX_IO_URING_H)
    124124                        if( flags & CFA_STATS_IO ) {
    125125                                double avgrdy = ((double)io.submit_q.submit_avg.rdy) / io.submit_q.submit_avg.cnt;
  • libcfa/src/concurrency/stats.hfa

    rd9c2284 r5751a56  
    1111        enum {
    1212                CFA_STATS_READY_Q  = 0x01,
    13                 #if defined(HAVE_LINUX_IO_URING_H)
     13                #if defined(CFA_HAVE_LINUX_IO_URING_H)
    1414                        CFA_STATS_IO = 0x02,
    1515                #endif
     
    6464        };
    6565
    66         #if defined(HAVE_LINUX_IO_URING_H)
     66        #if defined(CFA_HAVE_LINUX_IO_URING_H)
    6767                struct __attribute__((aligned(64))) __stats_io_t{
    6868                        struct {
     
    9999        struct __attribute__((aligned(128))) __stats_t {
    100100                __stats_readQ_t ready;
    101                 #if defined(HAVE_LINUX_IO_URING_H)
     101                #if defined(CFA_HAVE_LINUX_IO_URING_H)
    102102                        __stats_io_t    io;
    103103                #endif
Note: See TracChangeset for help on using the changeset viewer.