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_TRACE_ENABLE_CALL_NOT_USED
25 /**************************************************************************/
26 /*                                                                        */
27 /*  FUNCTION                                               RELEASE        */
28 /*                                                                        */
29 /*    _tx_trace_enable                                    PORTABLE C      */
30 /*                                                           6.1.10       */
31 /*  AUTHOR                                                                */
32 /*                                                                        */
33 /*    Scott Larson, Microsoft Corporation                                 */
34 /*                                                                        */
35 /*  DESCRIPTION                                                           */
36 /*                                                                        */
37 /*    This function initializes the ThreadX trace buffer and the          */
38 /*    associated control variables, enabling it for operation.            */
39 /*                                                                        */
40 /*  INPUT                                                                 */
41 /*                                                                        */
42 /*    trace_buffer_start                    Start of trace buffer         */
43 /*    trace_buffer_size                     Size (bytes) of trace buffer  */
44 /*    registry_entries                      Number of object registry     */
45 /*                                            entries.                    */
46 /*                                                                        */
47 /*  OUTPUT                                                                */
48 /*                                                                        */
49 /*    Completion Status                                                   */
50 /*                                                                        */
51 /*  CALLS                                                                 */
52 /*                                                                        */
53 /*    _txm_module_kernel_call_dispatcher                                  */
54 /*                                                                        */
55 /*  CALLED BY                                                             */
56 /*                                                                        */
57 /*    Module application code                                             */
58 /*                                                                        */
59 /*  RELEASE HISTORY                                                       */
60 /*                                                                        */
61 /*    DATE              NAME                      DESCRIPTION             */
62 /*                                                                        */
63 /*  09-30-2020      Scott Larson            Initial Version 6.1           */
64 /*  01-31-2022      Scott Larson            Modified comments and added   */
65 /*                                            CALL_NOT_USED option,       */
66 /*                                            resulting in version 6.1.10 */
67 /*                                                                        */
68 /**************************************************************************/
_tx_trace_enable(VOID * trace_buffer_start,ULONG trace_buffer_size,ULONG registry_entries)69 UINT _tx_trace_enable(VOID *trace_buffer_start, ULONG trace_buffer_size, ULONG registry_entries)
70 {
71 
72 UINT return_value;
73 
74     /* Call module manager dispatcher.  */
75     return_value = (UINT) (_txm_module_kernel_call_dispatcher)(TXM_TRACE_ENABLE_CALL, (ALIGN_TYPE) trace_buffer_start, (ALIGN_TYPE) trace_buffer_size, (ALIGN_TYPE) registry_entries);
76 
77     /* Return value to the caller.  */
78     return(return_value);
79 }
80 #endif
81