Module: xenomai-head
Branch: master
Commit: 04be5b18efb210ddf9444e249456032655c7a4ca
URL:    
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=04be5b18efb210ddf9444e249456032655c7a4ca

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sat Sep 19 19:22:11 2009 +0200

build: introduce CONFIG_XENO_DEFAULT_PERIOD

---

 configure                         |   42 ++++++++++++++++++++++++------------
 configure.in                      |   10 ++++++++
 src/include/xeno_config.h.in      |    3 ++
 src/testsuite/cyclic/cyclictest.c |   10 +++++++-
 src/testsuite/latency/latency.c   |    2 +-
 src/testsuite/unit/wakeup-time.c  |    2 +-
 6 files changed, 51 insertions(+), 18 deletions(-)

diff --git a/configure b/configure
index 8225e70..75f0862 100755
--- a/configure
+++ b/configure
@@ -5559,23 +5559,27 @@ case "$build_for" in
         XENO_LINUX_ARCH=i386
        XENO_LINUX_INSTALL_TARGET=install
        CONFIG_XENO_FASTSYNCH=y
+       CONFIG_XENO_DEFAULT_PERIOD=100000
         ;;
  ppc-*)
        XENO_TARGET_ARCH=powerpc
         XENO_LINUX_ARCH=ppc
        XENO_LINUX_INSTALL_TARGET=install
        CONFIG_XENO_FASTSYNCH=y
+       CONFIG_XENO_DEFAULT_PERIOD=100000
         ;;
  powerpc-*|powerpc64-*|ppc64-*)
        XENO_TARGET_ARCH=powerpc
         XENO_LINUX_ARCH=powerpc
        XENO_LINUX_INSTALL_TARGET=install
        CONFIG_XENO_FASTSYNCH=y
+       CONFIG_XENO_DEFAULT_PERIOD=100000
         ;;
  bfin-*|bfinnommu-*|blackfin-*)
        XENO_TARGET_ARCH=blackfin
         XENO_LINUX_ARCH=blackfin
        XENO_LINUX_INSTALL_TARGET=install
+       CONFIG_XENO_DEFAULT_PERIOD=100000
         ;;
  arm*-*)
        use__thread=no
@@ -5583,6 +5587,7 @@ case "$build_for" in
        XENO_LINUX_ARCH=arm
        XENO_LINUX_INSTALL_TARGET=install_image
        XENO_LINUX_IMAGE=arch/arm/boot/zImage
+       CONFIG_XENO_DEFAULT_PERIOD=1000000
        # We set CONFIG_XENO_FASTSYNCH later, when we know what architecture we
        # are running
        ;;
@@ -5591,11 +5596,13 @@ case "$build_for" in
         XENO_LINUX_ARCH=x86_64
        XENO_LINUX_INSTALL_TARGET=install
        CONFIG_XENO_FASTSYNCH=y
+       CONFIG_XENO_DEFAULT_PERIOD=100000
         ;;
  nios2-*)
        XENO_TARGET_ARCH=nios2
         XENO_LINUX_ARCH=nios2
        XENO_LINUX_INSTALL_TARGET=install
+       CONFIG_XENO_DEFAULT_PERIOD=10000000
        # Check whether --enable-shared was given.
 if test "${enable_shared+set}" = set; then
   enableval=$enable_shared; p=${PACKAGE-default}
@@ -6257,13 +6264,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
 else
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:6260: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:6267: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:6263: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:6270: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:6266: output\"" >&5)
+  (eval echo "\"\$as_me:6273: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     lt_cv_nm_interface="MS dumpbin"
@@ -7361,7 +7368,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 7364 "configure"' > conftest.$ac_ext
+  echo '#line 7371 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -8952,11 +8959,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8955: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8962: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8959: \$? = $ac_status" >&5
+   echo "$as_me:8966: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -9276,11 +9283,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9279: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9286: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9283: \$? = $ac_status" >&5
+   echo "$as_me:9290: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -9381,11 +9388,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9384: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9391: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:9388: \$? = $ac_status" >&5
+   echo "$as_me:9395: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -9436,11 +9443,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9439: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9446: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:9443: \$? = $ac_status" >&5
+   echo "$as_me:9450: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -12241,7 +12248,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12244 "configure"
+#line 12251 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12341,7 +12348,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12344 "configure"
+#line 12351 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13667,6 +13674,13 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 
+# Default sampling period (ns) used in various tests
+
+cat >>confdefs.h <<_ACEOF
+#define CONFIG_XENO_DEFAULT_PERIOD $CONFIG_XENO_DEFAULT_PERIOD
+_ACEOF
+
+
 
 
 
diff --git a/configure.in b/configure.in
index 71bad26..e1613e2 100644
--- a/configure.in
+++ b/configure.in
@@ -73,23 +73,27 @@ case "$build_for" in
         XENO_LINUX_ARCH=i386
        XENO_LINUX_INSTALL_TARGET=install
        CONFIG_XENO_FASTSYNCH=y
+       CONFIG_XENO_DEFAULT_PERIOD=100000
         ;;
  ppc-*)
        XENO_TARGET_ARCH=powerpc
         XENO_LINUX_ARCH=ppc
        XENO_LINUX_INSTALL_TARGET=install
        CONFIG_XENO_FASTSYNCH=y
