1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/rm_debug/d_demand_paging.cia Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,55 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#include <u32std.h>
1.20 +
1.21 +// unused function that contains enough padding that the test function
1.22 +// RMDebugDemandPagingTest starts in a new page.
1.23 +__NAKED__ TInt RMDebugDemandPagingPaddingBefore()
1.24 + {
1.25 + asm("movs r2,r0");
1.26 + asm("adds r0,r2,r1");
1.27 + asm("bx lr");
1.28 + // add padding to make this function 4kb in size.
1.29 + // The 4084 corresponds to 2^12 (=4096) - 12,
1.30 + // the 12 being the total size of the movs, adds and bx instructions.
1.31 + asm(".space 4084");
1.32 + }
1.33 +
1.34 +// test function which is in a page by itself
1.35 +__NAKED__ TInt RMDebugDemandPagingTest()
1.36 + {
1.37 + asm("movs r2,r0");
1.38 + asm("adds r0,r2,r1");
1.39 + asm("bx lr");
1.40 + // add padding to make this function 4kb in size.
1.41 + // The 4084 corresponds to 2^12 (=4096) - 12,
1.42 + // the 12 being the total size of the movs, adds and bx instructions.
1.43 + asm(".space 4084");
1.44 + }
1.45 +
1.46 +// unused function that contains enough padding to ensure that no used code
1.47 +// is in the same page as RMDebugDemandPagingTest
1.48 +__NAKED__ TInt RMDebugDemandPagingPaddingAfter()
1.49 + {
1.50 + asm("movs r2,r0");
1.51 + asm("adds r0,r2,r1");
1.52 + asm("bx lr");
1.53 + // add padding to make this function 4kb in size.
1.54 + // The 4084 corresponds to 2^12 (=4096) - 12,
1.55 + // the 12 being the total size of the movs, adds and bx instructions.
1.56 + asm(".space 4084");
1.57 + }
1.58 +