#1216 closed defect (fixed)

PAGESIZE/PAGE_SIZE/sysconf/getpagesize conflicts

Reported by: Ralf Corsepius Owned by: Joel Sherrill
Priority: normal Milestone: 4.8
Component: score Version: 4.7
Severity: critical Keywords:
Cc: chrisj@…, jwillemsen@…, sebastian.huber@…, gedare@… Blocked By:
Blocking:

Description

http://www.rtems.org/bugzilla/show_bug.cgi?id=1215

has caused me to investigate a bit on "page size" related things in RTEMS.

The result is close to a desaster:

  • limits.h contains a hardcoded #define PAGESIZE 1
  • sys/params.h contains some magic to

#define PAGE_SIZE ....
which, after some computation results into PAGE_SIZE 4096

According to POSIX PAGESIZE and PAGE_SIZE must be identical

  • RTEMS's getpagesize.c contains a hard-coded 4096
  • sysconf could easily return PAGE_SIZE, PAGESIZE, getpagesize() or else, but doesn't so, ATM.

As a temporary band-aid, I am proposing to (ASAP)
+ change getpagesize() to return PAGE_SIZE
+ let sysconf( _SC_PAGESIZE|_SC_PAGE_SIZE) return PAGE_SIZE

Fixing PAGESIZE also should be put "on schedule", but doing so would require some non-trivial surgery to newlib which needs to be tested carefully.
=> IMO, a post 4.7 release issue.

Related questions I can't answer "out-of-the-box"/without further investigations:

  • Does PAGESIZE|PAGE_SIZE have an impact on GCC?
  • Does RTEMS apply page-sizes? (AFAICT: no)

Attachments (4)

pagesize.diff (1.1 KB) - added by Chirayu Desai on Dec 5, 2013 at 2:45:52 PM.
diff
ChangeLog (164 bytes) - added by Chirayu Desai on Dec 5, 2013 at 2:50:35 PM.
ChangeLog?
0001-sptests-add-a-test-for-page-size.patch (5.5 KB) - added by Chirayu Desai on Dec 6, 2013 at 2:26:05 PM.
Testcase for pagesize
0001-sptests-add-a-test-for-page-size_v1.patch (5.0 KB) - added by Chirayu Desai on Dec 6, 2013 at 2:34:32 PM.
Testcase for pagesize (2)

Download all attachments as: .zip

Change History (9)

comment:1 Changed on Jan 30, 2007 at 1:28:46 PM by Ralf Corsepius

Cc: Chris Johns added

Changed on Dec 5, 2013 at 2:45:52 PM by Chirayu Desai

Attachment: pagesize.diff added

diff

Changed on Dec 5, 2013 at 2:50:35 PM by Chirayu Desai

Attachment: ChangeLog added

comment:2 Changed on Dec 5, 2013 at 2:54:09 PM by Sebastian Huber

Cc: Sebastian Huber added

comment:3 Changed on Dec 5, 2013 at 2:56:04 PM by Gedare Bloom

Cc: Gedare Bloom added

Changed on Dec 6, 2013 at 2:26:05 PM by Chirayu Desai

Testcase for pagesize

Changed on Dec 6, 2013 at 2:34:32 PM by Chirayu Desai

Testcase for pagesize (2)

comment:4 Changed on Dec 6, 2013 at 2:47:36 PM by Gedare Bloom

attachments.isobsolete: 01

comment:5 Changed on Dec 11, 2013 at 12:31:56 AM by Gedare Bloom

Resolution: fixed
Status: newclosed

Patch committed to newlib. Thanks

Note: See TracTickets for help on using tickets.