54 #if defined( __APPLE__ )
148 typedef CHECK_RETVAL_FNPTR \
153 #ifdef USE_CERTIFICATES
195 static
int dispatchManagementAction(
IN_ARRAY( mgmtFunctionCount ) \
206 REQUIRES( mgmtFunctionCount > 0 && \
217 for( i = 0; i < mgmtFunctionCount && \
218 mgmtFunctions[ i ] != NULL && \
221 const int localStatus = mgmtFunctions[ i ]( action );
223 status = localStatus;
230 ENSURES( i < FAILSAFE_ITERATIONS_MED );
250 ( void ) dispatchManagementAction( asyncInitFunctions,
264 static BOOLEAN buildSanityCheck(
void )
272 #if defined( CONFIG_DATA_LITTLEENDIAN ) || defined( CONFIG_DATA_BIGENDIAN )
273 #ifdef DATA_LITTLEENDIAN
274 if( *( (
long * )
"\x80\x00\x00\x00\x00\x00\x00\x00" ) < 0 )
276 if( *( (
long * )
"\x80\x00\x00\x00\x00\x00\x00\x00" ) >= 0 )
280 DEBUG_PRINT((
"CPU endianness is configured incorrectly, see "
281 "the cryptlib manual for details" ));
296 #if !defined( _MSC_VER )
301 DEBUG_PRINT((
"Compiler uses variable-length enumerated types, see "
302 "the cryptlib manual for details" ));
315 int initLevel = 0,
status;
328 if( !buildSanityCheck() )
347 DEBUG_DIAG((
"OS-specific initialisation failed" ));
354 status = dispatchManagementAction( preInitFunctions,
362 status = dispatchManagementAction( initFunctions,
388 status = krnlDispatchThread( threadedBind, NULL, NULL, 0,
399 status = dispatchManagementAction( asyncInitFunctions,
420 ( void ) dispatchManagementAction( preShutdownFunctions,
425 ( void ) dispatchManagementAction( shutdownFunctions,
459 ( void ) dispatchManagementAction( preShutdownFunctions,
464 ( void ) dispatchManagementAction( shutdownFunctions,