kernel/eka/include/nkernsmp/nk_priv.h
changeset 11 329ab0095843
parent 9 96e5fb8b040d
child 21 e7d2d738d3c2
equal deleted inserted replaced
10:36bfc973b146 11:329ab0095843
   779 */
   779 */
   780 TBool InterruptsStatus(TBool aRequest);
   780 TBool InterruptsStatus(TBool aRequest);
   781 
   781 
   782 
   782 
   783 //declarations for the checking of kernel preconditions
   783 //declarations for the checking of kernel preconditions
       
   784 
       
   785 /**
       
   786 @internalComponent
       
   787 
       
   788 PRECOND_FUNCTION_CALLER is needed for __ASSERT_WITH_MESSAGE_ALWAYS(),
       
   789 so is outside the #ifdef _DEBUG.
       
   790 */
       
   791 #ifndef PRECOND_FUNCTION_CALLER
       
   792 #define PRECOND_FUNCTION_CALLER		0
       
   793 #endif
       
   794 
   784 #ifdef _DEBUG
   795 #ifdef _DEBUG
   785 
   796 
   786 /**
   797 /**
   787 @internalComponent
   798 @internalComponent
   788 */
   799 */
   814 */
   825 */
   815 extern "C" TInt CheckPreconditions(TUint32 aConditionMask, const char* aFunction, TLinAddr aAddr);
   826 extern "C" TInt CheckPreconditions(TUint32 aConditionMask, const char* aFunction, TLinAddr aAddr);
   816 /**
   827 /**
   817 @internalComponent
   828 @internalComponent
   818 */
   829 */
   819 #define CHECK_PRECONDITIONS(mask,function) CheckPreconditions(mask,function,0)
   830 #define CHECK_PRECONDITIONS(mask,function) CheckPreconditions(mask,function,PRECOND_FUNCTION_CALLER)
   820 
   831 
   821 #ifdef __KERNEL_APIS_CONTEXT_CHECKS_FAULT__
   832 #ifdef __KERNEL_APIS_CONTEXT_CHECKS_FAULT__
   822 
   833 
   823 /**
   834 /**
   824 @internalComponent
   835 @internalComponent
   825 */
   836 */
   826 #define __ASSERT_WITH_MESSAGE_DEBUG(cond,message,function) \
   837 #define __ASSERT_WITH_MESSAGE_DEBUG(cond,message,function) \
   827 			__ASSERT_DEBUG( (cond), ( \
   838 			__ASSERT_DEBUG( (cond), ( \
   828 			DEBUGPRINT("Assertion failed: %s\nFunction: %s\n",message,function),\
   839 			DEBUGPRINT("Assertion failed: %s\nFunction: %s; called from: %08x\n",message,function,PRECOND_FUNCTION_CALLER),\
   829 			NKFault(function, 0)))
   840 			NKFault(function, 0)))
   830 
   841 
   831 #else//!__KERNEL_APIS_CONTEXT_CHECKS_FAULT__
   842 #else//!__KERNEL_APIS_CONTEXT_CHECKS_FAULT__
   832 /**
   843 /**
   833 @internalComponent
   844 @internalComponent
   834 */
   845 */
   835 #define __ASSERT_WITH_MESSAGE_DEBUG(cond,message,function) \
   846 #define __ASSERT_WITH_MESSAGE_DEBUG(cond,message,function) \
   836 			__ASSERT_DEBUG( (cond), \
   847 			__ASSERT_DEBUG( (cond), \
   837 			DEBUGPRINT("Assertion failed: %s\nFunction: %s\n",message,function))
   848 			DEBUGPRINT("Assertion failed: %s\nFunction: %s; called from: %08x\n",message,function,PRECOND_FUNCTION_CALLER))
   838 
   849 
   839 
   850 
   840 #endif//__KERNEL_APIS_CONTEXT_CHECKS_FAULT__
   851 #endif//__KERNEL_APIS_CONTEXT_CHECKS_FAULT__
   841 #endif//(!defined (__KERNEL_APIS_CONTEXT_CHECKS_WARNING__)&&!defined (__KERNEL_APIS_CONTEXT_CHECKS_FAULT__))
   852 #endif//(!defined (__KERNEL_APIS_CONTEXT_CHECKS_WARNING__)&&!defined (__KERNEL_APIS_CONTEXT_CHECKS_FAULT__))
   842 
   853 
   854 /**
   865 /**
   855 @internalComponent
   866 @internalComponent
   856 */
   867 */
   857 #define __ASSERT_WITH_MESSAGE_ALWAYS(cond,message,function) \
   868 #define __ASSERT_WITH_MESSAGE_ALWAYS(cond,message,function) \
   858 			__ASSERT_ALWAYS( (cond), ( \
   869 			__ASSERT_ALWAYS( (cond), ( \
   859 			DEBUGPRINT("Assertion failed: %s\nFunction: %s\n",message,function),\
   870 			DEBUGPRINT("Assertion failed: %s\nFunction: %s; called from: %08x\n",message,function,PRECOND_FUNCTION_CALLER),\
   860 			NKFault(function, 0)))
   871 			NKFault(function, 0)))
   861 #else
   872 #else
   862 /**
   873 /**
   863 @internalComponent
   874 @internalComponent
   864 */
   875 */
   865 #define __ASSERT_WITH_MESSAGE_ALWAYS(cond,message,function) \
   876 #define __ASSERT_WITH_MESSAGE_ALWAYS(cond,message,function) \
   866 			__ASSERT_ALWAYS( (cond), \
   877 			__ASSERT_ALWAYS( (cond), \
   867 			DEBUGPRINT("Assertion failed: %s\nFunction: %s\n",message,function))
   878 			DEBUGPRINT("Assertion failed: %s\nFunction: %s; called from: %08x\n",message,function,PRECOND_FUNCTION_CALLER))
   868 #endif//__KERNEL_APIS_CONTEXT_CHECKS_FAULT__
   879 #endif//__KERNEL_APIS_CONTEXT_CHECKS_FAULT__
   869 #endif//(!defined (__KERNEL_APIS_CONTEXT_CHECKS_WARNING__)&&!defined (__KERNEL_APIS_CONTEXT_CHECKS_FAULT__))
   880 #endif//(!defined (__KERNEL_APIS_CONTEXT_CHECKS_WARNING__)&&!defined (__KERNEL_APIS_CONTEXT_CHECKS_FAULT__))
   870 
   881 
   871 #endif
   882 #endif