1 /**************************************************************************/
2 /*                                                                        */
3 /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4 /*                                                                        */
5 /*       This software is licensed under the Microsoft Software License   */
6 /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7 /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8 /*       and in the root directory of this software.                      */
9 /*                                                                        */
10 /**************************************************************************/
11 
12 
13 /**************************************************************************/
14 /**************************************************************************/
15 /**                                                                       */
16 /** ThreadX Component                                                     */
17 /**                                                                       */
18 /**   Module                                                              */
19 /**                                                                       */
20 /**************************************************************************/
21 /**************************************************************************/
22 
23 #define TXM_MODULE
24 #include "txm_module.h"
25 #ifndef TXM_EVENT_FLAGS_GET_CALL_NOT_USED
26 /**************************************************************************/
27 /*                                                                        */
28 /*  FUNCTION                                               RELEASE        */
29 /*                                                                        */
30 /*    _txe_event_flags_get                                PORTABLE C      */
31 /*                                                           6.1.10       */
32 /*  AUTHOR                                                                */
33 /*                                                                        */
34 /*    Scott Larson, Microsoft Corporation                                 */
35 /*                                                                        */
36 /*  DESCRIPTION                                                           */
37 /*                                                                        */
38 /*    This function checks for errors in the event flags get function     */
39 /*    call.                                                               */
40 /*                                                                        */
41 /*  INPUT                                                                 */
42 /*                                                                        */
43 /*    group_ptr                         Pointer to group control block    */
44 /*    requested_event_flags             Event flags requested             */
45 /*    get_option                        Specifies and/or and clear options*/
46 /*    actual_flags_ptr                  Pointer to place the actual flags */
47 /*                                        the service retrieved           */
48 /*    wait_option                       Suspension option                 */
49 /*                                                                        */
50 /*  OUTPUT                                                                */
51 /*                                                                        */
52 /*    TX_GROUP_ERROR                    Invalid event flags group pointer */
53 /*    TX_PTR_ERROR                      Invalid actual flags pointer      */
54 /*    TX_WAIT_ERROR                     Invalid wait option               */
55 /*    TX_OPTION_ERROR                   Invalid get option                */
56 /*    TX_CALLER_ERROR                   Invalid caller of this function   */
57 /*    status                            Actual completion status          */
58 /*                                                                        */
59 /*  CALLS                                                                 */
60 /*                                                                        */
61 /*    _txm_module_kernel_call_dispatcher                                  */
62 /*                                                                        */
63 /*  CALLED BY                                                             */
64 /*                                                                        */
65 /*    Module application code                                             */
66 /*                                                                        */
67 /*  RELEASE HISTORY                                                       */
68 /*                                                                        */
69 /*    DATE              NAME                      DESCRIPTION             */
70 /*                                                                        */
71 /*  09-30-2020      Scott Larson            Initial Version 6.1           */
72 /*  01-31-2022      Scott Larson            Modified comments and added   */
73 /*                                            CALL_NOT_USED option,       */
74 /*                                            resulting in version 6.1.10 */
75 /*                                                                        */
76 /**************************************************************************/
_txe_event_flags_get(TX_EVENT_FLAGS_GROUP * group_ptr,ULONG requested_flags,UINT get_option,ULONG * actual_flags_ptr,ULONG wait_option)77 UINT _txe_event_flags_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG requested_flags, UINT get_option, ULONG *actual_flags_ptr, ULONG wait_option)
78 {
79 
80 UINT return_value;
81 ALIGN_TYPE extra_parameters[3];
82 
83     extra_parameters[0] = (ALIGN_TYPE) get_option;
84     extra_parameters[1] = (ALIGN_TYPE) actual_flags_ptr;
85     extra_parameters[2] = (ALIGN_TYPE) wait_option;
86 
87     /* Call module manager dispatcher.  */
88     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);
89 
90     /* Return value to the caller.  */
91     return(return_value);
92 }
93 #endif
94