+       CONFIG_XENO_DEFAULT_PERIOD=100000
         ;;
  powerpc-*|powerpc64-*|ppc64-*)
        XENO_TARGET_ARCH=powerpc
         XENO_LINUX_ARCH=powerpc
        XENO_LINUX_INSTALL_TARGET=install
        CONFIG_XENO_FASTSYNCH=y
+       CONFIG_XENO_DEFAULT_PERIOD=100000
         ;;
  bfin-*|bfinnommu-*|blackfin-*)
        XENO_TARGET_ARCH=blackfin
         XENO_LINUX_ARCH=blackfin
        XENO_LINUX_INSTALL_TARGET=install
+       CONFIG_XENO_DEFAULT_PERIOD=100000
         ;;
  arm*-*)
        use__thread=no
@@ -97,6 +101,7 @@ case "$build_for" in
        XENO_LINUX_ARCH=arm
        XENO_LINUX_INSTALL_TARGET=install_image
        XENO_LINUX_IMAGE=arch/arm/boot/zImage
+       CONFIG_XENO_DEFAULT_PERIOD=1000000
        # We set CONFIG_XENO_FASTSYNCH later, when we know what architecture we
        # are running
        ;;
@@ -105,11 +110,13 @@ case "$build_for" in
         XENO_LINUX_ARCH=x86_64
        XENO_LINUX_INSTALL_TARGET=install
        CONFIG_XENO_FASTSYNCH=y
+       CONFIG_XENO_DEFAULT_PERIOD=100000
         ;;
  nios2-*)
        XENO_TARGET_ARCH=nios2
         XENO_LINUX_ARCH=nios2
        XENO_LINUX_INSTALL_TARGET=install
+       CONFIG_XENO_DEFAULT_PERIOD=10000000
        AC_DISABLE_SHARED
         ;;
  *) echo ""
@@ -613,6 +620,9 @@ test x$CONFIG_XENO_CPU_XSC3 = xy && 
AC_DEFINE(CONFIG_XENO_CPU_XSC3,1,[config])
 test $XNARCH_ARM_TSC_TYPE && 
AC_DEFINE_UNQUOTED(XNARCH_ARM_TSC_TYPE,$XNARCH_ARM_TSC_TYPE,[config])
 test x$CONFIG_XENO_ARM_EABI = xy && AC_DEFINE(CONFIG_XENO_ARM_EABI,1,[config])
 
+# Default sampling period (ns) used in various tests
+AC_DEFINE_UNQUOTED(CONFIG_XENO_DEFAULT_PERIOD,$CONFIG_XENO_DEFAULT_PERIOD,[config])
+
 dnl CAUTION: We need to have the CONFIG_XENO_XX symbols always
 dnl defined when the configuration header is read, but we want the
 dnl Autoconf-produced symbols to be defined only when compiling
diff --git a/src/include/xeno_config.h.in b/src/include/xeno_config.h.in
index a326bb8..61fb9c5 100644
--- a/src/include/xeno_config.h.in
+++ b/src/include/xeno_config.h.in
@@ -25,6 +25,9 @@
 #undef CONFIG_XENO_CPU_XSC3
 
 /* config */
+#undef CONFIG_XENO_DEFAULT_PERIOD
+
+/* config */
 #undef CONFIG_XENO_FASTSYNCH
 
 /* Host system alias */
diff --git a/src/testsuite/cyclic/cyclictest.c 
b/src/testsuite/cyclic/cyclictest.c
index 5e6e0bc..ac9ddf9 100644
--- a/src/testsuite/cyclic/cyclictest.c
+++ b/src/testsuite/cyclic/cyclictest.c
@@ -349,8 +349,8 @@ static int max_cycles;
 static int clocksel = 0;
 static int verbose;
 static int quiet;
-static int interval = 1000;
-static int distance = 500;
+static int interval;
+static int distance;
 
 static int clocksources[] = {
        CLOCK_MONOTONIC,
@@ -463,6 +463,12 @@ int main(int argc, char **argv)
 
        mlockall(MCL_CURRENT | MCL_FUTURE);
 
+       if (CONFIG_XENO_DEFAULT_PERIOD > 1000000)
+               interval = CONFIG_XENO_DEFAULT_PERIOD;
+       else
+               interval = 1000000;
+       distance = interval / 2;
+
        process_options(argc, argv);
 
        mode = use_nanosleep + use_system;
diff --git a/src/testsuite/latency/latency.c b/src/testsuite/latency/latency.c
index 533a418..f82a072 100644
--- a/src/testsuite/latency/latency.c
+++ b/src/testsuite/latency/latency.c
@@ -537,7 +537,7 @@ int main(int argc, char **argv)
                cleanup();
 
        if (period_ns == 0)
-               period_ns = 100000LL;   /* ns */
+               period_ns = CONFIG_XENO_DEFAULT_PERIOD; /* ns */
 
        if (priority <= T_LOPRIO)
                priority = T_LOPRIO + 1;
diff --git a/src/testsuite/unit/wakeup-time.c b/src/testsuite/unit/wakeup-time.c
index b0c0615..2a1b8f2 100644
--- a/src/testsuite/unit/wakeup-time.c
+++ b/src/testsuite/unit/wakeup-time.c
@@ -28,7 +28,7 @@ long long maxjitter = -10000000;
 long long avgjitter = 0;
 long long lost = 0;
 long long nsamples = 100000;
-long long sampling_period = 100000;
+long long sampling_period = CONFIG_XENO_DEFAULT_PERIOD;
 
 #define HISTOGRAM_CELLS 100
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to