summaryrefslogtreecommitdiff
path: root/sysdeps/i386
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386')
-rw-r--r--sysdeps/i386/____longjmp_chk.S46
-rw-r--r--sysdeps/i386/__longjmp.S31
-rwxr-xr-xsysdeps/i386/configure100
-rw-r--r--sysdeps/i386/configure.in7
-rw-r--r--sysdeps/i386/i686/Makefile4
-rw-r--r--sysdeps/i386/i686/cacheinfo.c8
-rw-r--r--sysdeps/i386/i686/multiarch/Makefile4
-rw-r--r--sysdeps/i386/i686/multiarch/ifunc-defines.sym17
-rw-r--r--sysdeps/i386/i686/multiarch/init-arch.c3
-rw-r--r--sysdeps/i386/i686/multiarch/init-arch.h1
-rw-r--r--sysdeps/i386/i686/multiarch/sched_cpucount.c1
11 files changed, 108 insertions, 114 deletions
diff --git a/sysdeps/i386/____longjmp_chk.S b/sysdeps/i386/____longjmp_chk.S
index 6cd74968a2..0910861a9d 100644
--- a/sysdeps/i386/____longjmp_chk.S
+++ b/sysdeps/i386/____longjmp_chk.S
@@ -1,45 +1 @@
-/* Copyright (C) 2001,2004,2005,2006,2009 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, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
- .section .rodata.str1.1,"aMS",@progbits,1
- .type longjmp_msg,@object
-longjmp_msg:
- .string "longjmp causes uninitialized stack frame"
- .size longjmp_msg, .-longjmp_msg
-
-
-#define __longjmp ____longjmp_chk
-
-#ifdef PIC
-# define CALL_FAIL movl %ebx, %ecx; \
- cfi_register(%ebx,%ecx); \
- LOAD_PIC_REG (bx); \
- leal longjmp_msg@GOTOFF(%ebx), %eax; \
- call __GI___fortify_fail@PLT
-#else
-# define CALL_FAIL movl $longjmp_msg, %eax; \
- call __fortify_fail
-#endif
-
-#define CHECK_ESP(reg) \
- cmpl reg, %esp; \
- jbe .Lok; \
- CALL_FAIL; \
-.Lok:
-
-#include "__longjmp.S"
+#error "OS-specific version needed"
diff --git a/sysdeps/i386/__longjmp.S b/sysdeps/i386/__longjmp.S
index 8b0732056a..5ff7a73cea 100644
--- a/sysdeps/i386/__longjmp.S
+++ b/sysdeps/i386/__longjmp.S
@@ -21,20 +21,11 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
-
-#define PARMS LINKAGE /* no space for saved regs */
-#define JBUF PARMS
-#define VAL JBUF+PTR_SIZE
.text
-ENTRY (BP_SYM (__longjmp))
- ENTER
-
+ENTRY (__longjmp)
#ifdef PTR_DEMANGLE
- movl JBUF(%esp), %eax /* User's jmp_buf in %eax. */
- CHECK_BOUNDS_BOTH_WIDE (%eax, JBUF(%esp), $JB_SIZE)
+ movl 4(%esp), %eax /* User's jmp_buf in %eax. */
/* Save the return address now. */
movl (JB_PC*4)(%eax), %edx
@@ -42,9 +33,6 @@ ENTRY (BP_SYM (__longjmp))
movl (JB_SP*4)(%eax), %ecx
PTR_DEMANGLE (%edx)
PTR_DEMANGLE (%ecx)
-# ifdef CHECK_ESP
- CHECK_ESP (%ecx)
-# endif
cfi_def_cfa(%eax, 0)
cfi_register(%eip, %edx)
cfi_register(%esp, %ecx)
@@ -62,18 +50,11 @@ ENTRY (BP_SYM (__longjmp))
cfi_restore(%edi)
cfi_restore(%ebp)
- movl VAL(%esp), %eax /* Second argument is return value. */
+ movl 8(%esp), %eax /* Second argument is return value. */
movl %ecx, %esp
#else
- movl JBUF(%esp), %ecx /* User's jmp_buf in %ecx. */
- CHECK_BOUNDS_BOTH_WIDE (%ecx, JBUF(%esp), $JB_SIZE)
-
-# ifdef CHECK_ESP
- movl (JB_SP*4)(%ecx), %eax
- CHECK_ESP (%eax)
-# endif
-
- movl VAL(%esp), %eax /* Second argument is return value. */
+ movl 4(%esp), %ecx /* User's jmp_buf in %ecx. */
+ movl 8(%esp), %eax /* Second argument is return value. */
/* Save the return address now. */
movl (JB_PC*4)(%ecx), %edx
/* Restore registers. */
@@ -85,4 +66,4 @@ ENTRY (BP_SYM (__longjmp))
#endif
/* Jump to saved PC. */
jmp *%edx
-END (BP_SYM (__longjmp))
+END (__longjmp)
diff --git a/sysdeps/i386/configure b/sysdeps/i386/configure
index cbc8cd9206..ced0b31d0f 100755
--- a/sysdeps/i386/configure
+++ b/sysdeps/i386/configure
@@ -1,42 +1,54 @@
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
+# This file is generated from configure.in by Autoconf. DO NOT EDIT!
+ # Local configure fragment for sysdeps/i386.
+
+
+{ echo "$as_me:$LINENO: checking if gcc provides <cpuid.h>" >&5
+echo $ECHO_N "checking if gcc provides <cpuid.h>... $ECHO_C" >&6; }
+if test "${libc_cv_gcc_cpuid+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#include <cpuid.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ libc_cv_gcc_cpuid=yes
else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ libc_cv_gcc_cpuid=no
fi
-# This file is generated from configure.in by Autoconf. DO NOT EDIT!
- # Local configure fragment for sysdeps/i386.
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $libc_cv_gcc_cpuid" >&5
+echo "${ECHO_T}$libc_cv_gcc_cpuid" >&6; }
+if test $libc_cv_gcc_cpuid != yes; then
+ { { echo "$as_me:$LINENO: error: gcc must provide the <cpuid.h> header" >&5
+echo "$as_me: error: gcc must provide the <cpuid.h> header" >&2;}
+ { (exit 1); exit 1; }; }
+fi
-{ $as_echo "$as_me:$LINENO: checking if -g produces usable source locations for assembler-with-cpp" >&5
-$as_echo_n "checking if -g produces usable source locations for assembler-with-cpp... " >&6; }
+{ echo "$as_me:$LINENO: checking if -g produces usable source locations for assembler-with-cpp" >&5
+echo $ECHO_N "checking if -g produces usable source locations for assembler-with-cpp... $ECHO_C" >&6; }
if test "${libc_cv_cpp_asm_debuginfo+set}" = set; then
- $as_echo_n "(cached) " >&6
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat > conftest.S <<EOF
#include "confdefs.h"
@@ -59,7 +71,7 @@ if { ac_try='${CC-cc} $CPPFLAGS $ASFLAGS -g -c conftest.S 1>&5'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } && {
ac_pattern='conftest\.S'
{ ac_try='readelf --debug-dump=line conftest.o |
@@ -67,7 +79,7 @@ if { ac_try='${CC-cc} $CPPFLAGS $ASFLAGS -g -c conftest.S 1>&5'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }
}; then
libc_cv_cpp_asm_debuginfo=yes
@@ -76,8 +88,8 @@ else
fi
rm -f conftest*
fi
-{ $as_echo "$as_me:$LINENO: result: $libc_cv_cpp_asm_debuginfo" >&5
-$as_echo "$libc_cv_cpp_asm_debuginfo" >&6; }
+{ echo "$as_me:$LINENO: result: $libc_cv_cpp_asm_debuginfo" >&5
+echo "${ECHO_T}$libc_cv_cpp_asm_debuginfo" >&6; }
if test $libc_cv_cpp_asm_debuginfo = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_CPP_ASM_DEBUGINFO 1
@@ -85,24 +97,24 @@ _ACEOF
fi
-{ $as_echo "$as_me:$LINENO: checking for SSE4 support" >&5
-$as_echo_n "checking for SSE4 support... " >&6; }
+{ echo "$as_me:$LINENO: checking for SSE4 support" >&5
+echo $ECHO_N "checking for SSE4 support... $ECHO_C" >&6; }
if test "${libc_cv_cc_sse4+set}" = set; then
- $as_echo_n "(cached) " >&6
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if { ac_try='${CC-cc} -msse4 -xc /dev/null -S -o /dev/null'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
libc_cv_cc_sse4=yes
else
libc_cv_cc_sse4=no
fi
fi
-{ $as_echo "$as_me:$LINENO: result: $libc_cv_cc_sse4" >&5
-$as_echo "$libc_cv_cc_sse4" >&6; }
+{ echo "$as_me:$LINENO: result: $libc_cv_cc_sse4" >&5
+echo "${ECHO_T}$libc_cv_cc_sse4" >&6; }
if test $libc_cv_cc_sse4 = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_SSE4_SUPPORT 1
diff --git a/sysdeps/i386/configure.in b/sysdeps/i386/configure.in
index 44f53a57a0..800f928fbd 100644
--- a/sysdeps/i386/configure.in
+++ b/sysdeps/i386/configure.in
@@ -1,6 +1,13 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/i386.
+AC_CACHE_CHECK([if gcc provides <cpuid.h>], libc_cv_gcc_cpuid, [dnl
+AC_COMPILE_IFELSE([#include <cpuid.h>], libc_cv_gcc_cpuid=yes,
+ libc_cv_gcc_cpuid=no)])
+if test $libc_cv_gcc_cpuid != yes; then
+ AC_MSG_ERROR([gcc must provide the <cpuid.h> header])
+fi
+
AC_CACHE_CHECK(if -g produces usable source locations for assembler-with-cpp,
libc_cv_cpp_asm_debuginfo, [dnl
cat > conftest.S <<EOF
diff --git a/sysdeps/i386/i686/Makefile b/sysdeps/i386/i686/Makefile
index c7378ab21e..dbcf1c33d3 100644
--- a/sysdeps/i386/i686/Makefile
+++ b/sysdeps/i386/i686/Makefile
@@ -5,3 +5,7 @@ endif
# So that we can test __m128's alignment
stack-align-test-flags += -msse
+
+ifeq ($(subdir),string)
+sysdep_routines += cacheinfo
+endif
diff --git a/sysdeps/i386/i686/cacheinfo.c b/sysdeps/i386/i686/cacheinfo.c
new file mode 100644
index 0000000000..82e4cd223e
--- /dev/null
+++ b/sysdeps/i386/i686/cacheinfo.c
@@ -0,0 +1,8 @@
+#define __x86_64_data_cache_size_half __x86_data_cache_size_half
+#define __x86_64_shared_cache_size __x86_shared_cache_size
+#define __x86_64_shared_cache_size_half __x86_shared_cache_size_half
+
+#define DISABLE_PREFETCHW
+#define DISABLE_PREFERRED_MEMORY_INSTRUCTION
+
+#include <sysdeps/x86_64/cacheinfo.c>
diff --git a/sysdeps/i386/i686/multiarch/Makefile b/sysdeps/i386/i686/multiarch/Makefile
new file mode 100644
index 0000000000..33d98c36e6
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/Makefile
@@ -0,0 +1,4 @@
+ifeq ($(subdir),csu)
+aux += init-arch
+gen-as-const-headers += ifunc-defines.sym
+endif
diff --git a/sysdeps/i386/i686/multiarch/ifunc-defines.sym b/sysdeps/i386/i686/multiarch/ifunc-defines.sym
new file mode 100644
index 0000000000..e2021cdf87
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/ifunc-defines.sym
@@ -0,0 +1,17 @@
+#include "init-arch.h"
+#include <stddef.h>
+
+--
+
+CPU_FEATURES_SIZE sizeof (struct cpu_features)
+KIND_OFFSET offsetof (struct cpu_features, kind)
+CPUID_OFFSET offsetof (struct cpu_features, cpuid)
+CPUID_SIZE sizeof (struct cpuid_registers)
+CPUID_EAX_OFFSET offsetof (struct cpuid_registers, eax)
+CPUID_EBX_OFFSET offsetof (struct cpuid_registers, ebx)
+CPUID_ECX_OFFSET offsetof (struct cpuid_registers, ecx)
+CPUID_EDX_OFFSET offsetof (struct cpuid_registers, edx)
+FAMILY_OFFSET offsetof (struct cpu_features, family)
+MODEL_OFFSET offsetof (struct cpu_features, model)
+
+COMMON_CPUID_INDEX_1
diff --git a/sysdeps/i386/i686/multiarch/init-arch.c b/sysdeps/i386/i686/multiarch/init-arch.c
new file mode 100644
index 0000000000..b371bae1dc
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/init-arch.c
@@ -0,0 +1,3 @@
+#define ENABLE_SSSE3_ON_ATOM
+
+#include <sysdeps/x86_64/multiarch/init-arch.c>
diff --git a/sysdeps/i386/i686/multiarch/init-arch.h b/sysdeps/i386/i686/multiarch/init-arch.h
new file mode 100644
index 0000000000..cd2d0befee
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/init-arch.h
@@ -0,0 +1 @@
+#include <sysdeps/x86_64/multiarch/init-arch.h>
diff --git a/sysdeps/i386/i686/multiarch/sched_cpucount.c b/sysdeps/i386/i686/multiarch/sched_cpucount.c
new file mode 100644
index 0000000000..7db31b02f8
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/sched_cpucount.c
@@ -0,0 +1 @@
+#include <sysdeps/x86_64/multiarch/sched_cpucount.c>