From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19167 invoked by alias); 1 Apr 2011 21:19:03 -0000 Received: (qmail 19158 invoked by uid 22791); 1 Apr 2011 21:19:02 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from hall.aurel32.net (HELO hall.aurel32.net) (88.191.126.93) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Apr 2011 21:18:55 +0000 Received: from aurel32 by hall.aurel32.net with local (Exim 4.72) (envelope-from ) id 1Q5lk6-00042x-A9 for libc-ports@sourceware.org; Fri, 01 Apr 2011 23:18:54 +0200 Date: Fri, 01 Apr 2011 21:19:00 -0000 From: Aurelien Jarno To: libc-ports@sourceware.org Subject: [PATCH][alpha] Fix _SC_LEVEL*CACHE* Message-ID: <20110401211854.GC16226@hall.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2011-04/txt/msg00006.txt.bz2 sysconf() on alpha returns improper results for _SC_LEVEL*CACHE* entries: | LEVEL1_ICACHE_SIZE 64 | LEVEL1_ICACHE_ASSOC 65536 | LEVEL1_ICACHE_LINESIZE 2 | LEVEL1_DCACHE_SIZE 64 | LEVEL1_DCACHE_ASSOC 65536 | LEVEL1_DCACHE_LINESIZE 2 | LEVEL2_CACHE_SIZE 64 | LEVEL2_CACHE_ASSOC 4194304 | LEVEL2_CACHE_LINESIZE 1 This is due to the entries number being not properly aligned on modulo 3. This probably used to work at some point, but now that more entries have been added, it doesn't work anymore. The patch below fixes that. 2011-04-01 Aurelien Jarno * sysdeps/unix/sysv/linux/alpha/sysconf.c: Fix cache sysconf switch. diff --git a/sysdeps/unix/sysv/linux/alpha/sysconf.c b/sysdeps/unix/sysv/linux/alpha/sysconf.c index 51a2a47..30faa3f 100644 --- a/sysdeps/unix/sysv/linux/alpha/sysconf.c +++ b/sysdeps/unix/sysv/linux/alpha/sysconf.c @@ -135,7 +135,7 @@ __sysconf (int name) if (shape <= 0) return shape; - switch (name % 3) + switch ((name - _SC_LEVEL1_ICACHE_SIZE) % 3) { case 0: /* total size */ return shape & -0x100; -- Aurelien Jarno GPG: 1024D/F1BCDB73aurelien@aurel32.net http://www.aurel32.net