1 /***************************************************************************
2  * Copyright (c) 2024 Microsoft Corporation
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the MIT License which is available at
6  * https://opensource.org/licenses/MIT.
7  *
8  * SPDX-License-Identifier: MIT
9  **************************************************************************/
10 
11 
12 /**************************************************************************/
13 /**************************************************************************/
14 /**                                                                       */
15 /** ThreadX Component                                                     */
16 /**                                                                       */
17 /**   Module                                                              */
18 /**                                                                       */
19 /**************************************************************************/
20 /**************************************************************************/
21 
22 #define TXM_MODULE
23 #include "txm_module.h"
24 #ifndef TXM_THREAD_SYSTEM_SUSPEND_CALL_NOT_USED
25 /**************************************************************************/
26 /*                                                                        */
27 /*  FUNCTION                                               RELEASE        */
28 /*                                                                        */
29 /*    _tx_thread_system_suspend                           PORTABLE C      */
30 /*                                                           6.1.10       */
31 /*                                                                        */
32 /*  AUTHOR                                                                */
33 /*                                                                        */
34 /*    Scott Larson, Microsoft Corporation                                 */
35 /*                                                                        */
36 /*  DESCRIPTION                                                           */
37 /*                                                                        */
38 /*    This function suspends the specified thread and changes the thread  */
39 /*    state to the value specified.  Note: delayed suspension processing  */
40 /*    is handled outside of this routine.                                 */
41 /*                                                                        */
42 /*  INPUT                                                                 */
43 /*                                                                        */
44 /*    thread_ptr                            Pointer to thread to suspend  */
45 /*                                                                        */
46 /*  OUTPUT                                                                */
47 /*                                                                        */
48 /*    None                                                                */
49 /*                                                                        */
50 /*  CALLS                                                                 */
51 /*                                                                        */
52 /*    _txm_module_kernel_call_dispatcher                                  */
53 /*                                                                        */
54 /*  CALLED BY                                                             */
55 /*                                                                        */
56 /*    _tx_thread_priority_change            Thread priority change        */
57 /*    _tx_thread_shell_entry                Thread shell function         */
58 /*    _tx_thread_sleep                      Thread sleep                  */
59 /*    _tx_thread_suspend                    Application thread suspend    */
60 /*    _tx_thread_terminate                  Thread terminate              */
61 /*    Other ThreadX Components                                            */
62 /*                                                                        */
63 /*  RELEASE HISTORY                                                       */
64 /*                                                                        */
65 /*    DATE              NAME                      DESCRIPTION             */
66 /*                                                                        */
67 /*  09-30-2020      Scott Larson            Initial Version 6.1           */
68 /*  01-31-2022      Scott Larson            Modified comments and added   */
69 /*                                            CALL_NOT_USED option,       */
70 /*                                            resulting in version 6.1.10 */
71 /*                                                                        */
72 /**************************************************************************/
_txm_module_thread_system_suspend(TX_THREAD * thread_ptr)73 UINT _txm_module_thread_system_suspend(TX_THREAD *thread_ptr)
74 {
75 
76 UINT return_value;
77 
78     /* Call module manager dispatcher.  */
79     return_value = (UINT) (_txm_module_kernel_call_dispatcher)(TXM_THREAD_SYSTEM_SUSPEND_CALL, (ALIGN_TYPE) thread_ptr, 0, 0);
80 
81     /* Return value to the caller.  */
82     return(return_value);
83 }
84 #endif
85