kerneltest/e32test/defrag/t_pagemove.cia
author Mike Kinghan <mikek@symbian.org>
Thu, 25 Nov 2010 14:35:45 +0000
branchGCC_SURGE
changeset 305 1ba12ef4ef89
parent 228 ca2d72b7d125
permissions -rw-r--r--
Enhance the base/rom extension to generate the symbol file of the rom built. The symbol file is placed in epoc32/rom/<baseport_name>, along with the rom log and final oby file.

// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// e32test\defrag\t_pagemove.cia
// All rights reserved.
// This code is used to test code mofication while moving a page.
// 
//

#include <u32std.h>

#ifdef __CPU_ARM

/*
 * Assembly code to test pagemove while writing to code section. 
 * NOTE: Do not change instruction ordering without looking at t_pagemove.cpp 
 * Look at TestCodeModification and TestCodeAsync (TestCodeModificationAsync)
 */
__NAKED__ TInt TestCodeModFunc(void)
	{
	asm("mov     r0, #5 ");
	asm("b 1f");
	/* Need to put 3f here because this jump will move up by one instruction */
	asm("b 3f");
	asm("1: ");
	asm("mov     r0, #1 ");
	asm("b 3f");
	asm("2: ");
	asm("mov     r0, #2 ");
	asm("3: ");
	__JUMP(,lr);
	}


__NAKED__ TInt Increment(TInt)
	{
	asm("add r0, r0, #1 ");
	__JUMP(,lr);
	asm("_Z9Incrementi_end: ");
	}

__NAKED__ TUint Increment_Length()
	{
	asm("adr r0, _Z9Incrementi_end ");
	asm("adr r1, _Z9Incrementi ");
	asm("sub r0, r0, r1 ");
	__JUMP(,lr);
	}

__NAKED__ TInt Decrement(TInt)
	{
	asm("sub r0, r0, #1 ");
	__JUMP(,lr);
	asm("_Z9Decrementi_end: ");
	}

__NAKED__ TUint Decrement_Length()
	{
	asm("adr r0, _Z9Decrementi_end ");
	asm("adr r1, _Z9Decrementi ");
	asm("sub r0, r0, r1 ");
	__JUMP(,lr);
	}

#endif