From patchwork Tue Aug 11 09:27:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 8131 Received: (qmail 56062 invoked by alias); 11 Aug 2015 09:28:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 56047 invoked by uid 89); 11 Aug 2015 09:28:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org From: Mike Frysinger To: libc-alpha@sourceware.org Subject: [PATCH] x86: i486: stub out init-arch logic Date: Tue, 11 Aug 2015 05:27:58 -0400 Message-Id: <1439285278-22006-1-git-send-email-vapier@gentoo.org> The common x86 init-arch logic hardcodes the usage of cpuid which breaks running on i486 and older systems. Rather than add more checking to the common case only for old cpus, stub it out for i486 systems entirely. Reported-by: Daniel Goertzen URL: https://bugs.gentoo.org/523830 2015-08-11 Mike Frysinger * sysdeps/unix/sysv/linux/i386/i486/init-arch.c: New file. --- sysdeps/unix/sysv/linux/i386/i486/init-arch.c | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/i386/i486/init-arch.c diff --git a/sysdeps/unix/sysv/linux/i386/i486/init-arch.c b/sysdeps/unix/sysv/linux/i386/i486/init-arch.c new file mode 100644 index 0000000..c95979d --- /dev/null +++ b/sysdeps/unix/sysv/linux/i386/i486/init-arch.c @@ -0,0 +1,44 @@ +/* Initialize CPU feature data. + This file is part of the GNU C Library. + Copyright (C) 2015 Free Software Foundation, Inc. + + 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 + . */ + +#include +#include "init-arch.h" + + +struct cpu_features __cpu_features attribute_hidden; + + +void +__init_cpu_features (void) +{ + __cpu_features.family = 0; + __cpu_features.model = 0; + atomic_write_barrier (); + __cpu_features.kind = arch_kind_other; +} + +#undef __get_cpu_features + +const struct cpu_features * +__get_cpu_features (void) +{ + if (__cpu_features.kind == arch_kind_unknown) + __init_cpu_features (); + + return &__cpu_features; +}