On Wednesday 14 May 2008, Subrata Modak wrote:
> On Wed, 2008-05-14 at 16:26 +0800, Roy Lee wrote:
> > Hi,
> >
> > Is it necessary for the following testcases to attach their shm to a
> > 'specific address' rather than NULL?
> >
> > testcases/kernel/mem/shmt02.c
> > testcases/kernel/mem/shmt04.c
> > testcases/kernel/mem/shmt05.c
> > testcases/kernel/mem/shmt06.c
> > testcases/kernel/mem/shmt07.c
>
> I hope you are talking about:
>
> ltp/testcases/kernel/mem/shmt
>
> series of test cases. Mike did some cleanup on them => Tue Mar 13
> 20:15:16 2007 UTC. Also, i saw some hppa support added by Helge Deller.
Hello Roy,
Yes, I added the HPPA/parisc support and wondered myself.
I think in a few tests all architectures could use NULL.
Let's see:
shm02.c:
#if defined (__ia64__) || defined (__ARM_ARCH_4T__) || defined(__hppa__)
cp = (char *)shmat(shmid, (void *)NULL, 0);
#else
cp = (char *)shmat(shmid, (void *)0x80000, 0);
#endif
the test checks if shmat() works in general.
For i386 it's tried to attach memory at 0x80000.
This only works sucessfully, if the executable hasn't mapped memory there yet
(e.g. code/text, data or stack).
On HPPA the 0x80000 is used already by code or data segments, which is why on
HPPA I choosed NULL (=> map to any address).
I assume, that all architectures could use NULL here without breaking the
testcase.
shm04.c:
-> I think all architectures should use NULL here.
shm05.c:
A little bit more complicated.
Test is, that the second shared mem area should overlap with the first memory
area.
This means:
-> I think all architectures should use NULL in the first shmat() call
-> then the second shmat() should map e.g. at (cp+PAGESIZE) [cp+PAGESIZE
should be smaller than SIZE]
(One note: HPPA can only map at specific page addresses/offsets. E.g. mapping
to cp+2048 won't work and I assume this is true for IA64 as well..)
shm06.c:
Test is about, that shmat() can map at different(!) addresses.
Pretty much platform dependend. I wouldn't touch the current code...
shm07.c:
-> I think every architecture could use NULL here, without breaking the logic
of the test.
Helge
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list