os/kernelhwsrv/kernel/eka/include/e32def_private.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kernel/eka/include/e32def_private.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,587 @@
     1.4 +// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32\include\e32def_private.h
    1.18 +// 
    1.19 +// WARNING: This file contains some APIs which are internal and are subject
    1.20 +//          to change without notice. Such APIs should therefore not be used
    1.21 +//          outside the Kernel and Hardware Services package.
    1.22 +//
    1.23 +
    1.24 +#ifndef __E32DEF_PRIVATE_H__
    1.25 +#define __E32DEF_PRIVATE_H__
    1.26 +
    1.27 +#ifdef __PROFILING__
    1.28 +
    1.29 +/**
    1.30 +@publishedPartner
    1.31 +@removed
    1.32 +*/
    1.33 +#define __PROFILE_START(aBin) RDebug::ProfileStart(aBin)
    1.34 +
    1.35 +/**
    1.36 +@publishedPartner
    1.37 +@removed
    1.38 +*/
    1.39 +#define __PROFILE_END(aBin)   RDebug::ProfileEnd(aBin)
    1.40 +
    1.41 +/**
    1.42 +@publishedPartner
    1.43 +@removed
    1.44 +*/
    1.45 +#define __PROFILE_RESET(aNumberOfBins) RDebug::ProfileReset(0,aNumberOfBins)
    1.46 +
    1.47 +/**
    1.48 +@publishedPartner
    1.49 +@removed
    1.50 +*/
    1.51 +#define __PROFILE_DISPLAY(aNumberOfBins) \
    1.52 +			{	TFixedArray<TProfile, aNumberOfBins> result; \
    1.53 +				RDebug::ProfileResult(result.Begin(), 0, aNumberOfBins); \
    1.54 +				for (TInt i=0; i<aNumberOfBins; i++)   \
    1.55 +				RDebug::Print(_L("Profile bin %d:  Calls: %d, Clock ticks: %d\n" ),i,res[i].iCount,result[i].iTime);  \
    1.56 +			}
    1.57 +#else /* __PROFILING__ */
    1.58 +#define __PROFILE_START(aBin) 
    1.59 +#define __PROFILE_END(aBin)   
    1.60 +#define __PROFILE_RESET(aNumberOfBins) 
    1.61 +#define __PROFILE_DISPLAY(aNumberOfBins)
    1.62 +#endif
    1.63 +
    1.64 +#if defined(_DEBUG)
    1.65 +
    1.66 +/**
    1.67 +@publishedPartner
    1.68 +@released
    1.69 +
    1.70 +Marks the start of Kernel heap checking. 
    1.71 +
    1.72 +Checking the Kernel heap is only useful when developing Kernel side code such 
    1.73 +as device drivers and media drivers.
    1.74 +
    1.75 +This macro is defined only for debug builds.
    1.76 +
    1.77 +This macro must be matched by a corresponding call to __KHEAP_MARKEND or __KHEAP_MARKENDC. 
    1.78 +Calls to this macro can be nested but each call must be matched by corresponding 
    1.79 +call to __KHEAP_MARKEND or __KHEAP_MARKENDC.
    1.80 +
    1.81 +@see User::__DbgMarkStart()
    1.82 +@see __KHEAP_MARKEND
    1.83 +@see __KHEAP_MARKENDC
    1.84 +*/
    1.85 +#define __KHEAP_MARK User::__DbgMarkStart(TRUE)
    1.86 +
    1.87 +
    1.88 +
    1.89 +
    1.90 +/**
    1.91 +@publishedPartner
    1.92 +@released
    1.93 +
    1.94 +Checks that the number of allocated cells at the current nested level of the 
    1.95 +Kernel heap is the same as the specified value. This macro is defined only 
    1.96 +for debug builds. Checking the Kernel heap is only useful when developing 
    1.97 +Kernel side code such as device drivers and media drivers.
    1.98 +
    1.99 +The macro also takes the name of the file containing this source code statement 
   1.100 +and the line number of this source code statement; they are displayed as part 
   1.101 +of the panic category, if the checks fail.
   1.102 +
   1.103 +@param aCount The number of heap cells expected to be allocated at
   1.104 +              the current nest level.
   1.105 +
   1.106 +@see User::__DbgMarkCheck()
   1.107 +@see __UHEAP_CHECK
   1.108 +*/
   1.109 +#define __KHEAP_CHECK(aCount) User::__DbgMarkCheck(TRUE,FALSE,aCount,(TText8*)__FILE__,__LINE__)
   1.110 +
   1.111 +
   1.112 +
   1.113 +
   1.114 +/**
   1.115 +@publishedPartner
   1.116 +@released
   1.117 +
   1.118 +Checks that the total number of allocated cells on the Kernel heap is the same 
   1.119 +as the specified value.
   1.120 +
   1.121 +It is only useful when developing Kernel side code such as device drivers 
   1.122 +and media drivers. 
   1.123 +
   1.124 +The macro also takes the name of the file containing this source code statement 
   1.125 +and the line number of this source code statement; they are displayed as part 
   1.126 +of the panic category, if the checks fail.
   1.127 +
   1.128 +This macro is defined only for debug builds.
   1.129 +
   1.130 +@param aCount The total number of heap cells expected to be allocated
   1.131 +
   1.132 +@see User::__DbgMarkCheck()
   1.133 +@see __UHEAP_CHECKALL
   1.134 +*/
   1.135 +#define __KHEAP_CHECKALL(aCount) User::__DbgMarkCheck(TRUE,TRUE,aCount,(TText8*)__FILE__,__LINE__)
   1.136 +
   1.137 +
   1.138 +
   1.139 +
   1.140 +/**
   1.141 +@publishedPartner
   1.142 +@released
   1.143 +
   1.144 +Marks the end of Kernel heap checking. The macro expects zero heap cells to 
   1.145 +remain allocated at the current nest level.
   1.146 +
   1.147 +This macro is defined only for debug builds. Checking the Kernel heap is only 
   1.148 +useful when developing Kernel side code such as device drivers and media drivers.
   1.149 +
   1.150 +This macro must match an earlier call to __KHEAP_MARK.
   1.151 +
   1.152 +@see User::__DbgMarkEnd()
   1.153 +@see __KHEAP_MARK
   1.154 +*/
   1.155 +#define __KHEAP_MARKEND User::__DbgMarkEnd(TRUE,0)
   1.156 +
   1.157 +
   1.158 +
   1.159 +
   1.160 +/**
   1.161 +@publishedPartner
   1.162 +@released
   1.163 +
   1.164 +Marks the end of Kernel heap checking. The macro expects aCount heap cells 
   1.165 +to remain allocated at the current nest level.
   1.166 +
   1.167 +This macro is defined only for debug builds.
   1.168 +
   1.169 +This macro must match an earlier call to __KHEAP_MARK.
   1.170 +
   1.171 +@param aCount The number of heap cells expected to remain allocated at
   1.172 +              the current nest level.
   1.173 +
   1.174 +@see User::__DbgMarkEnd()
   1.175 +@see __KHEAP_MARK
   1.176 +*/
   1.177 +#define __KHEAP_MARKENDC(aCount) User::__DbgMarkEnd(TRUE,aCount)
   1.178 +
   1.179 +
   1.180 +
   1.181 +
   1.182 +/**
   1.183 +@publishedPartner
   1.184 +@released
   1.185 +
   1.186 +Simulates Kernel heap allocation failure. The failure occurs on the next call 
   1.187 +to new or any of the functions which allocate memory from the heap. This macro 
   1.188 +is defined only for debug builds.
   1.189 +
   1.190 +Checking the Kernel heap is only useful when developing Kernel side code such 
   1.191 +as device drivers and media drivers.
   1.192 +
   1.193 +@param aCount The rate of failure - heap allocation fails every aCount attempt.
   1.194 +
   1.195 +@see User::__DbgSetAllocFail()
   1.196 +*/
   1.197 +#define __KHEAP_FAILNEXT(aCount) User::__DbgSetAllocFail(TRUE,RAllocator::EFailNext,aCount)
   1.198 +
   1.199 +/**
   1.200 +@publishedPartner
   1.201 +@released
   1.202 +
   1.203 +Simulates Kernel heap allocation failures. aBurst failures will occur on the next call 
   1.204 +to new or any of the functions which allocate memory from the heap. This macro 
   1.205 +is defined only for debug builds.
   1.206 +
   1.207 +Checking the Kernel heap is only useful when developing Kernel side code such 
   1.208 +as device drivers and media drivers.
   1.209 +
   1.210 +@param aCount The heap allocation will fail after aCount-1 allocation attempts. 
   1.211 +              Note when used with RHeap the maximum value aCount can be set 
   1.212 +              to is KMaxTUint16.
   1.213 +@param aBurst The number of allocations that will fail after aCount-1 allocation 
   1.214 +              attempts.  Note when used with RHeap the maximum value aBurst can be 
   1.215 +              set to is KMaxTUint16.
   1.216 +
   1.217 +
   1.218 +@see User::__DbgSetBurstAllocFail()
   1.219 +*/
   1.220 +#define __KHEAP_BURSTFAILNEXT(aCount,aBurst) User::__DbgSetBurstAllocFail(TRUE,RAllocator::EBurstFailNext,aCount,aBurst)
   1.221 +
   1.222 +
   1.223 +/**
   1.224 +@publishedPartner
   1.225 +@released
   1.226 +
   1.227 +Simulates Kernel heap allocation failure. 
   1.228 +
   1.229 +The failure occurs on subsequent calls to new or any of the functions which 
   1.230 +allocate memory from this heap.
   1.231 +
   1.232 +This macro is defined only for debug builds.
   1.233 +
   1.234 +@param aType  The type of failure to be simulated.
   1.235 +@param aRate The failure rate.
   1.236 +
   1.237 +@see RAllocator::TAllocFail
   1.238 +@see User::__DbgSetAllocFail()
   1.239 +*/
   1.240 +#define __KHEAP_SETFAIL(aType,aRate) User::__DbgSetAllocFail(TRUE,aType,aRate)
   1.241 +
   1.242 +/**
   1.243 +@publishedPartner
   1.244 +@released
   1.245 +
   1.246 +Simulates Kernel heap allocation failure. 
   1.247 +
   1.248 +The failure occurs on subsequent calls to new or any of the functions which 
   1.249 +allocate memory from this heap.
   1.250 +
   1.251 +This macro is defined only for debug builds.
   1.252 +
   1.253 +@param aType  The type of failure to be simulated.
   1.254 +@param aRate  The failure rate.  Note when used with RHeap the maximum value 
   1.255 +              aRate can be set to is KMaxTUint16.
   1.256 +@param aBurst The number of consecutive allocations that will fail.  Note 
   1.257 +              when used with RHeap the maximum value aBurst can be set to 
   1.258 +              is KMaxTUint16.
   1.259 +
   1.260 +@see RAllocator::TAllocFail
   1.261 +@see User::__DbgSetBurstAllocFail()
   1.262 +*/
   1.263 +#define __KHEAP_SETBURSTFAIL(aType,aRate,aBurst) User::__DbgSetBurstAllocFail(TRUE,aType,aRate,aBurst)
   1.264 +
   1.265 +
   1.266 +
   1.267 +/**
   1.268 +@publishedPartner
   1.269 +@released
   1.270 +
   1.271 +Cancels simulated Kernel heap allocation failure. 
   1.272 +
   1.273 +Checking the Kernel heap is only useful when developing Kernel side code such 
   1.274 +as device drivers and media drivers.
   1.275 +
   1.276 +This macro is defined only for debug builds.
   1.277 +
   1.278 +@see User::__DbgSetAllocFail()
   1.279 +*/
   1.280 +#define __KHEAP_RESET User::__DbgSetAllocFail(TRUE,RAllocator::ENone,1)
   1.281 +
   1.282 +
   1.283 +
   1.284 +
   1.285 +/**
   1.286 +@publishedPartner
   1.287 +@released
   1.288 +
   1.289 +Cancels simulated kernel heap allocation failure. 
   1.290 +It walks the the heap and sets the nesting level for all allocated
   1.291 +cells to zero.
   1.292 +
   1.293 +Checking the kernel heap is only useful when developing kernel side code such 
   1.294 +as device drivers and media drivers.
   1.295 +
   1.296 +This macro is defined only for debug builds.
   1.297 +*/
   1.298 +#define __KHEAP_TOTAL_RESET User::__DbgSetAllocFail(TRUE,RAllocator::EReset,1)
   1.299 +
   1.300 +#else
   1.301 +
   1.302 +/**
   1.303 +@publishedPartner
   1.304 +@released
   1.305 +
   1.306 +Marks the start of Kernel heap checking. 
   1.307 +
   1.308 +Checking the Kernel heap is only useful when developing Kernel side code such 
   1.309 +as device drivers and media drivers.
   1.310 +
   1.311 +This macro is defined only for debug builds.
   1.312 +
   1.313 +This macro must be matched by a corresponding call to __KHEAP_MARKEND or __KHEAP_MARKENDC. 
   1.314 +Calls to this macro can be nested but each call must be matched by corresponding 
   1.315 +call to __KHEAP_MARKEND or __KHEAP_MARKENDC.
   1.316 +
   1.317 +@see User::__DbgMarkStart()
   1.318 +@see __KHEAP_MARKEND
   1.319 +@see __KHEAP_MARKENDC
   1.320 +*/
   1.321 +#define __KHEAP_MARK
   1.322 +
   1.323 +
   1.324 +
   1.325 +
   1.326 +/**
   1.327 +@publishedPartner
   1.328 +@released
   1.329 +
   1.330 +Checks that the number of allocated cells at the current nested level of the 
   1.331 +Kernel heap is the same as the specified value. This macro is defined only 
   1.332 +for debug builds. Checking the Kernel heap is only useful when developing 
   1.333 +Kernel side code such as device drivers and media drivers.
   1.334 +
   1.335 +The macro also takes the name of the file containing this source code statement 
   1.336 +and the line number of this source code statement; they are displayed as part 
   1.337 +of the panic category, if the checks fail.
   1.338 +
   1.339 +@param aCount The number of heap cells expected to be allocated at
   1.340 +              the current nest level.
   1.341 +
   1.342 +@see User::__DbgMarkCheck()
   1.343 +@see __UHEAP_CHECK
   1.344 +*/
   1.345 +#define __KHEAP_CHECK(aCount)
   1.346 +
   1.347 +
   1.348 +
   1.349 +
   1.350 +/**
   1.351 +@publishedPartner
   1.352 +@released
   1.353 +
   1.354 +Checks that the total number of allocated cells on the Kernel heap is the same 
   1.355 +as the specified value.
   1.356 +
   1.357 +It is only useful when developing Kernel side code such as device drivers 
   1.358 +and media drivers. 
   1.359 +
   1.360 +The macro also takes the name of the file containing this source code statement 
   1.361 +and the line number of this source code statement; they are displayed as part 
   1.362 +of the panic category, if the checks fail.
   1.363 +
   1.364 +This macro is defined only for debug builds.
   1.365 +
   1.366 +@param aCount The total number of heap cells expected to be allocated
   1.367 +
   1.368 +@see User::__DbgMarkCheck()
   1.369 +@see __UHEAP_CHECKALL
   1.370 +*/
   1.371 +#define __KHEAP_CHECKALL(aCount)
   1.372 +
   1.373 +
   1.374 +
   1.375 +
   1.376 +/**
   1.377 +@publishedPartner
   1.378 +@released
   1.379 +
   1.380 +Marks the end of Kernel heap checking. The macro expects zero heap cells to 
   1.381 +remain allocated at the current nest level.
   1.382 +
   1.383 +This macro is defined only for debug builds. Checking the Kernel heap is only 
   1.384 +useful when developing Kernel side code such as device drivers and media drivers.
   1.385 +
   1.386 +This macro must match an earlier call to __KHEAP_MARK.
   1.387 +
   1.388 +@see User::__DbgMarkEnd()
   1.389 +@see __KHEAP_MARK
   1.390 +*/
   1.391 +#define __KHEAP_MARKEND
   1.392 +
   1.393 +
   1.394 +
   1.395 +
   1.396 +/**
   1.397 +@publishedPartner
   1.398 +@released
   1.399 +
   1.400 +Marks the end of Kernel heap checking. The macro expects aCount heap cells 
   1.401 +to remain allocated at the current nest level.
   1.402 +
   1.403 +This macro is defined only for debug builds.
   1.404 +
   1.405 +This macro must match an earlier call to __KHEAP_MARK.
   1.406 +
   1.407 +@param aCount The number of heap cells expected to remain allocated at
   1.408 +              the current nest level.
   1.409 +
   1.410 +@see User::__DbgMarkEnd()
   1.411 +@see __KHEAP_MARK
   1.412 +*/
   1.413 +#define __KHEAP_MARKENDC(aCount)
   1.414 +
   1.415 +
   1.416 +
   1.417 +
   1.418 +/**
   1.419 +@publishedPartner
   1.420 +@released
   1.421 +
   1.422 +Simulates Kernel heap allocation failure. The failure occurs on the next call 
   1.423 +to new or any of the functions which allocate memory from the heap. This macro 
   1.424 +is defined only for debug builds.
   1.425 +
   1.426 +Checking the Kernel heap is only useful when developing Kernel side code such 
   1.427 +as device drivers and media drivers.
   1.428 +
   1.429 +@param aCount The rate of failure - heap allocation fails every aCount attempt.
   1.430 +
   1.431 +@see User::__DbgSetAllocFail()
   1.432 +*/
   1.433 +#define __KHEAP_FAILNEXT(aCount)
   1.434 +
   1.435 +/**
   1.436 +@publishedPartner
   1.437 +@released
   1.438 +
   1.439 +Simulates Kernel heap allocation failures. aBurst failures will occur on the next call 
   1.440 +to new or any of the functions which allocate memory from the heap. This macro 
   1.441 +is defined only for debug builds.
   1.442 +
   1.443 +Checking the Kernel heap is only useful when developing Kernel side code such 
   1.444 +as device drivers and media drivers.
   1.445 +
   1.446 +@param aCount The heap allocation will fail after aCount-1 allocation attempts.  
   1.447 +              Note when used with RHeap the maximum value aCount can be set 
   1.448 +              to is KMaxTUint16.
   1.449 +@param aBurst The number of allocations that will fail after aCount-1 allocation
   1.450 +              attempts.  Note when used with RHeap the maximum value aBurst can 
   1.451 +              be set to is KMaxTUint16.
   1.452 +
   1.453 +@see User::__DbgSetBurstAllocFail()
   1.454 +*/
   1.455 +#define __KHEAP_BURSTFAILNEXT(aCount,aBurst)
   1.456 +
   1.457 +
   1.458 +
   1.459 +/**
   1.460 +@publishedPartner
   1.461 +@released
   1.462 +
   1.463 +Simulates Kernel heap allocation failure. 
   1.464 +
   1.465 +The failure occurs on subsequent calls to new or any of the functions which 
   1.466 +allocate memory from this heap.
   1.467 +
   1.468 +This macro is defined only for debug builds.
   1.469 +
   1.470 +@param aType  The type of failure to be simulated.
   1.471 +@param aRate The failure rate.
   1.472 +
   1.473 +@see User::__DbgSetAllocFail()
   1.474 +*/
   1.475 +#define __KHEAP_SETFAIL(aType,aRate)
   1.476 +
   1.477 +/**
   1.478 +@publishedPartner
   1.479 +@released
   1.480 +
   1.481 +Simulates Kernel heap allocation failure. 
   1.482 +
   1.483 +The failure occurs on subsequent calls to new or any of the functions which 
   1.484 +allocate memory from this heap.
   1.485 +
   1.486 +This macro is defined only for debug builds.
   1.487 +
   1.488 +@param aType  The type of failure to be simulated.
   1.489 +@param aRate  The failure rate.  Note when used with RHeap the maximum value 
   1.490 +              aRate can be set to is KMaxTUint16.
   1.491 +@param aBurst The number of consecutive allocations that will fail.  Note 
   1.492 +              when used with RHeap the maximum value aBurst can be set 
   1.493 +              to is KMaxTUint16.
   1.494 +
   1.495 +@see User::__DbgSetBurstAllocFail()
   1.496 +*/
   1.497 +#define __KHEAP_SETBURSTFAIL(aType,aRate,aBurst)
   1.498 +
   1.499 +
   1.500 +
   1.501 +/**
   1.502 +@publishedPartner
   1.503 +@released
   1.504 +
   1.505 +Cancels simulated Kernel heap allocation failure. 
   1.506 +
   1.507 +Checking the Kernel heap is only useful when developing Kernel side code such 
   1.508 +as device drivers and media drivers.
   1.509 +
   1.510 +This macro is defined only for debug builds.
   1.511 +
   1.512 +@see User::__DbgSetAllocFail()
   1.513 +*/
   1.514 +#define __KHEAP_RESET
   1.515 +
   1.516 +
   1.517 +
   1.518 +/**
   1.519 +@publishedPartner
   1.520 +@released
   1.521 +
   1.522 +Cancels simulated kernel heap allocation failure. 
   1.523 +It walks the the heap and sets the nesting level for all allocated
   1.524 +cells to zero.
   1.525 +
   1.526 +Checking the kernel heap is only useful when developing kernel side code such 
   1.527 +as device drivers and media drivers.
   1.528 +
   1.529 +This macro is defined only for debug builds.
   1.530 +*/
   1.531 +#define __KHEAP_TOTAL_RESET
   1.532 +#endif
   1.533 +
   1.534 +#ifndef __VALUE_IN_REGS__ 
   1.535 +/**
   1.536 +@publishedPartner
   1.537 +@released
   1.538 +*/
   1.539 +#define __VALUE_IN_REGS__ 
   1.540 +#endif
   1.541 +
   1.542 +
   1.543 +/** @internalTechnology */
   1.544 +#define __NO_MUTABLE_KEYWORD
   1.545 +
   1.546 +
   1.547 +/**
   1.548 +@internalTechnology
   1.549 +
   1.550 +A sorted list of all the code segments in ROM that contain an Exception Descriptor.
   1.551 +
   1.552 +*/
   1.553 +typedef struct TRomExceptionSearchTable
   1.554 +	{
   1.555 +	/**
   1.556 +	The number of entries in the following table.
   1.557 +	*/
   1.558 +	TInt32 iNumEntries;
   1.559 +	
   1.560 +	/**
   1.561 +	Address of the code segment of each TRomImageHeader that has an Exception Descriptor.
   1.562 +	*/
   1.563 +	TLinAddr iEntries[1];
   1.564 +	} TRomExceptionSearchTable;
   1.565 +	
   1.566 +/**
   1.567 +@internalComponent
   1.568 +*/
   1.569 +typedef struct TExceptionDescriptor 
   1.570 +	{
   1.571 +	TLinAddr iExIdxBase;
   1.572 +	TLinAddr iExIdxLimit;
   1.573 +	TLinAddr iROSegmentBase;
   1.574 +	TLinAddr iROSegmentLimit;
   1.575 +	} TExceptionDescriptor;
   1.576 +	
   1.577 +#ifdef __KERNEL_MODE__
   1.578 +
   1.579 +/** @internalComponent */
   1.580 +#define	KIMPORT_C	IMPORT_C
   1.581 +
   1.582 +/** @internalComponent */
   1.583 +#define	KEXPORT_C	EXPORT_C
   1.584 +
   1.585 +#else
   1.586 +#define	KIMPORT_C
   1.587 +#define	KEXPORT_C
   1.588 +#endif
   1.589 +
   1.590 +#endif //__E32DEF_PRIVATE_H__