Module: xenomai-forge
Branch: next
Commit: 8a04e966208076f750b7b31e9ca8eaf43791c469
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=8a04e966208076f750b7b31e9ca8eaf43791c469

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Jun 18 11:48:40 2013 +0200

cobalt/x86: rename --enable-x86-sep to --enable-x86-vsyscall

This patch fixes a confusing misnomer.

Turning on this switch (default case) makes lib/cobalt assume the
underlying pthread library knows how to route syscalls via the
vsyscall entry point. Turning it off causes lib/cobalt to issue
syscalls via the legacy 0x80 vector, to cope with the oldish
Linuxthreads library which does not know about vsyscall.

All x86 kernels we support do provide vsyscall support. Whether the
vDSO code exported by the kernel eventually uses the sep instruction
or the 0x80 trap is irrelevant to our configuration. We don't have to
know.

The former --enable-x86-sep switch is therefore renamed
--enable-x86-vsyscall to make things clearer.

---

 configure                         |   28 ++++++++++++++--------------
 configure.in                      |   18 +++++++++---------
 include/cobalt/asm-x86/syscall.h  |   17 ++++++++++-------
 lib/cobalt/sysdeps/x86/features.c |    8 ++++----
 lib/include/xeno_config.h.in      |    2 +-
 5 files changed, 38 insertions(+), 35 deletions(-)

diff --git a/configure b/configure
index ed7f424..a8aa220 100755
--- a/configure
+++ b/configure
@@ -848,7 +848,7 @@ enable_async_cancel
 enable_pshared
 enable_registry
 enable_smp
-enable_x86_sep
+enable_x86_vsyscall
 enable_arm_tsc
 enable_arm_quirks
 enable_doc_install
@@ -1515,7 +1515,7 @@ Optional Features:
   --enable-pshared        Enable shared multi-processing for capable skins
   --enable-registry       Export real-time objects to a registry
   --enable-smp            Enable SMP support
-  --enable-x86-sep        Enable x86 SEP instructions for issuing syscalls
+  --enable-x86-vsyscall   Assume VSYSCALL enabled for issuing syscalls
   --enable-arm-tsc        You only need this option if you get the following
                           message when starting an application: Xenomai:
                           incompatible feature set (userland requires
@@ -12932,21 +12932,21 @@ fi
 $as_echo "${CONFIG_SMP:-no}" >&6; }
 
 
-CONFIG_XENO_X86_SEP=y
+CONFIG_XENO_X86_VSYSCALL=y
 
 if test $XENO_TARGET_ARCH = x86; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86 SEP instructions 
in syscalls" >&5
-$as_echo_n "checking for x86 SEP instructions in syscalls... " >&6; }
-  # Check whether --enable-x86-sep was given.
-if test "${enable_x86_sep+set}" = set; then :
-  enableval=$enable_x86_sep; case "$enableval" in
-       y | yes) CONFIG_XENO_X86_SEP=y ;;
-       *) unset CONFIG_XENO_X86_SEP ;;
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86 VSYSCALL 
availability" >&5
+$as_echo_n "checking for x86 VSYSCALL availability... " >&6; }
+  # Check whether --enable-x86-vsyscall was given.
+if test "${enable_x86_vsyscall+set}" = set; then :
+  enableval=$enable_x86_vsyscall; case "$enableval" in
+       y | yes) CONFIG_XENO_X86_VSYSCALL=y ;;
+       *) unset CONFIG_XENO_X86_VSYSCALL ;;
        esac
 fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${CONFIG_XENO_X86_SEP:-no}" 
>&5
-$as_echo "${CONFIG_XENO_X86_SEP:-no}" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: 
${CONFIG_XENO_X86_VSYSCALL:-no}" >&5
+$as_echo "${CONFIG_XENO_X86_VSYSCALL:-no}" >&6; }
 fi
 
 
@@ -13663,8 +13663,8 @@ _ACEOF
 
 
 
-test x$CONFIG_XENO_X86_SEP = xy &&
-$as_echo "#define CONFIG_XENO_X86_SEP 1" >>confdefs.h
+test x$CONFIG_XENO_X86_VSYSCALL = xy &&
+$as_echo "#define CONFIG_XENO_X86_VSYSCALL 1" >>confdefs.h
 
 test x$CONFIG_SMP = xy &&
 $as_echo "#define CONFIG_SMP 1" >>confdefs.h
diff --git a/configure.in b/configure.in
index bb00f32..b14fae5 100644
--- a/configure.in
+++ b/configure.in
@@ -303,19 +303,19 @@ AC_ARG_ENABLE(smp,
        esac])
 AC_MSG_RESULT(${CONFIG_SMP:-no})
 
-dnl SEP (default: enabled) for x86
+dnl VSYSCALL (default: enabled) for x86
 
-CONFIG_XENO_X86_SEP=y
+CONFIG_XENO_X86_VSYSCALL=y
 
 if test $XENO_TARGET_ARCH = x86; then
