baseport/syborg/specific/syborg.cia
changeset 2 d55eb581a87c
parent 0 ffa851df0825
child 76 8e8bf3dcfd6b
child 79 80387fbc46c5
equal deleted inserted replaced
1:2fb8b9db1c86 2:d55eb581a87c
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #include <syborg_priv.h>
       
    19 
       
    20 //
       
    21 //	Timer Access Functions
       
    22 //
       
    23 
       
    24 // Set the starting count value for a timer
       
    25 EXPORT_C void __NAKED__ TSyborg::SetTimerLoad(TUint /*aTimerBase*/, TUint32 /*aValue*/)
       
    26 {
       
    27   asm("str r1, [r0, #12]");
       
    28   asm("bx lr");
       
    29 }
       
    30 
       
    31 // Read the load register (starting count value)
       
    32 EXPORT_C TUint __NAKED__ TSyborg::TimerLoad(TUint /*aTimerBase*/)
       
    33 {
       
    34   asm("ldr r0, [r0, #12]");
       
    35   asm("bx lr");
       
    36 }
       
    37 
       
    38 // Read the actual timer value
       
    39 EXPORT_C TUint __NAKED__ TSyborg::TimerValue(TUint /*aTimerBase*/)
       
    40 {
       
    41 	asm("ldr r0, [r0, #16]");
       
    42     asm("bx lr");
       
    43 }
       
    44 
       
    45 // Clear the timer interrupt by writing a value to Timer x clear register
       
    46 // The written value doesn't matter as any value will clear the interrupt.
       
    47 EXPORT_C void __NAKED__ TSyborg::ClearTimerInt(TUint /*aTimerBase*/)
       
    48 {
       
    49 	asm("mov r1, #1");	
       
    50 	asm("str r1, [r0, #24]");
       
    51     asm("bx lr");
       
    52 }
       
    53 
       
    54 //
       
    55 //Interrupt Controller Acces Functions
       
    56 //
       
    57 
       
    58 // Enable specified motherboard Int on either the PIC/SIC
       
    59 EXPORT_C void __NAKED__ TSyborg::EnableInt(TUint /*anId*/)
       
    60 {
       
    61   asm("ldr r1, __KHwInt");
       
    62   asm("str r0, [r1, #20]");
       
    63   asm("bx lr");
       
    64 }
       
    65 
       
    66 // Disable specified motherboard Int on either the PIC/SIC
       
    67 EXPORT_C void __NAKED__ TSyborg::DisableInt(TUint /*anId*/)
       
    68 {
       
    69   asm("ldr r1, __KHwInt");
       
    70   asm("str r0, [r1, #16]");
       
    71   asm("bx lr");
       
    72 	
       
    73 	asm("__KHwInt:");
       
    74 	asm(".word %a0" : : "i" (TInt)(KHwBaseSic));
       
    75 }