author | hgs |
Fri, 09 Jul 2010 13:13:20 +0100 | |
changeset 199 | 189ece41fa29 |
parent 177 | a232af6b0b1f |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 2007-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\include\nkernsmp\arm\nk_plat.h |
|
15 |
// |
|
16 |
// WARNING: This file contains some APIs which are internal and are subject |
|
17 |
// to change without notice. Such APIs should therefore not be used |
|
18 |
// outside the Kernel and Hardware Services package. |
|
19 |
// |
|
20 |
||
21 |
/** |
|
22 |
@file |
|
23 |
@internalComponent |
|
24 |
*/ |
|
25 |
||
26 |
#ifndef __NK_ARM_H__ |
|
27 |
#define __NK_ARM_H__ |
|
28 |
#include <nk_cpu.h> |
|
29 |
||
30 |
// These macros are intended for Symbian use only. |
|
31 |
// It may not be possible to build the kernel if any of these macros are undefined |
|
32 |
//#define __SCHEDULER_MACHINE_CODED__ |
|
33 |
//#define __DFC_MACHINE_CODED__ |
|
34 |
//#define __MSTIM_MACHINE_CODED__ |
|
35 |
#define __PRI_LIST_MACHINE_CODED__ |
|
36 |
#define __FAST_SEM_MACHINE_CODED__ |
|
37 |
#define __FAST_MUTEX_MACHINE_CODED__ |
|
38 |
#define __NTHREAD_WAITSTATE_MACHINE_CODED__ |
|
39 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
40 |
class TSubScheduler; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
41 |
class TScheduler; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
42 |
struct SFullArmRegSet; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
43 |
struct ArmScu; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
44 |
struct GicDistributor; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
45 |
struct GicCpuIfc; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
46 |
struct ArmLocalTimer; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
47 |
struct ArmGlobalTimer; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
48 |
|
0 | 49 |
// TSubScheduler member data |
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
50 |
struct TSubSchedulerX |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
51 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
52 |
TUint32 iSSXP[3]; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
53 |
ArmGlobalTimer* iGlobalTimerAddr; // Address of global timer registers (also in TScheduler) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
54 |
ArmScu* iScuAddr; // Address of SCU (also in TScheduler) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
55 |
GicDistributor* iGicDistAddr; // Address of GIC Distributor (also in TScheduler) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
56 |
GicCpuIfc* iGicCpuIfcAddr; // Address of GIC CPU Interface (also in TScheduler) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
57 |
ArmLocalTimer* iLocalTimerAddr; // Address of local timer registers (also in TScheduler) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
58 |
volatile TUint32 iIrqCount; // count of interrupts handled |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
59 |
volatile TInt iIrqNestCount; // IRQ nest count for this CPU (starts at -1) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
60 |
TAny* iExcInfo; // pointer to exception info for crash debugger |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
61 |
volatile TInt iCrashState; // 0=normal, 1=this CPU faulted, 2=this CPU has received an NMI and halted |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
62 |
union { |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
63 |
TLinAddr iAbtStackTop; // Top of ABT stack for this CPU, also used to point to SFullArmRegSet |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
64 |
SFullArmRegSet* iRegs; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
65 |
}; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
66 |
TLinAddr iUndStackTop; // Top of UND stack for this CPU |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
67 |
TLinAddr iFiqStackTop; // Top of FIQ stack for this CPU |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
68 |
TLinAddr iIrqStackTop; // Top of IRQ stack for this CPU |
177 | 69 |
SRatioInv* volatile iNewCpuFreqRI; // set when CPU frequency has been changed |
70 |
SRatioInv* volatile iNewTimerFreqRI; // set when CPU local timer frequency has been changed |
|
71 |
SRatioInv iCpuFreqRI; // Ratio of CPU frequency to maximum possible CPU frequency |
|
72 |
SRatioInv iTimerFreqRI; // Ratio of CPU local timer frequency to maximum possible |
|
0 | 73 |
|
177 | 74 |
TUint32 iSSXP2[36]; |
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
75 |
TUint64 iSSXP3; // one 64 bit value to guarantee alignment |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
76 |
}; |
0 | 77 |
|
78 |
// TScheduler member data |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
79 |
struct TSchedulerX |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
80 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
81 |
TUint64 iTimerMax; // Maximum per-CPU timer frequency (after prescaling) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
82 |
TUint32 iSXP[1]; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
83 |
ArmGlobalTimer* iGlobalTimerAddr; // Address of global timer registers (also in TSubScheduler) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
84 |
ArmScu* iScuAddr; // Address of SCU (also in TSubScheduler) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
85 |
GicDistributor* iGicDistAddr; // Address of GIC Distributor (also in TSubScheduler) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
86 |
GicCpuIfc* iGicCpuIfcAddr; // Address of GIC CPU Interface (also in TSubScheduler) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
87 |
ArmLocalTimer* iLocalTimerAddr; // Address of local timer registers (also in TSubScheduler) |
177 | 88 |
|
89 |
SRatioInv iGTimerFreqRI; // ratio of global timer frequency to maximum possible |
|
90 |
TUint64 iCount0; // global timer count at last frequency change |
|
91 |
TUint64 iTimestamp0; // timestamp at last frequency change |
|
92 |
||
93 |
TUint32 iSXP2[16]; |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
94 |
}; |
0 | 95 |
|
96 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
97 |
#define RESCHED_IPI_VECTOR 0x00 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
98 |
#define GENERIC_IPI_VECTOR 0x01 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
99 |
#define TRANSFERRED_IRQ_VECTOR 0x02 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
100 |
#define CRASH_IPI_VECTOR 0x03 // would really like this to be a FIQ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
101 |
#define BOOT_IPI_VECTOR 0x04 // used during boot to handshake with APs |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
102 |
#define INDIRECT_POWERDOWN_IPI_VECTOR 0x04 // used to trigger core power down |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
103 |
#define RESERVED_IPI_VECTOR_1 0x05 // reserved for future kernel functionality |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
104 |
#define RESERVED_IPI_VECTOR_2 0x06 // reserved for future kernel functionality |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
105 |
#define IDLE_WAKEUP_IPI_VECTOR 0x07 // for use of Idle handler/Wakeup handler |
0 | 106 |
|
107 |
#if defined(__CPU_ARM11MP__) |
|
108 |
#define TIMESLICE_VECTOR 0x1D // vector 29 is per-CPU timer interrupt |
|
109 |
// vector 30 is per-CPU Watchdog timer when not in watchdog mode |
|
110 |
// vector 31 is external nIRQ local interrupt pin |
|
111 |
#elif defined(__CPU_CORTEX_A9__) |
|
112 |
#define TIMESLICE_VECTOR 0x1D // vector 29 is per-CPU timer interrupt |
|
113 |
// vector 30 is per-CPU Watchdog timer when not in watchdog mode |
|
114 |
#else |
|
115 |
#error TIMESLICE_VECTOR not defined |
|
116 |
#endif |
|
117 |
||
118 |
||
119 |
//extern "C" TSubScheduler* SubSchedulerLookupTable[256]; // look up subscheduler from APIC ID |
|
120 |
||
121 |
const TUint32 KNThreadContextFlagThumbBit0=1; |
|
122 |
||
123 |
/** Registers saved by the scheduler |
|
124 |
||
125 |
Let's just have the same stack layout for all CPUs shall we? |
|
126 |
TEEHBR, FpExc may not be used but leave space on the stack for them. |
|
127 |
||
128 |
@internalComponent |
|
129 |
*/ |
|
130 |
struct SThreadReschedStack |
|
131 |
{ |
|
132 |
TUint32 iFpExc; // VFP enable |
|
133 |
TUint32 iCar; // coprocessor access register |
|
134 |
TUint32 iTEEHBR; // Thumb2-EE Handler Base |
|
135 |
TUint32 iRWROTID; // User RO Thread ID |
|
136 |
TUint32 iRWRWTID; // User RW Thread ID |
|
137 |
TUint32 iDacr; // domain access control |
|
138 |
TUint32 iSpare; |
|
139 |
TUint32 iSpsrSvc; |
|
140 |
TUint32 iSPRschdFlg; // Stack pointer plus flag indicating reschedule occurred |
|
141 |
TUint32 iR15; // return address from Reschedule() |
|
142 |
}; |
|
143 |
||
144 |
/** Registers saved on any exception, interrupt or system call |
|
145 |
||
146 |
@internalComponent |
|
147 |
*/ |
|
148 |
struct SThreadExcStack |
|
149 |
{ |
|
150 |
enum TType |
|
151 |
{ |
|
152 |
EPrefetch =0, // prefetch abort |
|
153 |
EData =1, // data abort |
|
154 |
EUndef =2, // undefined instruction |
|
155 |
EIrq =3, // IRQ interrupt |
|
156 |
EFiq =4, // FIQ interrupt |
|
157 |
ESvc =5, // SWI |
|
158 |
EInit =6, // Thread has never run |
|
159 |
EStub =7, // Stub indicating parameter block still on stack |
|
160 |
}; |
|
161 |
||
162 |
TUint32 iR0; |
|
163 |
TUint32 iR1; |
|
164 |
TUint32 iR2; |
|
165 |
TUint32 iR3; |
|
166 |
TUint32 iR4; |
|
167 |
TUint32 iR5; |
|
168 |
TUint32 iR6; |
|
169 |
TUint32 iR7; |
|
170 |
TUint32 iR8; |
|
171 |
TUint32 iR9; |
|
172 |
TUint32 iR10; |
|
173 |
TUint32 iR11; |
|
174 |
TUint32 iR12; |
|
175 |
TUint32 iR13usr; // always user mode R13 |
|
176 |
TUint32 iR14usr; // always user mode R14 |
|
177 |
TUint32 iExcCode; |
|
178 |
TUint32 iR15; // return address |
|
179 |
TUint32 iCPSR; // return CPSR |
|
180 |
}; |
|
181 |
||
182 |
/** |
|
183 |
@internalComponent |
|
184 |
*/ |
|
185 |
struct SThreadStackStub |
|
186 |
{ |
|
187 |
TLinAddr iPBlock; // pointer to parameter block |
|
188 |
TUint32 iExcCode; // always EStub |
|
189 |
TUint32 iR15; // unused |
|
190 |
TUint32 iCPSR; // unused |
|
191 |
}; |
|
192 |
||
193 |
/** |
|
194 |
@internalComponent |
|
195 |
*/ |
|
196 |
struct SThreadInitStack |
|
197 |
{ |
|
198 |
SThreadReschedStack iR; |
|
199 |
SThreadExcStack iX; |
|
200 |
}; |
|
201 |
||
202 |
||
203 |
/** |
|
204 |
@internalComponent |
|
205 |
*/ |
|
206 |
struct SThreadIrqStack |
|
207 |
{ |
|
208 |
SThreadReschedStack iR; |
|
209 |
TUint32 iUMGSave; // User memory guard state (if active) |
|
210 |
TUint32 iR14svc; |
|
211 |
SThreadExcStack iX; |
|
212 |
}; |
|
213 |
||
214 |
||
215 |
class TArmContextElement; |
|
216 |
class TArmRegSet; |
|
217 |
||
218 |
/** ARM-specific part of the nano-thread abstraction. |
|
219 |
@internalComponent |
|
220 |
*/ |
|
221 |
class NThread : public NThreadBase |
|
222 |
{ |
|
223 |
public: |
|
224 |
TInt Create(SNThreadCreateInfo& aInfo, TBool aInitial); |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
225 |
void Stillborn(); |
0 | 226 |
|
227 |
/** Value indicating what event caused thread to enter privileged mode. |
|
228 |
@publishedPartner |
|
229 |
@released |
|
230 |
*/ |
|
231 |
enum TUserContextType |
|
232 |
{ |
|
233 |
EContextNone=0, /**< Thread has no user context */ |
|
234 |
EContextException=1, /**< Hardware exception while in user mode */ |
|
235 |
EContextUndefined, |
|
236 |
EContextUserInterrupt, /**< Preempted by interrupt taken in user mode */ |
|
237 |
EContextUserInterruptDied, /**< Killed while preempted by interrupt taken in user mode */ // NOT USED |
|
238 |
EContextSvsrInterrupt1, /**< Preempted by interrupt taken in executive call handler */ |
|
239 |
EContextSvsrInterrupt1Died, /**< Killed while preempted by interrupt taken in executive call handler */ // NOT USED |
|
240 |
EContextSvsrInterrupt2, /**< Preempted by interrupt taken in executive call handler */ // NOT USED |
|
241 |
EContextSvsrInterrupt2Died, /**< Killed while preempted by interrupt taken in executive call handler */ // NOT USED |
|
242 |
EContextWFAR, /**< Blocked on User::WaitForAnyRequest() */ |
|
243 |
EContextWFARDied, /**< Killed while blocked on User::WaitForAnyRequest() */ // NOT USED |
|
244 |
EContextExec, /**< Slow executive call */ |
|
245 |
EContextKernel, /**< Kernel side context (for kernel threads) */ |
|
246 |
EContextKernel1, /**< Kernel side context (for kernel threads) (NKern::Unlock, NKern::PreemptionPoint) */ |
|
247 |
EContextKernel2, /**< Kernel side context (for kernel threads) (NKern::FSWait, NKern::WaitForAnyRequest) */ |
|
248 |
EContextKernel3, /**< Kernel side context (for kernel threads) (Interrupt) */ |
|
249 |
EContextKernel4, /**< Kernel side context (for kernel threads) (Exec::WaitForAnyRequest) */ |
|
250 |
}; |
|
251 |
||
252 |
IMPORT_C static const TArmContextElement* const* UserContextTables(); |
|
253 |
IMPORT_C TUserContextType UserContextType(); |
|
254 |
void GetUserContext(TArmRegSet& aContext, TUint32& aAvailRegistersMask); |
|
255 |
void SetUserContext(const TArmRegSet& aContext, TUint32& aRegMask); |
|
256 |
void GetSystemContext(TArmRegSet& aContext, TUint32& aAvailRegistersMask); |
|
257 |
||
258 |
TUint32 Dacr(); |
|
259 |
void SetDacr(TUint32 aDacr); |
|
260 |
TUint32 ModifyDacr(TUint32 aClearMask, TUint32 aSetMask); |
|
261 |
||
262 |
void SetCar(TUint32 aDacr); |
|
263 |
IMPORT_C TUint32 Car(); |
|
264 |
IMPORT_C TUint32 ModifyCar(TUint32 aClearMask, TUint32 aSetMask); |
|
265 |
||
266 |
#ifdef __CPU_HAS_VFP |
|
267 |
void SetFpExc(TUint32 aDacr); |
|
268 |
#endif |
|
269 |
IMPORT_C TUint32 FpExc(); |
|
270 |
IMPORT_C TUint32 ModifyFpExc(TUint32 aClearMask, TUint32 aSetMask); |
|
271 |
||
272 |
void CompleteContextSave(); |
|
273 |
}; |
|
274 |
||
275 |
||
276 |
struct SArmInterruptInfo |
|
277 |
{ |
|
278 |
TLinAddr iIrqHandler; |
|
279 |
TLinAddr iFiqHandler; |
|
280 |
SCpuIdleHandler iCpuIdleHandler; |
|
281 |
}; |
|
282 |
||
283 |
extern "C" SArmInterruptInfo ArmInterruptInfo; |
|
284 |
||
285 |
#if defined(__ARMCC__) |
|
286 |
#ifndef __CIA__ |
|
287 |
inline void mb() |
|
288 |
{ |
|
289 |
TUint32 reg = 0; |
|
290 |
asm("mcr p15, 0, reg, c7, c10, 5 "); |
|
291 |
} |
|
292 |
||
293 |
inline void arm_dsb() |
|
294 |
{ |
|
295 |
TUint32 reg = 0; |
|
296 |
asm("mcr p15, 0, reg, c7, c10, 4 "); |
|
297 |
} |
|
298 |
||
299 |
inline void arm_isb() |
|
300 |
{ |
|
301 |
TUint32 reg = 0; |
|
302 |
asm("mcr p15, 0, reg, c7, c5, 4 "); |
|
303 |
} |
|
304 |
#endif |
|
305 |
#elif defined(__GNUC__) || defined(__GCC32__) |
|
306 |
#define mb() \ |
|
307 |
do { \ |
|
308 |
TUint32 reg = 0; \ |
|
309 |
__asm__ __volatile__("mcr p15, 0, %0, c7, c10, 5" : : "r"(reg) : "memory"); \ |
|
310 |
} while(0) |
|
311 |
||
312 |
#define arm_dsb() \ |
|
313 |
do { \ |
|
314 |
TUint32 reg = 0; \ |
|
315 |
__asm__ __volatile__("mcr p15, 0, %0, c7, c10, 4" : : "r"(reg) : "memory"); \ |
|
316 |
} while(0) |
|
317 |
||
318 |
#define arm_isb() \ |
|
319 |
do { \ |
|
320 |
TUint32 reg = 0; \ |
|
321 |
__asm__ __volatile__("mcr p15, 0, %0, c7, c5, 4" : : "r"(reg) : "memory"); \ |
|
322 |
} while(0) |
|
323 |
#else |
|
324 |
#error Unknown ARM compiler |
|
325 |
#endif |
|
326 |
||
327 |
#define smp_mb() mb() |
|
328 |
#define wmb() mb() |
|
329 |
#define smp_wmb() mb() |
|
330 |
||
331 |
#ifdef __IN_KERNEL__ |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
332 |
#define SCU (*TheScheduler.iSX.iScuAddr) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
333 |
#define GIC_DIST (*TheScheduler.iSX.iGicDistAddr) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
334 |
#define GIC_CPU_IFC (*TheScheduler.iSX.iGicCpuIfcAddr) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
335 |
#define LOCAL_TIMER (*TheScheduler.iSX.iLocalTimerAddr) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
336 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
337 |
#ifdef __CPU_ARM_HAS_GLOBAL_TIMER_BLOCK |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
338 |
#define GLOBAL_TIMER (*TheScheduler.iSX.iGlobalTimerAddr) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
339 |
#endif |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
340 |
|
0 | 341 |
#endif |
342 |
||
343 |
||
344 |
// End of file |
|
345 |
#endif |