kernel/eka/include/nkern/nk_priv.h
changeset 36 538db54a451d
parent 0 a41df078684a
child 81 e7d2d738d3c2
child 90 947f0dc9f7a8
equal deleted inserted replaced
34:f497542af8e4 36:538db54a451d
   509 /**
   509 /**
   510 @internalComponent
   510 @internalComponent
   511 */
   511 */
   512 TBool InterruptsStatus(TBool aRequest);
   512 TBool InterruptsStatus(TBool aRequest);
   513 
   513 
   514 
   514 //declarations for the checking of kernel preconditions
   515 //declarations for the checking of kernel precoditions
   515 
       
   516 /**
       
   517 @internalComponent
       
   518 
       
   519 PRECOND_FUNCTION_CALLER is needed for __ASSERT_WITH_MESSAGE_ALWAYS(),
       
   520 so is outside the #ifdef _DEBUG.
       
   521 */
       
   522 #ifndef PRECOND_FUNCTION_CALLER
       
   523 #define PRECOND_FUNCTION_CALLER		0
       
   524 #endif
       
   525 
   516 #ifdef _DEBUG
   526 #ifdef _DEBUG
   517 
   527 
   518 /**
   528 /**
   519 @internalComponent
   529 @internalComponent
   520 */
   530 */
   546 */
   556 */
   547 extern "C" TInt CheckPreconditions(TUint32 aConditionMask, const char* aFunction, TLinAddr aAddr);
   557 extern "C" TInt CheckPreconditions(TUint32 aConditionMask, const char* aFunction, TLinAddr aAddr);
   548 /**
   558 /**
   549 @internalComponent
   559 @internalComponent
   550 */
   560 */
   551 #define CHECK_PRECONDITIONS(mask,function) CheckPreconditions(mask,function,0)
   561 #define CHECK_PRECONDITIONS(mask,function) CheckPreconditions(mask,function,PRECOND_FUNCTION_CALLER)
   552 
   562 
   553 #ifdef __KERNEL_APIS_CONTEXT_CHECKS_FAULT__
   563 #ifdef __KERNEL_APIS_CONTEXT_CHECKS_FAULT__
   554 
   564 
   555 /**
   565 /**
   556 @internalComponent
   566 @internalComponent
   557 */
   567 */
   558 #define __ASSERT_WITH_MESSAGE_DEBUG(cond,message,function) \
   568 #define __ASSERT_WITH_MESSAGE_DEBUG(cond,message,function) \
   559 			__ASSERT_DEBUG( (cond), ( \
   569 			__ASSERT_DEBUG( (cond), ( \
   560 			DEBUGPRINT("Assertion failed: %s\nFunction: %s\n",message,function),\
   570 			DEBUGPRINT("Assertion failed: %s\nFunction: %s; called from: %08x\n",message,function,PRECOND_FUNCTION_CALLER),\
   561 			NKFault(function, 0)))
   571 			NKFault(function, 0)))
   562 
   572 
   563 #else//!__KERNEL_APIS_CONTEXT_CHECKS_FAULT__
   573 #else//!__KERNEL_APIS_CONTEXT_CHECKS_FAULT__
   564 /**
   574 /**
   565 @internalComponent
   575 @internalComponent
   566 */
   576 */
   567 #define __ASSERT_WITH_MESSAGE_DEBUG(cond,message,function) \
   577 #define __ASSERT_WITH_MESSAGE_DEBUG(cond,message,function) \
   568 			__ASSERT_DEBUG( (cond), \
   578 			__ASSERT_DEBUG( (cond), \
   569 			DEBUGPRINT("Assertion failed: %s\nFunction: %s\n",message,function))
   579 			DEBUGPRINT("Assertion failed: %s\nFunction: %s; called from: %08x\n",message,function,PRECOND_FUNCTION_CALLER))
   570 
   580 
   571 
   581 
   572 #endif//__KERNEL_APIS_CONTEXT_CHECKS_FAULT__
   582 #endif//__KERNEL_APIS_CONTEXT_CHECKS_FAULT__
   573 #endif//(!defined (__KERNEL_APIS_CONTEXT_CHECKS_WARNING__)&&!defined (__KERNEL_APIS_CONTEXT_CHECKS_FAULT__))
   583 #endif//(!defined (__KERNEL_APIS_CONTEXT_CHECKS_WARNING__)&&!defined (__KERNEL_APIS_CONTEXT_CHECKS_FAULT__))
   574 
   584 
   586 /**
   596 /**
   587 @internalComponent
   597 @internalComponent
   588 */
   598 */
   589 #define __ASSERT_WITH_MESSAGE_ALWAYS(cond,message,function) \
   599 #define __ASSERT_WITH_MESSAGE_ALWAYS(cond,message,function) \
   590 			__ASSERT_ALWAYS( (cond), ( \
   600 			__ASSERT_ALWAYS( (cond), ( \
   591 			DEBUGPRINT("Assertion failed: %s\nFunction: %s\n",message,function),\
   601 			DEBUGPRINT("Assertion failed: %s\nFunction: %s; called from: %08x\n",message,function,PRECOND_FUNCTION_CALLER),\
   592 			NKFault(function, 0)))
   602 			NKFault(function, 0)))
   593 #else
   603 #else
   594 /**
   604 /**
   595 @internalComponent
   605 @internalComponent
   596 */
   606 */
   597 #define __ASSERT_WITH_MESSAGE_ALWAYS(cond,message,function) \
   607 #define __ASSERT_WITH_MESSAGE_ALWAYS(cond,message,function) \
   598 			__ASSERT_ALWAYS( (cond), \
   608 			__ASSERT_ALWAYS( (cond), \
   599 			DEBUGPRINT("Assertion failed: %s\nFunction: %s\n",message,function))
   609 			DEBUGPRINT("Assertion failed: %s\nFunction: %s; called from: %08x\n",message,function,PRECOND_FUNCTION_CALLER))
   600 #endif//__KERNEL_APIS_CONTEXT_CHECKS_FAULT__
   610 #endif//__KERNEL_APIS_CONTEXT_CHECKS_FAULT__
   601 #endif//(!defined (__KERNEL_APIS_CONTEXT_CHECKS_WARNING__)&&!defined (__KERNEL_APIS_CONTEXT_CHECKS_FAULT__))
   611 #endif//(!defined (__KERNEL_APIS_CONTEXT_CHECKS_WARNING__)&&!defined (__KERNEL_APIS_CONTEXT_CHECKS_FAULT__))
   602 
   612 
   603 #endif
   613 #endif