LTP test mmap01 fails on sparc with:

mmap01      1  FAIL  :  mmap() Failed on mmapfile, errno=22

because the address passed in is only page aligned:

        /*
         * Initialize addr to align with the first page boundary above the
         * break address of the process.
         */
        addr = (void *) (((intptr_t)sbrk(0) + (page_sz - 1)) & ~(page_sz - 1));
...
        addr = mmap(addr, page_sz, PROT_READ | PROT_WRITE,
                    MAP_FILE|MAP_SHARED|MAP_FIXED, fildes, 0);

The address should be aligned to the value of SHMLBA as defined in
asm/shmparam.h.
See Documentation/cachetlb.txt for the explanation behind this.
For most architectures this value is the page size, but not all.

Unfortunately asm/shmparam.h is not suitable for inclusion in user space
programs. I looked at sysconf(LEVEL1_DCACHE_SIZE), but that returns 0 on
sparc.
Is there another solution other than hardcoding the exceptions in
architecture specific code?

Thanks,
Martin

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to