linux-mips
[Top] [All Lists]

Re: CVS Update@-mips.org: linux

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: CVS Update@-mips.org: linux
From: "Maciej W. Rozycki" <macro@linux-mips.org>
Date: Mon, 23 Aug 2004 13:40:14 +0200 (CEST)
Cc: linux-mips@linux-mips.org
In-reply-to: <20040823102402.GC17067@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20040820120223Z8225206-1530+8785@linux-mips.org> <Pine.LNX.4.58L.0408231124040.19572@blysk.ds.pg.gda.pl> <20040823102402.GC17067@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
On Mon, 23 Aug 2004, Ralf Baechle wrote:

> Due to PAGE_SHIFT being undefined?  You meant the opposite?

 Yes.  No.  PAGE_SHIFT is defined conditionally based on 
CONFIG_PAGE_SIZE_*, which is of course undefined in a generic set of 
headers.

 With PAGE_SIZE undefined you can fall back to sysconf(_SC_PAGESIZE) or 
the page size in the ELF auxiliary vector (depending on the context).  

> Procps but I have dark memories of other packages doing the same thing, so
> I gave up and kludged the thing the same way other architectures do.
> Even IA-64 which is suffering the same pains with variable page size.

 Do they?  Anyway that's not a way to fix broken software.  Perhaps we 
could do the following hack to teach the resistant:

#ifndef __KERNEL__
#warning PAGE_SIZE is not a user macro, fix your program!
#define PAGE_SIZE sysconf(_SC_PAGESIZE)
#endif

but glibc might not be especially happy about such an alias.

 If you really insist on PAGE_SIZE being constant, then please at least
define it to the maximum supported size for the userland, so that page
alignment rules are kept.  I don't see any reason to keep bugs alive,
though.

  Maciej

<Prev in Thread] Current Thread [Next in Thread>