kerneltest/e32test/mmu/t_wsd_dl2.cpp
branchRCL_3
changeset 21 e7d2d738d3c2
equal deleted inserted replaced
20:597aaf25e343 21:e7d2d738d3c2
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // e32test\mmu\t_wsd_dl2.cpp
       
    15 // 
       
    16 
       
    17 // MMH file will define	T_WSD_DL2
       
    18 #include "t_wsd_tst.h"
       
    19 
       
    20 // Ordinal 1
       
    21 EXPORT_C void** GetAddressOfDataProxy(TInt& aSize, void*& aCodeAddr, void*& aDataAddr)
       
    22 	{
       
    23 	return GetAddressOfData(aSize, aCodeAddr, aDataAddr);
       
    24 	}
       
    25 
       
    26 // Ordinal 2
       
    27 EXPORT_C TInt CheckWritableStaticData(void)
       
    28 	{
       
    29 	RDebug::Printf("CheckWritableStaticData: start");
       
    30 	TInt err = KErrNone;
       
    31 	TInt size;
       
    32 	void* codeAddr;
       
    33 	void* dataAddr;
       
    34 	const void*** dataPtrPtr = (const void***)GetAddressOfData(size, codeAddr, dataAddr);
       
    35 
       
    36 	RDebug::Printf("CheckWritableStaticData: size %d, codeAddr %08x, dataAddr %08x",
       
    37 		size, codeAddr, dataAddr);
       
    38 	RDebug::Printf("CheckWritableStaticData: dataPtrPtr %08x, PointerToStaticData is at %08x",
       
    39 		dataPtrPtr, &PointerToStaticData);
       
    40 
       
    41 	if (dataPtrPtr != (const void***)&PointerToStaticData)
       
    42 		err = KErrGeneral;
       
    43 	const void** p1 = *dataPtrPtr;
       
    44 	RDebug::Printf("CheckWritableStaticData: *dataPtrPtr %08x", p1);
       
    45 	const void* const* p2 = PointerToStaticData;
       
    46 	RDebug::Printf("CheckWritableStaticData: PointerToStaticData %08x", p2);
       
    47 	if (p1 != (const void**)p2)
       
    48 		err = KErrGeneral;
       
    49 	if (p1 != (const void**)dataAddr)
       
    50 		err = KErrGeneral;
       
    51 
       
    52 	RDebug::Printf("CheckWritableStaticData: TestDataSize is at %08x", &TestDataSize);
       
    53 	TInt sz = TestDataSize;
       
    54 	RDebug::Printf("CheckWritableStaticData: TestDataSize is %d", sz);
       
    55 	if (sz != size)
       
    56 		err = KErrGeneral;
       
    57 
       
    58 	void** p3 = WritableTestData;
       
    59 	void** p4 = PointerToWritableData;
       
    60 	if (p3 != p4)
       
    61 		err = KErrGeneral;
       
    62 
       
    63 	return err;
       
    64 	}
       
    65