about summary refs log tree commit diff
path: root/ports/sysdeps
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2012-08-09 10:04:56 -0700
committerRoland McGrath <roland@hack.frob.com>2012-08-09 10:04:56 -0700
commita4ca51951804c14a5a8e331747649ca767bd8524 (patch)
tree76447f78f204b8b3f6e2ee21b10b00c2e224835c /ports/sysdeps
parent33b4a91e5b7935d68c50047f37b55056e5545b09 (diff)
downloadglibc-a4ca51951804c14a5a8e331747649ca767bd8524.tar.gz
glibc-a4ca51951804c14a5a8e331747649ca767bd8524.tar.xz
glibc-a4ca51951804c14a5a8e331747649ca767bd8524.zip
Don't check HWCAP_ARM_VFP in OS-generic code.
Presume VFP if compiled without __SOFTFP__ defined.
Diffstat (limited to 'ports/sysdeps')
-rw-r--r--ports/sysdeps/arm/arm-features.h34
-rw-r--r--ports/sysdeps/arm/fclrexcpt.c9
-rw-r--r--ports/sysdeps/arm/fedisblxcpt.c9
-rw-r--r--ports/sysdeps/arm/feenablxcpt.c9
-rw-r--r--ports/sysdeps/arm/fegetenv.c9
-rw-r--r--ports/sysdeps/arm/fegetexcept.c9
-rw-r--r--ports/sysdeps/arm/fegetround.c9
-rw-r--r--ports/sysdeps/arm/feholdexcpt.c9
-rw-r--r--ports/sysdeps/arm/fesetenv.c9
-rw-r--r--ports/sysdeps/arm/fesetround.c9
-rw-r--r--ports/sysdeps/arm/feupdateenv.c9
-rw-r--r--ports/sysdeps/arm/fgetexcptflg.c9
-rw-r--r--ports/sysdeps/arm/fraiseexcpt.c9
-rw-r--r--ports/sysdeps/arm/fsetexcptflg.c9
-rw-r--r--ports/sysdeps/arm/ftestexcept.c9
-rw-r--r--ports/sysdeps/arm/setfpucw.c9
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/arm-features.h30
17 files changed, 109 insertions, 90 deletions
diff --git a/ports/sysdeps/arm/arm-features.h b/ports/sysdeps/arm/arm-features.h
new file mode 100644
index 0000000000..0f99b3ab81
--- /dev/null
+++ b/ports/sysdeps/arm/arm-features.h
@@ -0,0 +1,34 @@
+/* Macros to test for CPU features on ARM.  Generic ARM version.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _ARM_ARM_FEATURES_H
+#define _ARM_ARM_FEATURES_H 1
+
+/* An OS-specific arm-features.h file should define ARM_HAVE_VFP to
+   an appropriate expression for testing at runtime whether the VFP
+   hardware is present.  We'll then redefine it to a constant if we
+   know at compile time that we can assume VFP.  */
+
+#ifndef __SOFTFP__
+/* The compiler is generating VFP instructions, so we're already
+   assuming the hardware exists.  */
+# undef ARM_HAVE_VFP
+# define ARM_HAVE_VFP	1
+#endif
+
+#endif  /* arm-features.h */
diff --git a/ports/sysdeps/arm/fclrexcpt.c b/ports/sysdeps/arm/fclrexcpt.c
index ddedc3573c..23435fba78 100644
--- a/ports/sysdeps/arm/fclrexcpt.c
+++ b/ports/sysdeps/arm/fclrexcpt.c
@@ -1,5 +1,5 @@
 /* Clear given exceptions in current floating-point environment.
-   Copyright (C) 1997,98,99,2000,01,05,11 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,16 +18,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __feclearexcept (int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long int temp;
 
diff --git a/ports/sysdeps/arm/fedisblxcpt.c b/ports/sysdeps/arm/fedisblxcpt.c
index c9c62a48ef..5b63d9a2e8 100644
--- a/ports/sysdeps/arm/fedisblxcpt.c
+++ b/ports/sysdeps/arm/fedisblxcpt.c
@@ -1,5 +1,5 @@
 /* Disable floating-point exceptions.
-   Copyright (C) 2001, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Philip Blundell <philb@gnu.org>, 2001.
 
@@ -19,16 +19,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 fedisableexcept (int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long int new_exc, old_exc;
 
diff --git a/ports/sysdeps/arm/feenablxcpt.c b/ports/sysdeps/arm/feenablxcpt.c
index 3b2b934f57..c5f0630066 100644
--- a/ports/sysdeps/arm/feenablxcpt.c
+++ b/ports/sysdeps/arm/feenablxcpt.c
@@ -1,5 +1,5 @@
 /* Enable floating-point exceptions.
-   Copyright (C) 2001, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Philip Blundell <philb@gnu.org>, 2001.
 
@@ -19,16 +19,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 feenableexcept (int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long int new_exc, old_exc;
 
diff --git a/ports/sysdeps/arm/fegetenv.c b/ports/sysdeps/arm/fegetenv.c
index c638635df4..1e8063ca82 100644
--- a/ports/sysdeps/arm/fegetenv.c
+++ b/ports/sysdeps/arm/fegetenv.c
@@ -1,5 +1,5 @@
 /* Store current floating-point environment.
-   Copyright (C) 1997,98,99,2000,01,05,10 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,16 +18,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __fegetenv (fenv_t *envp)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long int temp;
       _FPU_GETCW (temp);
diff --git a/ports/sysdeps/arm/fegetexcept.c b/ports/sysdeps/arm/fegetexcept.c
index 929d6c5cfa..a71e7dad6c 100644
--- a/ports/sysdeps/arm/fegetexcept.c
+++ b/ports/sysdeps/arm/fegetexcept.c
@@ -1,5 +1,5 @@
 /* Get floating-point exceptions.
-   Copyright (C) 2001, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Philip Blundell <philb@gnu.org>, 2001
 
@@ -19,16 +19,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 fegetexcept (void)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long temp;
 
diff --git a/ports/sysdeps/arm/fegetround.c b/ports/sysdeps/arm/fegetround.c
index df1049706b..0ed3dc996d 100644
--- a/ports/sysdeps/arm/fegetround.c
+++ b/ports/sysdeps/arm/fegetround.c
@@ -1,5 +1,5 @@
 /* Return current rounding direction.
-   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2004-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,16 +18,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 fegetround (void)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned int temp;
 
diff --git a/ports/sysdeps/arm/feholdexcpt.c b/ports/sysdeps/arm/feholdexcpt.c
index 4aed48bb39..cfa11d7321 100644
--- a/ports/sysdeps/arm/feholdexcpt.c
+++ b/ports/sysdeps/arm/feholdexcpt.c
@@ -1,5 +1,5 @@
 /* Store current floating-point environment and clear exceptions.
-   Copyright (C) 1997, 1998, 1999, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,16 +18,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 feholdexcept (fenv_t *envp)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long int temp;
 
diff --git a/ports/sysdeps/arm/fesetenv.c b/ports/sysdeps/arm/fesetenv.c
index 61370325e2..2fad61da1a 100644
--- a/ports/sysdeps/arm/fesetenv.c
+++ b/ports/sysdeps/arm/fesetenv.c
@@ -1,5 +1,5 @@
 /* Install given floating-point environment.
-   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2004-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,16 +18,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __fesetenv (const fenv_t *envp)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned int temp;
 
diff --git a/ports/sysdeps/arm/fesetround.c b/ports/sysdeps/arm/fesetround.c
index 997bd98f5a..6de1644a7a 100644
--- a/ports/sysdeps/arm/fesetround.c
+++ b/ports/sysdeps/arm/fesetround.c
@@ -1,5 +1,5 @@
 /* Set current rounding direction.
-   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2004-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,16 +18,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 fesetround (int round)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       fpu_control_t temp;
 
diff --git a/ports/sysdeps/arm/feupdateenv.c b/ports/sysdeps/arm/feupdateenv.c
index 98f265432c..c0ed06e32e 100644
--- a/ports/sysdeps/arm/feupdateenv.c
+++ b/ports/sysdeps/arm/feupdateenv.c
@@ -1,5 +1,5 @@
 /* Install given floating-point environment and raise exceptions.
-   Copyright (C) 1997, 1999, 2000, 2008, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -19,16 +19,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __feupdateenv (const fenv_t *envp)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned int temp;
 
diff --git a/ports/sysdeps/arm/fgetexcptflg.c b/ports/sysdeps/arm/fgetexcptflg.c
index 41661a2e29..7b6d66961a 100644
--- a/ports/sysdeps/arm/fgetexcptflg.c
+++ b/ports/sysdeps/arm/fgetexcptflg.c
@@ -1,5 +1,5 @@
 /* Store current representation for exceptions.
-   Copyright (C) 1997, 1999, 2000, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -19,16 +19,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __fegetexceptflag (fexcept_t *flagp, int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long temp;
 
diff --git a/ports/sysdeps/arm/fraiseexcpt.c b/ports/sysdeps/arm/fraiseexcpt.c
index 0a4368839f..cb0f75cf9e 100644
--- a/ports/sysdeps/arm/fraiseexcpt.c
+++ b/ports/sysdeps/arm/fraiseexcpt.c
@@ -1,5 +1,5 @@
 /* Raise given exceptions.
-   Copyright (C) 2004, 2005, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2004-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,16 +19,13 @@
 #include <fpu_control.h>
 #include <fenv.h>
 #include <float.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 feraiseexcept (int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       int fpscr;
       const float fp_zero = 0.0, fp_one = 1.0, fp_max = FLT_MAX,
diff --git a/ports/sysdeps/arm/fsetexcptflg.c b/ports/sysdeps/arm/fsetexcptflg.c
index bee51a96a2..f26268da6d 100644
--- a/ports/sysdeps/arm/fsetexcptflg.c
+++ b/ports/sysdeps/arm/fsetexcptflg.c
@@ -1,5 +1,5 @@
 /* Set floating-point environment exception handling.
-   Copyright (C) 1997,98,99,2000,01,05,08,11 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,16 +19,13 @@
 #include <fenv.h>
 #include <math.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __fesetexceptflag (const fexcept_t *flagp, int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       fexcept_t temp;
 
diff --git a/ports/sysdeps/arm/ftestexcept.c b/ports/sysdeps/arm/ftestexcept.c
index 06817d2fe0..8e37db10b7 100644
--- a/ports/sysdeps/arm/ftestexcept.c
+++ b/ports/sysdeps/arm/ftestexcept.c
@@ -1,5 +1,5 @@
 /* Test exception in current environment.
-   Copyright (C) 1997, 1998, 2005, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,16 +18,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 fetestexcept (int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       fexcept_t temp;
 
diff --git a/ports/sysdeps/arm/setfpucw.c b/ports/sysdeps/arm/setfpucw.c
index d0cea32b9d..0947e273d0 100644
--- a/ports/sysdeps/arm/setfpucw.c
+++ b/ports/sysdeps/arm/setfpucw.c
@@ -1,5 +1,5 @@
 /* Set the FPU control word.
-   Copyright (C) 1996, 1997, 1999, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1996-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,16 +18,13 @@
 
 #include <math.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 void
 __setfpucw (fpu_control_t set)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       fpu_control_t cw;
 
diff --git a/ports/sysdeps/unix/sysv/linux/arm/arm-features.h b/ports/sysdeps/unix/sysv/linux/arm/arm-features.h
new file mode 100644
index 0000000000..f20a705564
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/arm/arm-features.h
@@ -0,0 +1,30 @@
+/* Macros to test for CPU features on ARM.  Linux version.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _LINUX_ARM_FEATURES_H
+#define _LINUX_ARM_FEATURES_H 1
+
+#ifndef __ASSEMBLER__
+# include <ldsodefs.h>
+
+# define ARM_HAVE_VFP	(GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+#endif
+
+#include_next <arm-features.h>
+
+#endif  /* arm-features.h */