baseport/syborg/specific/syborg.cia
author Peter Fordham <peter.fordham@gmail.com>
Mon, 31 May 2010 16:05:54 -0700
branchCompilerCompatibility
changeset 76 8e8bf3dcfd6b
parent 2 d55eb581a87c
permissions -rw-r--r--
Bug 1806 - Simplify/Remove use of inline assembler.

/*
* Copyright (c) 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:
*
*/

#include <syborg_priv.h>

//
//	Timer Access Functions
//

// Set the starting count value for a timer
EXPORT_C void __NAKED__ TSyborg::SetTimerLoad(TUint /*aTimerBase*/, TUint32 /*aValue*/)
{
  asm("str r1, [r0, #12]");
  asm("bx lr");
}

// Read the load register (starting count value)
EXPORT_C TUint __NAKED__ TSyborg::TimerLoad(TUint /*aTimerBase*/)
{
  asm("ldr r0, [r0, #12]");
  asm("bx lr");
}

// Read the actual timer value
EXPORT_C TUint __NAKED__ TSyborg::TimerValue(TUint /*aTimerBase*/)
{
	asm("ldr r0, [r0, #16]");
    asm("bx lr");
}

// Clear the timer interrupt by writing a value to Timer x clear register
// The written value doesn't matter as any value will clear the interrupt.
EXPORT_C void __NAKED__ TSyborg::ClearTimerInt(TUint /*aTimerBase*/)
{
	asm("mov r1, #1");	
	asm("str r1, [r0, #24]");
    asm("bx lr");
}