Update contrib.
1 // Copyright (c) 2004-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\debug\d_eventtracker.cia
19 #include "d_eventtracker.h"
21 //////////////////////////////////////////////////////////////////////////////
23 // CIA symbol macros for Gcc98r2
24 #if defined(__GCC32__)
26 #define CSM_ZN13DEventTracker11HandleEventE12TKernelEventPvS1 " HandleEvent__13DEventTracker12TKernelEventPvT2"
28 // CIA symbol macros for RVCT
29 #elif defined(__ARMCC__)
31 #define CSM_ZN13DEventTracker11HandleEventE12TKernelEventPvS1 " __cpp(DEventTracker::HandleEvent)"
33 // CIA symbol macros for EABI assemblers
36 #define CSM_ZN13DEventTracker11HandleEventE12TKernelEventPvS1 " _ZN13DEventTracker11HandleEventE12TKernelEventPvS1_"
40 //////////////////////////////////////////////////////////////////////////////
42 __NAKED__ void DEventTracker::BranchToEventHandler()
44 // Breakpoint to call our event handler
47 asm("breakstart: "); // start of breakpoint.
48 asm("mov r3, r2"); // set up regs for call to our handler...
51 asm("ldr r0, __TheEventTracker "); // fiddle this pointer
52 asm("ldr r0, [r0] "); // load from TheEventTracker
53 asm("ldr pc, [pc, #-4]" ); // do an absolute jump...
54 asm(".word " CSM_ZN13DEventTracker11HandleEventE12TKernelEventPvS1 ); // to DEventTracker::HandleEvent
55 asm("__TheEventTracker: "); // address of global variable:
56 asm(".word %a0" : : "i" (&TheEventTracker)); // TheEventTracker
57 asm("breakend: "); // end of breakpoint.
60 __NAKED__ TUint DEventTracker::BreakPointSize()
65 asm("ldr r0, = breakend - breakstart");
69 __NAKED__ TUint DEventTracker::DummyHandler(TKernelEvent /*aEvent*/, TAny* /*a1*/, TAny* /*a2*/)
71 // Debugger breakpoint-able callback. Will be copied into RAM
75 // r0=aEvent, r1=a1, r2=a2
77 asm("dummystart: "); // start of fn.
78 asm("nop"); // breakpoint-able instruction for the debugger to replace
79 asm("nop"); // landing zone
80 asm("nop"); // landing zone
81 asm("nop"); // landing zone
82 asm("nop"); // landing zone
83 asm("nop"); // landing zone
84 asm("nop"); // landing zone
85 asm("mov r0, #%a0" : : "i" (DKernelEventHandler::ERunNext)); // return value
86 __JUMP(,lr); // return
87 asm("dummyend:"); // end of fn.
90 __NAKED__ TUint DEventTracker::DummyHandlerSize()
92 // Size of debugger breakpoint-able callback.
95 asm("ldr r0, = dummyend - dummystart");