/*************************************************************************** * Copyright (c) 2024 Microsoft Corporation * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: MIT **************************************************************************/ /**************************************************************************/ /**************************************************************************/ /** */ /** GUIX Component */ /** */ /** System Management (System) */ /** */ /**************************************************************************/ #define GX_SOURCE_CODE /* Include necessary system files. */ #include "gx_api.h" #include "gx_system.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _gx_system_start PORTABLE C */ /* 6.1 */ /* AUTHOR */ /* */ /* Kenneth Maxwell, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This service starts GUIX processing. */ /* */ /* INPUT */ /* */ /* None */ /* */ /* OUTPUT */ /* */ /* status Completion status */ /* */ /* CALLS */ /* */ /* tx_thread_create Create system thread */ /* _gx_system_error_process Process an error */ /* tx_queue_delete Delete a queue */ /* tx_mutex_delete Delete a mutex */ /* */ /* CALLED BY */ /* */ /* Application Code */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */ /* 09-30-2020 Kenneth Maxwell Modified comment(s), */ /* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _gx_system_start(VOID) { UINT status; #ifdef GX_THREADX_BINDING status = tx_thread_resume(&_gx_system_thread); /* Determine if the system thread creation was successful. */ if (status == TX_SUCCESS) { status = GX_SUCCESS; } else { /* Thread create failed - call system error handler. */ _gx_system_error_process(GX_SYSTEM_THREAD_CREATE_FAILED); /* Return error! */ return(GX_SYSTEM_ERROR); } #else status = GX_SYSTEM_THREAD_START(_gx_system_thread_entry); #endif /* Return successful completion. */ return(status); }