os/kernelhwsrv/kerneltest/e32test/rm_debug/d_demand_paging.cia
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2007-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 //
    15 
    16 #include <u32std.h>
    17 
    18 // unused function that contains enough padding that the test function
    19 // RMDebugDemandPagingTest starts in a new page.
    20 __NAKED__ TInt RMDebugDemandPagingPaddingBefore()
    21 	{
    22 	asm("movs       r2,r0");
    23 	asm("adds       r0,r2,r1");
    24 	asm("bx         lr");
    25 	// add padding to make this function 4kb in size.
    26 	// The 4084 corresponds to 2^12 (=4096) - 12,
    27 	// the 12 being the total size of the movs, adds and bx instructions.
    28 	asm(".space     4084");
    29 	}
    30 
    31 // test function which is in a page by itself
    32 __NAKED__ TInt RMDebugDemandPagingTest()
    33 	{
    34 	asm("movs       r2,r0");
    35 	asm("adds       r0,r2,r1");
    36 	asm("bx         lr");
    37 	// add padding to make this function 4kb in size.
    38 	// The 4084 corresponds to 2^12 (=4096) - 12,
    39 	// the 12 being the total size of the movs, adds and bx instructions.
    40 	asm(".space     4084");
    41 	}
    42 
    43 // unused function that contains enough padding to ensure that no used code
    44 // is in the same page as RMDebugDemandPagingTest
    45 __NAKED__ TInt RMDebugDemandPagingPaddingAfter()
    46 	{
    47 	asm("movs       r2,r0");
    48 	asm("adds       r0,r2,r1");
    49 	asm("bx         lr");
    50 	// add padding to make this function 4kb in size.
    51 	// The 4084 corresponds to 2^12 (=4096) - 12,
    52 	// the 12 being the total size of the movs, adds and bx instructions.
    53 	asm(".space     4084");
    54 	}
    55