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_EVENT_FLAGS_GET_CALL_NOT_USED
25 /**************************************************************************/
26 /*                                                                        */
27 /*  FUNCTION                                               RELEASE        */
28 /*                                                                        */
29 /*    _txe_event_flags_get                                PORTABLE C      */
30 /*                                                           6.1.10       */
31 /*  AUTHOR                                                                */
32 /*                                                                        */
33 /*    Scott Larson, Microsoft Corporation                                 */
34 /*                                                                        */
35 /*  DESCRIPTION                                                           */
36 /*                                                                        */
37 /*    This function checks for errors in the event flags get function     */
38 /*    call.                                                               */
39 /*                                                                        */
40 /*  INPUT                                                                 */
41 /*                                                                        */
42 /*    group_ptr                         Pointer to group control block    */
43 /*    requested_event_flags             Event flags requested             */
44 /*    get_option                        Specifies and/or and clear options*/
45 /*    actual_flags_ptr                  Pointer to place the actual flags */
46 /*                                        the service retrieved           */
47 /*    wait_option                       Suspension option                 */
48 /*                                                                        */
49 /*  OUTPUT                                                                */
50 /*                                                                        */
51 /*    TX_GROUP_ERROR                    Invalid event flags group pointer */
52 /*    TX_PTR_ERROR                      Invalid actual flags pointer      */
53 /*    TX_WAIT_ERROR                     Invalid wait option               */
54 /*    TX_OPTION_ERROR                   Invalid get option                */
55 /*    TX_CALLER_ERROR                   Invalid caller of this function   */
56 /*    status                            Actual completion status          */
57 /*                                                                        */
58 /*  CALLS                                                                 */
59 /*                                                                        */
60 /*    _txm_module_kernel_call_dispatcher                                  */
61 /*                                                                        */
62 /*  CALLED BY                                                             */
63 /*                                                                        */
64 /*    Module application code                                             */
65 /*                                                                        */
66 /*  RELEASE HISTORY                                                       */
67 /*                                                                        */
68 /*    DATE              NAME                      DESCRIPTION             */
69 /*                                                                        */
70 /*  09-30-2020      Scott Larson            Initial Version 6.1           */
71 /*  01-31-2022      Scott Larson            Modified comments and added   */
72 /*                                            CALL_NOT_USED option,       */
73 /*                                            resulting in version 6.1.10 */
74 /*                                                                        */
75 /**************************************************************************/
_txe_event_flags_get(TX_EVENT_FLAGS_GROUP * group_ptr,ULONG requested_flags,UINT get_option,ULONG * actual_flags_ptr,ULONG wait_option)76 UINT _txe_event_flags_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG requested_flags, UINT get_option, ULONG *actual_flags_ptr, ULONG wait_option)
77 {
78 
79 UINT return_value;
80 ALIGN_TYPE extra_parameters[3];
81 
82     extra_parameters[0] = (ALIGN_TYPE) get_option;
83     extra_parameters[1] = (ALIGN_TYPE) actual_flags_ptr;
84     extra_parameters[2] = (ALIGN_TYPE) wait_option;
85 
86     /* Call module manager dispatcher.  */
87     return_value = (UINT) (_txm_module_kernel_call_dispatcher)(TXM_EVENT_FLAGS_GET_CALL, (ALIGN_TYPE) group_ptr, (ALIGN_TYPE) requested_flags, (ALIGN_TYPE) extra_parameters);
88 
89     /* Return value to the caller.  */
90     return(return_value);
91 }
92 #endif
93