From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20560 invoked by alias); 19 Feb 2012 12:51:37 -0000 Received: (qmail 20552 invoked by uid 22791); 19 Feb 2012 12:51:36 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=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; Sun, 19 Feb 2012 12:51:21 +0000 Received: from aurel32 by hall.aurel32.net with local (Exim 4.72) (envelope-from ) id 1Rz6EZ-0004LF-6M; Sun, 19 Feb 2012 13:51:19 +0100 Date: Sun, 19 Feb 2012 12:51:00 -0000 From: Aurelien Jarno To: libc-ports@sourceware.org Cc: Richard Henderson Subject: Re: [PATCH][alpha] Fix _SC_LEVEL*CACHE* Message-ID: <20120219125119.GQ9153@hall.aurel32.net> References: <20110401211854.GC16226@hall.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20110401211854.GC16226@hall.aurel32.net> 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: 2012-02/txt/msg00060.txt.bz2 Ping ? On Fri, Apr 01, 2011 at 11:18:54PM +0200, Aurelien Jarno wrote: > 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 > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net