Add implementation for MPS assertion macros

Signed-off-by: Hanno Becker <hanno.becker@arm.com>
This commit is contained in:
Hanno Becker 2021-01-12 07:25:26 +00:00
parent 0ea0db4368
commit 75ac1f7b95

View File

@ -52,6 +52,24 @@
/*! This flag controls whether tracing for MPS should be enabled. */ /*! This flag controls whether tracing for MPS should be enabled. */
//#define MBEDTLS_MPS_TRACE //#define MBEDTLS_MPS_TRACE
#if defined(MBEDTLS_MPS_ENABLE_ASSERTIONS)
#define MBEDTLS_MPS_ASSERT_RAW( cond, string ) \
do \
{ \
if( !(cond) ) \
{ \
TRACE( trace_error, string ); \
RETURN( MBEDTLS_ERR_MPS_INTERNAL_ERROR ); \
} \
} while( 0 )
#else /* MBEDTLS_MPS_ENABLE_ASSERTIONS */
#define MBEDTLS_MPS_ASSERT_RAW( cond, string ) do {} while( 0 )
#endif /* MBEDTLS_MPS_ENABLE_ASSERTIONS */
/* \} name SECTION: MPS Configuration */ /* \} name SECTION: MPS Configuration */
/** /**