os/kernelhwsrv/kernel/eka/include/e32def_private.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 1994-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\e32def_private.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 #ifndef __E32DEF_PRIVATE_H__
    22 #define __E32DEF_PRIVATE_H__
    23 
    24 #ifdef __PROFILING__
    25 
    26 /**
    27 @publishedPartner
    28 @removed
    29 */
    30 #define __PROFILE_START(aBin) RDebug::ProfileStart(aBin)
    31 
    32 /**
    33 @publishedPartner
    34 @removed
    35 */
    36 #define __PROFILE_END(aBin)   RDebug::ProfileEnd(aBin)
    37 
    38 /**
    39 @publishedPartner
    40 @removed
    41 */
    42 #define __PROFILE_RESET(aNumberOfBins) RDebug::ProfileReset(0,aNumberOfBins)
    43 
    44 /**
    45 @publishedPartner
    46 @removed
    47 */
    48 #define __PROFILE_DISPLAY(aNumberOfBins) \
    49 			{	TFixedArray<TProfile, aNumberOfBins> result; \
    50 				RDebug::ProfileResult(result.Begin(), 0, aNumberOfBins); \
    51 				for (TInt i=0; i<aNumberOfBins; i++)   \
    52 				RDebug::Print(_L("Profile bin %d:  Calls: %d, Clock ticks: %d\n" ),i,res[i].iCount,result[i].iTime);  \
    53 			}
    54 #else /* __PROFILING__ */
    55 #define __PROFILE_START(aBin) 
    56 #define __PROFILE_END(aBin)   
    57 #define __PROFILE_RESET(aNumberOfBins) 
    58 #define __PROFILE_DISPLAY(aNumberOfBins)
    59 #endif
    60 
    61 #if defined(_DEBUG)
    62 
    63 /**
    64 @publishedPartner
    65 @released
    66 
    67 Marks the start of Kernel heap checking. 
    68 
    69 Checking the Kernel heap is only useful when developing Kernel side code such 
    70 as device drivers and media drivers.
    71 
    72 This macro is defined only for debug builds.
    73 
    74 This macro must be matched by a corresponding call to __KHEAP_MARKEND or __KHEAP_MARKENDC. 
    75 Calls to this macro can be nested but each call must be matched by corresponding 
    76 call to __KHEAP_MARKEND or __KHEAP_MARKENDC.
    77 
    78 @see User::__DbgMarkStart()
    79 @see __KHEAP_MARKEND
    80 @see __KHEAP_MARKENDC
    81 */
    82 #define __KHEAP_MARK User::__DbgMarkStart(TRUE)
    83 
    84 
    85 
    86 
    87 /**
    88 @publishedPartner
    89 @released
    90 
    91 Checks that the number of allocated cells at the current nested level of the 
    92 Kernel heap is the same as the specified value. This macro is defined only 
    93 for debug builds. Checking the Kernel heap is only useful when developing 
    94 Kernel side code such as device drivers and media drivers.
    95 
    96 The macro also takes the name of the file containing this source code statement 
    97 and the line number of this source code statement; they are displayed as part 
    98 of the panic category, if the checks fail.
    99 
   100 @param aCount The number of heap cells expected to be allocated at
   101               the current nest level.
   102 
   103 @see User::__DbgMarkCheck()
   104 @see __UHEAP_CHECK
   105 */
   106 #define __KHEAP_CHECK(aCount) User::__DbgMarkCheck(TRUE,FALSE,aCount,(TText8*)__FILE__,__LINE__)
   107 
   108 
   109 
   110 
   111 /**
   112 @publishedPartner
   113 @released
   114 
   115 Checks that the total number of allocated cells on the Kernel heap is the same 
   116 as the specified value.
   117 
   118 It is only useful when developing Kernel side code such as device drivers 
   119 and media drivers. 
   120 
   121 The macro also takes the name of the file containing this source code statement 
   122 and the line number of this source code statement; they are displayed as part 
   123 of the panic category, if the checks fail.
   124 
   125 This macro is defined only for debug builds.
   126 
   127 @param aCount The total number of heap cells expected to be allocated
   128 
   129 @see User::__DbgMarkCheck()
   130 @see __UHEAP_CHECKALL
   131 */
   132 #define __KHEAP_CHECKALL(aCount) User::__DbgMarkCheck(TRUE,TRUE,aCount,(TText8*)__FILE__,__LINE__)
   133 
   134 
   135 
   136 
   137 /**
   138 @publishedPartner
   139 @released
   140 
   141 Marks the end of Kernel heap checking. The macro expects zero heap cells to 
   142 remain allocated at the current nest level.
   143 
   144 This macro is defined only for debug builds. Checking the Kernel heap is only 
   145 useful when developing Kernel side code such as device drivers and media drivers.
   146 
   147 This macro must match an earlier call to __KHEAP_MARK.
   148 
   149 @see User::__DbgMarkEnd()
   150 @see __KHEAP_MARK
   151 */
   152 #define __KHEAP_MARKEND User::__DbgMarkEnd(TRUE,0)
   153 
   154 
   155 
   156 
   157 /**
   158 @publishedPartner
   159 @released
   160 
   161 Marks the end of Kernel heap checking. The macro expects aCount heap cells 
   162 to remain allocated at the current nest level.
   163 
   164 This macro is defined only for debug builds.
   165 
   166 This macro must match an earlier call to __KHEAP_MARK.
   167 
   168 @param aCount The number of heap cells expected to remain allocated at
   169               the current nest level.
   170 
   171 @see User::__DbgMarkEnd()
   172 @see __KHEAP_MARK
   173 */
   174 #define __KHEAP_MARKENDC(aCount) User::__DbgMarkEnd(TRUE,aCount)
   175 
   176 
   177 
   178 
   179 /**
   180 @publishedPartner
   181 @released
   182 
   183 Simulates Kernel heap allocation failure. The failure occurs on the next call 
   184 to new or any of the functions which allocate memory from the heap. This macro 
   185 is defined only for debug builds.
   186 
   187 Checking the Kernel heap is only useful when developing Kernel side code such 
   188 as device drivers and media drivers.
   189 
   190 @param aCount The rate of failure - heap allocation fails every aCount attempt.
   191 
   192 @see User::__DbgSetAllocFail()
   193 */
   194 #define __KHEAP_FAILNEXT(aCount) User::__DbgSetAllocFail(TRUE,RAllocator::EFailNext,aCount)
   195 
   196 /**
   197 @publishedPartner
   198 @released
   199 
   200 Simulates Kernel heap allocation failures. aBurst failures will occur on the next call 
   201 to new or any of the functions which allocate memory from the heap. This macro 
   202 is defined only for debug builds.
   203 
   204 Checking the Kernel heap is only useful when developing Kernel side code such 
   205 as device drivers and media drivers.
   206 
   207 @param aCount The heap allocation will fail after aCount-1 allocation attempts. 
   208               Note when used with RHeap the maximum value aCount can be set 
   209               to is KMaxTUint16.
   210 @param aBurst The number of allocations that will fail after aCount-1 allocation 
   211               attempts.  Note when used with RHeap the maximum value aBurst can be 
   212               set to is KMaxTUint16.
   213 
   214 
   215 @see User::__DbgSetBurstAllocFail()
   216 */
   217 #define __KHEAP_BURSTFAILNEXT(aCount,aBurst) User::__DbgSetBurstAllocFail(TRUE,RAllocator::EBurstFailNext,aCount,aBurst)
   218 
   219 
   220 /**
   221 @publishedPartner
   222 @released
   223 
   224 Simulates Kernel heap allocation failure. 
   225 
   226 The failure occurs on subsequent calls to new or any of the functions which 
   227 allocate memory from this heap.
   228 
   229 This macro is defined only for debug builds.
   230 
   231 @param aType  The type of failure to be simulated.
   232 @param aRate The failure rate.
   233 
   234 @see RAllocator::TAllocFail
   235 @see User::__DbgSetAllocFail()
   236 */
   237 #define __KHEAP_SETFAIL(aType,aRate) User::__DbgSetAllocFail(TRUE,aType,aRate)
   238 
   239 /**
   240 @publishedPartner
   241 @released
   242 
   243 Simulates Kernel heap allocation failure. 
   244 
   245 The failure occurs on subsequent calls to new or any of the functions which 
   246 allocate memory from this heap.
   247 
   248 This macro is defined only for debug builds.
   249 
   250 @param aType  The type of failure to be simulated.
   251 @param aRate  The failure rate.  Note when used with RHeap the maximum value 
   252               aRate can be set to is KMaxTUint16.
   253 @param aBurst The number of consecutive allocations that will fail.  Note 
   254               when used with RHeap the maximum value aBurst can be set to 
   255               is KMaxTUint16.
   256 
   257 @see RAllocator::TAllocFail
   258 @see User::__DbgSetBurstAllocFail()
   259 */
   260 #define __KHEAP_SETBURSTFAIL(aType,aRate,aBurst) User::__DbgSetBurstAllocFail(TRUE,aType,aRate,aBurst)
   261 
   262 
   263 
   264 /**
   265 @publishedPartner
   266 @released
   267 
   268 Cancels simulated Kernel heap allocation failure. 
   269 
   270 Checking the Kernel heap is only useful when developing Kernel side code such 
   271 as device drivers and media drivers.
   272 
   273 This macro is defined only for debug builds.
   274 
   275 @see User::__DbgSetAllocFail()
   276 */
   277 #define __KHEAP_RESET User::__DbgSetAllocFail(TRUE,RAllocator::ENone,1)
   278 
   279 
   280 
   281 
   282 /**
   283 @publishedPartner
   284 @released
   285 
   286 Cancels simulated kernel heap allocation failure. 
   287 It walks the the heap and sets the nesting level for all allocated
   288 cells to zero.
   289 
   290 Checking the kernel heap is only useful when developing kernel side code such 
   291 as device drivers and media drivers.
   292 
   293 This macro is defined only for debug builds.
   294 */
   295 #define __KHEAP_TOTAL_RESET User::__DbgSetAllocFail(TRUE,RAllocator::EReset,1)
   296 
   297 #else
   298 
   299 /**
   300 @publishedPartner
   301 @released
   302 
   303 Marks the start of Kernel heap checking. 
   304 
   305 Checking the Kernel heap is only useful when developing Kernel side code such 
   306 as device drivers and media drivers.
   307 
   308 This macro is defined only for debug builds.
   309 
   310 This macro must be matched by a corresponding call to __KHEAP_MARKEND or __KHEAP_MARKENDC. 
   311 Calls to this macro can be nested but each call must be matched by corresponding 
   312 call to __KHEAP_MARKEND or __KHEAP_MARKENDC.
   313 
   314 @see User::__DbgMarkStart()
   315 @see __KHEAP_MARKEND
   316 @see __KHEAP_MARKENDC
   317 */
   318 #define __KHEAP_MARK
   319 
   320 
   321 
   322 
   323 /**
   324 @publishedPartner
   325 @released
   326 
   327 Checks that the number of allocated cells at the current nested level of the 
   328 Kernel heap is the same as the specified value. This macro is defined only 
   329 for debug builds. Checking the Kernel heap is only useful when developing 
   330 Kernel side code such as device drivers and media drivers.
   331 
   332 The macro also takes the name of the file containing this source code statement 
   333 and the line number of this source code statement; they are displayed as part 
   334 of the panic category, if the checks fail.
   335 
   336 @param aCount The number of heap cells expected to be allocated at
   337               the current nest level.
   338 
   339 @see User::__DbgMarkCheck()
   340 @see __UHEAP_CHECK
   341 */
   342 #define __KHEAP_CHECK(aCount)
   343 
   344 
   345 
   346 
   347 /**
   348 @publishedPartner
   349 @released
   350 
   351 Checks that the total number of allocated cells on the Kernel heap is the same 
   352 as the specified value.
   353 
   354 It is only useful when developing Kernel side code such as device drivers 
   355 and media drivers. 
   356 
   357 The macro also takes the name of the file containing this source code statement 
   358 and the line number of this source code statement; they are displayed as part 
   359 of the panic category, if the checks fail.
   360 
   361 This macro is defined only for debug builds.
   362 
   363 @param aCount The total number of heap cells expected to be allocated
   364 
   365 @see User::__DbgMarkCheck()
   366 @see __UHEAP_CHECKALL
   367 */
   368 #define __KHEAP_CHECKALL(aCount)
   369 
   370 
   371 
   372 
   373 /**
   374 @publishedPartner
   375 @released
   376 
   377 Marks the end of Kernel heap checking. The macro expects zero heap cells to 
   378 remain allocated at the current nest level.
   379 
   380 This macro is defined only for debug builds. Checking the Kernel heap is only 
   381 useful when developing Kernel side code such as device drivers and media drivers.
   382 
   383 This macro must match an earlier call to __KHEAP_MARK.
   384 
   385 @see User::__DbgMarkEnd()
   386 @see __KHEAP_MARK
   387 */
   388 #define __KHEAP_MARKEND
   389 
   390 
   391 
   392 
   393 /**
   394 @publishedPartner
   395 @released
   396 
   397 Marks the end of Kernel heap checking. The macro expects aCount heap cells 
   398 to remain allocated at the current nest level.
   399 
   400 This macro is defined only for debug builds.
   401 
   402 This macro must match an earlier call to __KHEAP_MARK.
   403 
   404 @param aCount The number of heap cells expected to remain allocated at
   405               the current nest level.
   406 
   407 @see User::__DbgMarkEnd()
   408 @see __KHEAP_MARK
   409 */
   410 #define __KHEAP_MARKENDC(aCount)
   411 
   412 
   413 
   414 
   415 /**
   416 @publishedPartner
   417 @released
   418 
   419 Simulates Kernel heap allocation failure. The failure occurs on the next call 
   420 to new or any of the functions which allocate memory from the heap. This macro 
   421 is defined only for debug builds.
   422 
   423 Checking the Kernel heap is only useful when developing Kernel side code such 
   424 as device drivers and media drivers.
   425 
   426 @param aCount The rate of failure - heap allocation fails every aCount attempt.
   427 
   428 @see User::__DbgSetAllocFail()
   429 */
   430 #define __KHEAP_FAILNEXT(aCount)
   431 
   432 /**
   433 @publishedPartner
   434 @released
   435 
   436 Simulates Kernel heap allocation failures. aBurst failures will occur on the next call 
   437 to new or any of the functions which allocate memory from the heap. This macro 
   438 is defined only for debug builds.
   439 
   440 Checking the Kernel heap is only useful when developing Kernel side code such 
   441 as device drivers and media drivers.
   442 
   443 @param aCount The heap allocation will fail after aCount-1 allocation attempts.  
   444               Note when used with RHeap the maximum value aCount can be set 
   445               to is KMaxTUint16.
   446 @param aBurst The number of allocations that will fail after aCount-1 allocation
   447               attempts.  Note when used with RHeap the maximum value aBurst can 
   448               be set to is KMaxTUint16.
   449 
   450 @see User::__DbgSetBurstAllocFail()
   451 */
   452 #define __KHEAP_BURSTFAILNEXT(aCount,aBurst)
   453 
   454 
   455 
   456 /**
   457 @publishedPartner
   458 @released
   459 
   460 Simulates Kernel heap allocation failure. 
   461 
   462 The failure occurs on subsequent calls to new or any of the functions which 
   463 allocate memory from this heap.
   464 
   465 This macro is defined only for debug builds.
   466 
   467 @param aType  The type of failure to be simulated.
   468 @param aRate The failure rate.
   469 
   470 @see User::__DbgSetAllocFail()
   471 */
   472 #define __KHEAP_SETFAIL(aType,aRate)
   473 
   474 /**
   475 @publishedPartner
   476 @released
   477 
   478 Simulates Kernel heap allocation failure. 
   479 
   480 The failure occurs on subsequent calls to new or any of the functions which 
   481 allocate memory from this heap.
   482 
   483 This macro is defined only for debug builds.
   484 
   485 @param aType  The type of failure to be simulated.
   486 @param aRate  The failure rate.  Note when used with RHeap the maximum value 
   487               aRate can be set to is KMaxTUint16.
   488 @param aBurst The number of consecutive allocations that will fail.  Note 
   489               when used with RHeap the maximum value aBurst can be set 
   490               to is KMaxTUint16.
   491 
   492 @see User::__DbgSetBurstAllocFail()
   493 */
   494 #define __KHEAP_SETBURSTFAIL(aType,aRate,aBurst)
   495 
   496 
   497 
   498 /**
   499 @publishedPartner
   500 @released
   501 
   502 Cancels simulated Kernel heap allocation failure. 
   503 
   504 Checking the Kernel heap is only useful when developing Kernel side code such 
   505 as device drivers and media drivers.
   506 
   507 This macro is defined only for debug builds.
   508 
   509 @see User::__DbgSetAllocFail()
   510 */
   511 #define __KHEAP_RESET
   512 
   513 
   514 
   515 /**
   516 @publishedPartner
   517 @released
   518 
   519 Cancels simulated kernel heap allocation failure. 
   520 It walks the the heap and sets the nesting level for all allocated
   521 cells to zero.
   522 
   523 Checking the kernel heap is only useful when developing kernel side code such 
   524 as device drivers and media drivers.
   525 
   526 This macro is defined only for debug builds.
   527 */
   528 #define __KHEAP_TOTAL_RESET
   529 #endif
   530 
   531 #ifndef __VALUE_IN_REGS__ 
   532 /**
   533 @publishedPartner
   534 @released
   535 */
   536 #define __VALUE_IN_REGS__ 
   537 #endif
   538 
   539 
   540 /** @internalTechnology */
   541 #define __NO_MUTABLE_KEYWORD
   542 
   543 
   544 /**
   545 @internalTechnology
   546 
   547 A sorted list of all the code segments in ROM that contain an Exception Descriptor.
   548 
   549 */
   550 typedef struct TRomExceptionSearchTable
   551 	{
   552 	/**
   553 	The number of entries in the following table.
   554 	*/
   555 	TInt32 iNumEntries;
   556 	
   557 	/**
   558 	Address of the code segment of each TRomImageHeader that has an Exception Descriptor.
   559 	*/
   560 	TLinAddr iEntries[1];
   561 	} TRomExceptionSearchTable;
   562 	
   563 /**
   564 @internalComponent
   565 */
   566 typedef struct TExceptionDescriptor 
   567 	{
   568 	TLinAddr iExIdxBase;
   569 	TLinAddr iExIdxLimit;
   570 	TLinAddr iROSegmentBase;
   571 	TLinAddr iROSegmentLimit;
   572 	} TExceptionDescriptor;
   573 	
   574 #ifdef __KERNEL_MODE__
   575 
   576 /** @internalComponent */
   577 #define	KIMPORT_C	IMPORT_C
   578 
   579 /** @internalComponent */
   580 #define	KEXPORT_C	EXPORT_C
   581 
   582 #else
   583 #define	KIMPORT_C
   584 #define	KEXPORT_C
   585 #endif
   586 
   587 #endif //__E32DEF_PRIVATE_H__