GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_system_start.c Lines: 7 7 100.0 %
Date: 2026-03-06 19:21:09 Branches: 2 2 100.0 %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 * Copyright (c) 2026-present Eclipse ThreadX contributors
4
 *
5
 * This program and the accompanying materials are made available under the
6
 * terms of the MIT License which is available at
7
 * https://opensource.org/licenses/MIT.
8
 *
9
 * SPDX-License-Identifier: MIT
10
 **************************************************************************/
11
12
13
/**************************************************************************/
14
/**************************************************************************/
15
/**                                                                       */
16
/** GUIX Component                                                        */
17
/**                                                                       */
18
/**   System Management (System)                                          */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
/* Include necessary system files.  */
25
26
#include "gx_api.h"
27
#include "gx_system.h"
28
29
/**************************************************************************/
30
/*                                                                        */
31
/*  FUNCTION                                               RELEASE        */
32
/*                                                                        */
33
/*    _gx_system_start                                    PORTABLE C      */
34
/*                                                           6.1          */
35
/*  AUTHOR                                                                */
36
/*                                                                        */
37
/*    Kenneth Maxwell, Microsoft Corporation                              */
38
/*                                                                        */
39
/*  DESCRIPTION                                                           */
40
/*                                                                        */
41
/*    This service starts GUIX processing.                                */
42
/*                                                                        */
43
/*  INPUT                                                                 */
44
/*                                                                        */
45
/*    None                                                                */
46
/*                                                                        */
47
/*  OUTPUT                                                                */
48
/*                                                                        */
49
/*    status                                Completion status             */
50
/*                                                                        */
51
/*  CALLS                                                                 */
52
/*                                                                        */
53
/*    tx_thread_create                      Create system thread          */
54
/*    _gx_system_error_process              Process an error              */
55
/*    tx_queue_delete                       Delete a queue                */
56
/*    tx_mutex_delete                       Delete a mutex                */
57
/*                                                                        */
58
/*  CALLED BY                                                             */
59
/*                                                                        */
60
/*    Application Code                                                    */
61
/*                                                                        */
62
/**************************************************************************/
63
728
UINT  _gx_system_start(VOID)
64
{
65
UINT status;
66
67
#ifdef GX_THREADX_BINDING
68
728
    status =  tx_thread_resume(&_gx_system_thread);
69
70
    /* Determine if the system thread creation was successful.  */
71
728
    if (status == TX_SUCCESS)
72
    {
73
727
        status = GX_SUCCESS;
74
    }
75
    else
76
    {
77
        /* Thread create failed - call system error handler.  */
78
1
        _gx_system_error_process(GX_SYSTEM_THREAD_CREATE_FAILED);
79
80
        /* Return error!  */
81
1
        return(GX_SYSTEM_ERROR);
82
    }
83
#else
84
    status = GX_SYSTEM_THREAD_START(_gx_system_thread_entry);
85
#endif
86
87
    /* Return successful completion.  */
88
727
    return(status);
89
}
90