/* is called from OS specific driver entry point */ _mali_osk_errcode_t mali_kernel_constructor( void ) { _mali_osk_errcode_t err; err = mali_platform_init(); if (_MALI_OSK_ERR_OK != err) goto error1; err = _mali_osk_init(); if (_MALI_OSK_ERR_OK != err) goto error2; MALI_DEBUG_PRINT(2, ("\n")); MALI_DEBUG_PRINT(2, ("Inserting Mali v%d device driver. \n",_MALI_API_VERSION)); MALI_DEBUG_PRINT(2, ("Compiled: %s, time: %s.\n", __DATE__, __TIME__)); MALI_DEBUG_PRINT(2, ("Svn revision: %s\n", SVN_REV_STRING)); err = initialize_subsystems(); if (_MALI_OSK_ERR_OK != err) goto error3; MALI_PRINT(("Mali device driver %s loaded\n", SVN_REV_STRING)); MALI_SUCCESS; error3: MALI_PRINT(("Mali subsystems failed\n")); _mali_osk_term(); error2: MALI_PRINT(("Mali device driver init failed\n")); if (_MALI_OSK_ERR_OK != mali_platform_deinit()) { MALI_PRINT(("Failed to deinit platform\n")); } error1: MALI_PRINT(("Failed to init platform\n")); MALI_ERROR(err); }
static int run_server (int argc, char *argv[]) { int ret; initialize_subsystems(); fserve_initialize(); ret = server_init (argc, argv); if (ret == 0) server_process(); shutdown_subsystems(); return ret; }
int main (int argc, char *argv[]) { initialize_subsystems(); if (server_init (argc, argv) == 0) server_process(); shutdown_subsystems(); if (pidfile) { remove (pidfile); free (pidfile); } return 0; }