Opened on 01/30/07 at 12:17:48
Closed on 12/11/13 at 00:31:56
#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)
Change History (9)
comment:1 Changed on 01/30/07 at 13:28:46 by Ralf Corsepius
Cc: | Chris Johns added |
---|
Changed on 12/05/13 at 14:45:52 by Chirayu Desai
Attachment: | pagesize.diff added |
---|
comment:2 Changed on 12/05/13 at 14:54:09 by Sebastian Huber
Cc: | Sebastian Huber added |
---|
comment:3 Changed on 12/05/13 at 14:56:04 by Gedare Bloom
Cc: | Gedare Bloom added |
---|
Changed on 12/06/13 at 14:26:05 by Chirayu Desai
Attachment: | 0001-sptests-add-a-test-for-page-size.patch added |
---|
Testcase for pagesize
Changed on 12/06/13 at 14:34:32 by Chirayu Desai
Attachment: | 0001-sptests-add-a-test-for-page-size_v1.patch added |
---|
Testcase for pagesize (2)
comment:4 Changed on 12/06/13 at 14:47:36 by Gedare Bloom
attachments.isobsolete: | 0 → 1 |
---|
comment:5 Changed on 12/11/13 at 00:31:56 by Gedare Bloom
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch committed to newlib. Thanks
diff