|
1 // Copyright (c) 2008-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // e32\nkernsmp\arm\ncsched.cpp |
|
15 // |
|
16 // |
|
17 |
|
18 // NThreadBase member data |
|
19 #define __INCLUDE_NTHREADBASE_DEFINES__ |
|
20 |
|
21 #include <arm.h> |
|
22 |
|
23 extern "C" void NewThreadTrace(NThread* a) |
|
24 { |
|
25 __ACQUIRE_BTRACE_LOCK(); |
|
26 BTraceData.iHandler(BTRACE_HEADER_C(4,BTrace::ECpuUsage,BTrace::ENewThreadContext),0,(TUint32)a,0,0,0,0,0); |
|
27 __RELEASE_BTRACE_LOCK(); |
|
28 } |
|
29 |
|
30 extern "C" void __DebugMsgSendReschedIPI(int a) |
|
31 { |
|
32 __KTRACE_OPT(KSCHED2,DEBUGPRINT("@%d",a)); |
|
33 } |
|
34 |
|
35 extern "C" void __DebugMsgSendReschedIPIs(int a) |
|
36 { |
|
37 __KTRACE_OPT(KSCHED2,DEBUGPRINT("@%02x",a)); |
|
38 } |
|
39 |
|
40 extern "C" void __DebugMsgSendReschedIPIAndWait(int a) |
|
41 { |
|
42 __KTRACE_OPT(KSCHED2,DEBUGPRINT("@@%d",a)); |
|
43 } |
|
44 |
|
45 #ifdef __FAST_SEM_MACHINE_CODED__ |
|
46 extern "C" void PanicFastSemaphoreWait() |
|
47 { |
|
48 FAULT(); |
|
49 } |
|
50 #endif |
|
51 |
|
52 #ifdef BTRACE_CPU_USAGE |
|
53 extern "C" void btrace_irq_entry(TInt aVector) |
|
54 { |
|
55 BTrace4(BTrace::ECpuUsage, BTrace::EIrqStart, aVector); |
|
56 } |
|
57 |
|
58 extern "C" void btrace_fiq_entry() |
|
59 { |
|
60 BTrace0(BTrace::ECpuUsage, BTrace::EFiqStart); |
|
61 } |
|
62 |
|
63 extern "C" void btrace_irq_exit() |
|
64 { |
|
65 BTrace0(BTrace::ECpuUsage, BTrace::EIrqEnd); |
|
66 } |
|
67 |
|
68 extern "C" void btrace_fiq_exit() |
|
69 { |
|
70 BTrace0(BTrace::ECpuUsage, BTrace::EFiqEnd); |
|
71 } |
|
72 #endif |
|
73 |
|
74 extern "C" void __DebugMsgIrq(TUint a) |
|
75 { |
|
76 if ((a & 0x3ffu) >= 0x20u) |
|
77 return; |
|
78 __KTRACE_OPT(KSCHED2,DEBUGPRINT("!%x",a)); |
|
79 } |
|
80 |
|
81 |
|
82 #ifdef _DEBUG |
|
83 extern "C" void __DebugMsgFSWait(NFastSemaphore* a) |
|
84 { |
|
85 CHECK_PRECONDITIONS(MASK_KERNEL_LOCKED|MASK_NO_FAST_MUTEX,"NFastSemaphore::Wait"); |
|
86 NThreadBase* pC = NCurrentThreadL(); |
|
87 __ASSERT_WITH_MESSAGE_ALWAYS(pC==a->iOwningThread,"The calling thread must own the semaphore","NFastSemaphore::Wait"); |
|
88 } |
|
89 |
|
90 extern "C" void __DebugMsgNKFSWait(NFastSemaphore* a) |
|
91 { |
|
92 __KTRACE_OPT(KNKERN,DEBUGPRINT("NFSW %m",a)); |
|
93 NThreadBase* pC = NCurrentThread(); |
|
94 __ASSERT_WITH_MESSAGE_ALWAYS(pC==a->iOwningThread,"The calling thread must own the semaphore","NKern::FSWait"); |
|
95 } |
|
96 |
|
97 extern "C" void __DebugMsgWFAR() |
|
98 { |
|
99 CHECK_PRECONDITIONS(MASK_THREAD_STANDARD,"NKern::WaitForAnyRequest"); |
|
100 __KTRACE_OPT(KNKERN,DEBUGPRINT("WfAR")); |
|
101 } |
|
102 |
|
103 extern "C" void __DebugMsgFSSignal(NFastSemaphore* /*a*/) |
|
104 { |
|
105 CHECK_PRECONDITIONS(MASK_KERNEL_LOCKED|MASK_NOT_ISR,"NFastSemaphore::Signal"); |
|
106 } |
|
107 |
|
108 extern "C" void __DebugMsgFSSignalN(NFastSemaphore* /*a*/, TInt aCount) |
|
109 { |
|
110 CHECK_PRECONDITIONS(MASK_KERNEL_LOCKED|MASK_NOT_ISR,"NFastSemaphore::SignalN"); |
|
111 __NK_ASSERT_DEBUG(aCount>=0); |
|
112 } |
|
113 |
|
114 extern "C" void __DebugMsgNKThreadRequestSignalN(NThread* /*aThread*/, TInt aCount) |
|
115 { |
|
116 __ASSERT_WITH_MESSAGE_DEBUG(aCount>=0, "aCount>=0", "NKern::ThreadRequestSignal"); |
|
117 } |
|
118 |
|
119 extern "C" void __DebugMsgNKThreadRequestSignal(NThread* /*aThread*/) |
|
120 { |
|
121 } |
|
122 |
|
123 extern "C" void __DebugMsgNKFSSignal(NFastSemaphore* a) |
|
124 { |
|
125 CHECK_PRECONDITIONS(MASK_INTERRUPTS_ENABLED|MASK_NOT_ISR,"NKern::FSSignal(NFastSemaphore*)"); |
|
126 __KTRACE_OPT(KNKERN,DEBUGPRINT("NFSS %m",a)); |
|
127 } |
|
128 |
|
129 extern "C" void __DebugMsgNKFSSignalN(NFastSemaphore* a, TInt aCount) |
|
130 { |
|
131 CHECK_PRECONDITIONS(MASK_INTERRUPTS_ENABLED|MASK_NOT_ISR,"NKern::FSSignalN(NFastSemaphore*, TInt)"); |
|
132 __KTRACE_OPT(KNKERN,DEBUGPRINT("NFSSN %m %d",a,aCount)); |
|
133 __NK_ASSERT_DEBUG(aCount>=0); |
|
134 } |
|
135 |
|
136 extern "C" void __DebugMsgFMSignal(NFastMutex* /*a*/) |
|
137 { |
|
138 CHECK_PRECONDITIONS(MASK_KERNEL_LOCKED,"NFastMutex::Signal"); |
|
139 } |
|
140 |
|
141 extern "C" void __DebugMsgNKFMWait(NFastMutex* a) |
|
142 { |
|
143 __KTRACE_OPT(KNKERN,DEBUGPRINT("NFMW %M", a)); |
|
144 CHECK_PRECONDITIONS(MASK_THREAD_STANDARD,"NKern::FMWait"); |
|
145 } |
|
146 |
|
147 extern "C" void __DebugMsgNKFMSignal(NFastMutex* a) |
|
148 { |
|
149 __KTRACE_OPT(KNKERN,DEBUGPRINT("NFMS %M", a)); |
|
150 CHECK_PRECONDITIONS(MASK_KERNEL_UNLOCKED | MASK_INTERRUPTS_ENABLED | MASK_NOT_ISR | MASK_NOT_IDFC, "NKern::FMSignal"); |
|
151 __ASSERT_WITH_MESSAGE_DEBUG(a->HeldByCurrentThread(),"The calling thread holds the mutex","NKern::FMSignal"); |
|
152 } |
|
153 |
|
154 extern "C" void __DebugMsgNKFMFlash(NFastMutex* a) |
|
155 { |
|
156 CHECK_PRECONDITIONS(MASK_KERNEL_UNLOCKED | MASK_INTERRUPTS_ENABLED | MASK_NOT_ISR | MASK_NOT_IDFC, "NKern::FMFlash"); |
|
157 __ASSERT_WITH_MESSAGE_DEBUG(a->HeldByCurrentThread(),"The calling thread holds the mutex","NKern::FMFlash"); |
|
158 } |
|
159 |
|
160 #endif |
|
161 |