Update contrib.
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
17 #include "plat_priv.h"
21 typedef TUint TCounter;
22 TUint32* TickCountPtr;
24 const TLinAddr NTimerQ_TimerAddress = (TLinAddr)&NTimerQ::TimerAddress;
26 __NAKED__ TCounter TIMER()
28 asm("mov eax, [%a0]": :"i"(&TickCountPtr));
30 asm("mov eax, [eax]");
33 asm("mov al, 0x80"); // channel 2 latch cmd
35 asm("in al, 0x42"); // get ls byte
37 asm("in al, 0x42"); // get ms byte
43 __NAKED__ void SetUpTimerChannel2()
48 asm("and al, 0xfc"); // disable speaker
49 asm("or al, 1"); // enable timer channel 2
52 asm("out 0x43, al"); // timer chan 2 mode 2
54 asm("out 0x42, al"); // initial count 0 = free running
57 asm("call %a0": :"i"(NTimerQ_TimerAddress));
58 asm("lea eax, [eax+%0]": :"i"_FOFF(NTimerQ,iMsCount));
59 asm("mov [%a0], eax": :"i"(&TickCountPtr));