33 #include <kernel/kernboot.h> |
33 #include <kernel/kernboot.h> |
34 #include <e32def_private.h> |
34 #include <e32def_private.h> |
35 #include <e32const_private.h> |
35 #include <e32const_private.h> |
36 #include <e32des8_private.h> |
36 #include <e32des8_private.h> |
37 #include <e32event_private.h> |
37 #include <e32event_private.h> |
38 |
38 #include <kernel/heap_hybrid.h> |
39 |
39 |
40 #ifndef __MINIMUM_MACHINE_CODE__ |
40 #ifndef __MINIMUM_MACHINE_CODE__ |
41 #ifdef __MARM__ |
41 #ifdef __MARM__ |
42 #ifndef __BIG_ENDIAN__ |
42 #ifndef __BIG_ENDIAN__ |
43 |
43 |
1520 ETypeSecureId= 2, |
1520 ETypeSecureId= 2, |
1521 ETypeVendorId= 3, |
1521 ETypeVendorId= 3, |
1522 }; |
1522 }; |
1523 enum TMask |
1523 enum TMask |
1524 { |
1524 { |
1525 EMaskFail = ETypeFail << KCSPBitsFree, |
1525 EMaskFail = TUint32 (ETypeFail) << KCSPBitsFree, |
1526 EMaskCapsOnly = ETypeCapsOnly << KCSPBitsFree, |
1526 EMaskCapsOnly = TUint32 (ETypeCapsOnly) << KCSPBitsFree, |
1527 EMaskSecureId = ETypeSecureId << KCSPBitsFree, |
1527 EMaskSecureId = TUint32 (ETypeSecureId) << KCSPBitsFree, |
1528 EMaskVendorId = ETypeVendorId << KCSPBitsFree, |
1528 EMaskVendorId = TUint32 (ETypeVendorId) << KCSPBitsFree, |
1529 }; |
1529 }; |
1530 TInt Set(const TSecurityPolicy& aPolicy); |
1530 TInt Set(const TSecurityPolicy& aPolicy); |
1531 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
1531 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
1532 inline TBool CheckPolicy(DProcess* aProcess, const char* aDiagnostic=0) const |
1532 inline TBool CheckPolicy(DProcess* aProcess, const char* aDiagnostic=0) const |
1533 { |
1533 { |
2260 |
2260 |
2261 |
2261 |
2262 /******************************************** |
2262 /******************************************** |
2263 * Kernel heap |
2263 * Kernel heap |
2264 ********************************************/ |
2264 ********************************************/ |
2265 class RHeapK : public RHeap |
2265 class RHeapK : public RHybridHeap |
2266 { |
2266 { |
2267 public: |
2267 public: |
2268 static RHeapK* FixedHeap(TAny* aBase, TInt aMaxLength); |
2268 static RHeapK* FixedHeap(TAny* aBase, TInt aMaxLength); |
2269 TInt CreateMutex(); |
2269 TInt CreateMutex(); |
2270 void Mutate(TInt aOffset, TInt aMaxLength); |
2270 void Mutate(TInt aOffset, TInt aMaxLength); |
2278 inline TInt TotalAllocSize() const |
2278 inline TInt TotalAllocSize() const |
2279 { return iTotalAllocSize; } |
2279 { return iTotalAllocSize; } |
2280 static void CheckThreadState(); |
2280 static void CheckThreadState(); |
2281 static void Fault(TInt aFault); |
2281 static void Fault(TInt aFault); |
2282 inline TBool CheckForSimulatedAllocFail() |
2282 inline TBool CheckForSimulatedAllocFail() |
2283 { return RHeap::CheckForSimulatedAllocFail(); } |
2283 { return RHybridHeap::CheckForSimulatedAllocFail(); } |
2284 inline DMutex* Mutex() const; /**< @internalComponent */ |
2284 inline DMutex* Mutex() const; /**< @internalComponent */ |
2285 public: |
2285 public: |
2286 friend class Monitor; |
2286 friend class Monitor; |
2287 }; |
2287 }; |
2288 |
|
2289 inline void RHeap::Lock() const |
|
2290 { |
|
2291 DMutex* m = *(DMutex**)&iLock; |
|
2292 if (m) |
|
2293 Kern::MutexWait(*m); |
|
2294 } |
|
2295 |
|
2296 inline void RHeap::Unlock() const |
|
2297 { |
|
2298 DMutex* m = *(DMutex**)&iLock; |
|
2299 if (m) |
|
2300 Kern::MutexSignal(*m); |
|
2301 } |
|
2302 |
2288 |
2303 /** |
2289 /** |
2304 @internalComponent |
2290 @internalComponent |
2305 */ |
2291 */ |
2306 inline DMutex* RHeapK::Mutex() const |
2292 inline DMutex* RHeapK::Mutex() const |
2307 { return *(DMutex**)&iLock; } |
2293 { return *(DMutex**)&iLock; } |
2308 |
|
2309 inline TInt RHeap::SetBrk(TInt aBrk) |
|
2310 { |
|
2311 return ((DChunk*)iChunkHandle)->Adjust(aBrk); |
|
2312 } |
|
2313 |
2294 |
2314 enum TSecureClockStatusFlags |
2295 enum TSecureClockStatusFlags |
2315 { |
2296 { |
2316 ESecureClockPresent = 1, // signals a trusted time source has been found |
2297 ESecureClockPresent = 1, // signals a trusted time source has been found |
2317 ESecureClockOffsetPresent = 2, // signals nonsecure offset was read from HAL |
2298 ESecureClockOffsetPresent = 2, // signals nonsecure offset was read from HAL |