|
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 "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // e32\euser\us_data.h |
|
15 // Defines accessor functions for thread local data, either using Exec calls or the thread ID |
|
16 // register if available |
|
17 // |
|
18 // |
|
19 |
|
20 #ifndef __US_DATA_H__ |
|
21 #define __US_DATA_H__ |
|
22 |
|
23 #include "us_std.h" |
|
24 |
|
25 #ifdef __USERSIDE_THREAD_DATA__ |
|
26 |
|
27 TLocalThreadData* LocalThreadData(); |
|
28 |
|
29 #ifndef __TOOLS2__ |
|
30 inline RAllocator* GetHeap() |
|
31 { |
|
32 return LocalThreadData()->iHeap; |
|
33 } |
|
34 #endif // __TOOLS2__ |
|
35 |
|
36 inline CActiveScheduler* GetActiveScheduler() |
|
37 { |
|
38 return LocalThreadData()->iScheduler; |
|
39 } |
|
40 |
|
41 inline void SetActiveScheduler(CActiveScheduler* aS) |
|
42 { |
|
43 LocalThreadData()->iScheduler = aS; |
|
44 } |
|
45 |
|
46 inline TTrapHandler* GetTrapHandler() |
|
47 { |
|
48 return LocalThreadData()->iTrapHandler; |
|
49 } |
|
50 |
|
51 #else |
|
52 |
|
53 inline RAllocator* GetHeap() |
|
54 { |
|
55 return Exec::Heap(); |
|
56 } |
|
57 |
|
58 inline CActiveScheduler* GetActiveScheduler() |
|
59 { |
|
60 return Exec::ActiveScheduler(); |
|
61 } |
|
62 |
|
63 inline void SetActiveScheduler(CActiveScheduler* aS) |
|
64 { |
|
65 Exec::SetActiveScheduler(aS); |
|
66 } |
|
67 |
|
68 inline TTrapHandler* GetTrapHandler() |
|
69 { |
|
70 return Exec::TrapHandler(); |
|
71 } |
|
72 |
|
73 #endif |
|
74 |
|
75 #endif |
|
76 |