This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: [rtems] PAGESIZE versus PAGE_SIZE
- From: "Howland Craig D (Craig)" <howland at LGSInnovations dot com>
- To: "Joel Sherrill" <joel dot sherrill at oarcorp dot com>, <newlib at sources dot redhat dot com>, "Ralf Corsepius" <ralf dot corsepius at rtems dot org>
- Date: Thu, 20 Nov 2008 15:23:34 -0500
- Subject: RE: [rtems] PAGESIZE versus PAGE_SIZE
- References: <4925BCF5.8090901@oarcorp.com>
OpenGroup clearly says that PAGESIZE and PAGE_SIZE belong in <limits.h>
(as an extension to the C standard). Therefore PAGE_SIZE should somehow
manage to end up there. I'd think that including machine/param.h brings
in too much extraneous stuff for limits.h. How about moving what's
appropriate from libc/sys/rtems/machine/param.h to
libc/sys/rtems/machine/limits.h (which exists, but is currently empty)?
Then just make sure that libc/sys/rtems/include/limits.h includes
libc/sys/rtems/machine/limits.h (which does not appear to be the case
at the moment).
Craig
-----Original Message-----
From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org]
On Behalf Of Joel Sherrill
Sent: Thursday, November 20, 2008 2:40 PM
To: newlib@sources.redhat.com; Ralf Corsepius
Subject: [rtems] PAGESIZE versus PAGE_SIZE
Hi,
Going through RTEMS Bugzilla, I came across an
old PR about PAGESIZE and PAGE_SIZE having
different values for RTEMS. RTEMS does not have
virtual memory so the actual value doesn't mean
much.
As best I can tell it is easy to fix since both
are in RTEMS specific areas of newlib. It is
just a matter of picking which one to change.
And is it possible/desirable for limits.h or
param.h to include the other?
PAGESIZE in defined in newlib/libc/sys/rtems/include/limits.h
#define PAGESIZE 1
NOTE: Acceptable per Open Group but these are supposed to
match.
PAGE_SIZE is defined in newlib/libc/sys/rtems/machine/param.h.
#define PAGE_SHIFT 12 /* LOG2(PAGE_SIZE) */
#define PAGE_SIZE (1<<PAGE_SHIFT) /* bytes/page */
The dirtiest solution is to fix limits.h to have 4096
and add a comment that it must match the one in param.h.
What is the right thing to do to fix this?
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985