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_MUTEX_PERFORMANCE_INFO_GET_CALL_NOT_USED
25 /**************************************************************************/
26 /*                                                                        */
27 /*  FUNCTION                                               RELEASE        */
28 /*                                                                        */
29 /*    _tx_mutex_performance_info_get                      PORTABLE C      */
30 /*                                                           6.1.10       */
31 /*  AUTHOR                                                                */
32 /*                                                                        */
33 /*    Scott Larson, Microsoft Corporation                                 */
34 /*                                                                        */
35 /*  DESCRIPTION                                                           */
36 /*                                                                        */
37 /*    This function retrieves performance information from the specified  */
38 /*    mutex.                                                              */
39 /*                                                                        */
40 /*  INPUT                                                                 */
41 /*                                                                        */
42 /*    mutex_ptr                         Pointer to mutex control block    */
43 /*    puts                              Destination for the number of     */
44 /*                                        puts on to this mutex           */
45 /*    gets                              Destination for the number of     */
46 /*                                        gets on this mutex              */
47 /*    suspensions                       Destination for the number of     */
48 /*                                        suspensions on this mutex       */
49 /*    timeouts                          Destination for number of timeouts*/
50 /*                                        on this mutex                   */
51 /*    inversions                        Destination for number of priority*/
52 /*                                        inversions on this mutex        */
53 /*    inheritances                      Destination for number of priority*/
54 /*                                        inheritances on this mutex      */
55 /*                                                                        */
56 /*  OUTPUT                                                                */
57 /*                                                                        */
58 /*    status                            Completion status                 */
59 /*                                                                        */
60 /*  CALLS                                                                 */
61 /*                                                                        */
62 /*    _txm_module_kernel_call_dispatcher                                  */
63 /*                                                                        */
64 /*  CALLED BY                                                             */
65 /*                                                                        */
66 /*    Module application code                                             */
67 /*                                                                        */
68 /*  RELEASE HISTORY                                                       */
69 /*                                                                        */
70 /*    DATE              NAME                      DESCRIPTION             */
71 /*                                                                        */
72 /*  09-30-2020      Scott Larson            Initial Version 6.1           */
73 /*  01-31-2022      Scott Larson            Modified comments and added   */
74 /*                                            CALL_NOT_USED option,       */
75 /*                                            resulting in version 6.1.10 */
76 /*                                                                        */
77 /**************************************************************************/
_tx_mutex_performance_info_get(TX_MUTEX * mutex_ptr,ULONG * puts,ULONG * gets,ULONG * suspensions,ULONG * timeouts,ULONG * inversions,ULONG * inheritances)78 UINT _tx_mutex_performance_info_get(TX_MUTEX *mutex_ptr, ULONG *puts, ULONG *gets, ULONG *suspensions, ULONG *timeouts, ULONG *inversions, ULONG *inheritances)
79 {
80 
81 UINT return_value;
82 ALIGN_TYPE extra_parameters[5];
83 
84     extra_parameters[0] = (ALIGN_TYPE) gets;
85     extra_parameters[1] = (ALIGN_TYPE) suspensions;
86     extra_parameters[2] = (ALIGN_TYPE) timeouts;
87     extra_parameters[3] = (ALIGN_TYPE) inversions;
88     extra_parameters[4] = (ALIGN_TYPE) inheritances;
89 
90     /* Call module manager dispatcher.  */
91     return_value = (UINT) (_txm_module_kernel_call_dispatcher)(TXM_MUTEX_PERFORMANCE_INFO_GET_CALL, (ALIGN_TYPE) mutex_ptr, (ALIGN_TYPE) puts, (ALIGN_TYPE) extra_parameters);
92 
93     /* Return value to the caller.  */
94     return(return_value);
95 }
96 #endif
97