-  AC_MSG_CHECKING(for x86 SEP instructions in syscalls)
-  AC_ARG_ENABLE(x86-sep,
-       AS_HELP_STRING([--enable-x86-sep], [Enable x86 SEP instructions for 
issuing syscalls]),
+  AC_MSG_CHECKING(for x86 VSYSCALL availability)
+  AC_ARG_ENABLE(x86-vsyscall,
+       AS_HELP_STRING([--enable-x86-vsyscall], [Assume VSYSCALL enabled for 
issuing syscalls]),
        [case "$enableval" in
-       y | yes) CONFIG_XENO_X86_SEP=y ;;
-       *) unset CONFIG_XENO_X86_SEP ;;
+       y | yes) CONFIG_XENO_X86_VSYSCALL=y ;;
+       *) unset CONFIG_XENO_X86_VSYSCALL ;;
        esac])
-  AC_MSG_RESULT(${CONFIG_XENO_X86_SEP:-no})
+  AC_MSG_RESULT(${CONFIG_XENO_X86_VSYSCALL:-no})
 fi
 
 dnl ARCH support for ARM (default: 4)
@@ -521,7 +521,7 @@ dnl don't need to make particular cases with kernel code 
which may
 dnl also be compiled in user-space libs.
 dnl
 
-test x$CONFIG_XENO_X86_SEP = xy && AC_DEFINE(CONFIG_XENO_X86_SEP,1,[config])
+test x$CONFIG_XENO_X86_VSYSCALL = xy && 
AC_DEFINE(CONFIG_XENO_X86_VSYSCALL,1,[config])
 test x$CONFIG_SMP = xy && AC_DEFINE(CONFIG_SMP,1,[config])
 test x$CONFIG_XENO_ARM_SA1100 = xy && 
AC_DEFINE(CONFIG_XENO_ARM_SA1100,1,[config])
 test x$CONFIG_XENO_CPU_XSC3 = xy && AC_DEFINE(CONFIG_XENO_CPU_XSC3,1,[config])
diff --git a/include/cobalt/asm-x86/syscall.h b/include/cobalt/asm-x86/syscall.h
index 91f90bc..a6782ac 100644
--- a/include/cobalt/asm-x86/syscall.h
+++ b/include/cobalt/asm-x86/syscall.h
@@ -98,15 +98,18 @@ static inline int xnarch_local_syscall(void)
 
 #ifdef __i386__
 
-#ifdef CONFIG_XENO_X86_SEP
-/* This form relies on the kernel's vsyscall support in order to use
-   the SEP instructions which must be supported by the hardware. We
-   also depend on the NPTL providing us a pointer to the vsyscall DSO
-   entry point, to which we branch to instead of issuing a trap. */
+#ifdef CONFIG_XENO_X86_VSYSCALL
+/*
+ * This form relies on the kernel's vsyscall support in order to use
+ * the most appropriate syscall entry instruction the CPU supports. We
+ * also depend on the NPTL providing us a pointer to the vsyscall DSO
+ * entry point, to which we branch to instead of issuing a trap.
+ * We assume this pointer to be available at %gs:0x10.
+ */
 #define DOSYSCALL  "call *%%gs:0x10\n\t"
-#else /* CONFIG_XENO_X86_SEP */
+#else /* CONFIG_XENO_X86_VSYSCALL */
 #define DOSYSCALL  "int $0x80\n\t"
-#endif /* CONFIG_XENO_X86_SEP */
+#endif /* CONFIG_XENO_X86_VSYSCALL */
 
 /* The one that cannot fail. */
 #define DOSYSCALLSAFE  "int $0x80\n\t"
diff --git a/lib/cobalt/sysdeps/x86/features.c 
b/lib/cobalt/sysdeps/x86/features.c
index 3e69c4e..3358404 100644
--- a/lib/cobalt/sysdeps/x86/features.c
+++ b/lib/cobalt/sysdeps/x86/features.c
@@ -25,7 +25,7 @@
 
 void cobalt_check_features(struct xnfeatinfo *finfo)
 {
-#if defined(__i386__) && defined(CONFIG_XENO_X86_SEP)
+#if defined(__i386__) && defined(CONFIG_XENO_X86_VSYSCALL)
        size_t n = confstr(_CS_GNU_LIBPTHREAD_VERSION, NULL, 0);
        if (n > 0) {
                char buf[n];
@@ -36,9 +36,9 @@ void cobalt_check_features(struct xnfeatinfo *finfo)
                        return;
        }
 
-       report_error("--enable-x86-sep needs NPTL and Linux 2.6.x or higher,");
+       report_error("--enable-x86-vsyscall needs NPTL and Linux 2.6.x or 
higher,");
        report_error_cont("which does not match your configuration. Please 
upgrade, or");
-       report_error_cont("rebuild the Xenomai libraries passing 
--disable-x86-sep");
+       report_error_cont("rebuild the Xenomai libraries passing 
--disable-x86-vsyscall");
        exit(1);
-#endif /* __i386__ && CONFIG_XENO_X86_SEP */
+#endif /* __i386__ && CONFIG_XENO_X86_VSYSCALL */
 }
diff --git a/lib/include/xeno_config.h.in b/lib/include/xeno_config.h.in
index 8764a19..65450b9 100644
--- a/lib/include/xeno_config.h.in
+++ b/lib/include/xeno_config.h.in
@@ -82,7 +82,7 @@
 #undef CONFIG_XENO_VERSION_MINOR
 
 /* config */
-#undef CONFIG_XENO_X86_SEP
+#undef CONFIG_XENO_X86_VSYSCALL
 
 #ifdef __IN_XENO__
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to