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 /** NetX Component                                                        */
15 /**                                                                       */
16 /**   Trace                                                               */
17 /**                                                                       */
18 /**************************************************************************/
19 /**************************************************************************/
20 
21 #ifndef NX_SOURCE_CODE
22 #define NX_SOURCE_CODE
23 #endif
24 
25 /* Include necessary system files.  */
26 
27 #include "nx_api.h"
28 
29 
30 #ifdef TX_ENABLE_EVENT_TRACE
31 extern VOID _tx_trace_object_register(UCHAR, VOID *, CHAR *, ULONG, ULONG);
32 /**************************************************************************/
33 /*                                                                        */
34 /*  FUNCTION                                               RELEASE        */
35 /*                                                                        */
36 /*    _nx_trace_object_register                           PORTABLE C      */
37 /*                                                           6.1          */
38 /*  AUTHOR                                                                */
39 /*                                                                        */
40 /*    Yuxin Zhou, Microsoft Corporation                                   */
41 /*                                                                        */
42 /*  DESCRIPTION                                                           */
43 /*                                                                        */
44 /*    This function registers a NetX Duo object in the trace registry.    */
45 /*                                                                        */
46 /*  INPUT                                                                 */
47 /*                                                                        */
48 /*    object_type                           Type of system object         */
49 /*    object_ptr                            Address of system object      */
50 /*    object_name                           Name of system object         */
51 /*    parameter_1                           Supplemental parameter 1      */
52 /*    parameter_2                           Supplemental parameter 2      */
53 /*                                                                        */
54 /*  OUTPUT                                                                */
55 /*                                                                        */
56 /*    None                                                                */
57 /*                                                                        */
58 /*  CALLS                                                                 */
59 /*                                                                        */
60 /*    _tx_trace_object_register             Actual register function      */
61 /*                                                                        */
62 /*  CALLED BY                                                             */
63 /*                                                                        */
64 /*    Application Initialization                                          */
65 /*                                                                        */
66 /*  RELEASE HISTORY                                                       */
67 /*                                                                        */
68 /*    DATE              NAME                      DESCRIPTION             */
69 /*                                                                        */
70 /*  05-19-2020     Yuxin Zhou               Initial Version 6.0           */
71 /*  09-30-2020     Yuxin Zhou               Modified comment(s),          */
72 /*                                            resulting in version 6.1    */
73 /*                                                                        */
74 /**************************************************************************/
_nx_trace_object_register(UCHAR object_type,VOID * object_ptr,CHAR * object_name,ULONG parameter_1,ULONG parameter_2)75 VOID  _nx_trace_object_register(UCHAR object_type, VOID *object_ptr, CHAR *object_name, ULONG parameter_1, ULONG parameter_2)
76 {
77 
78 TX_INTERRUPT_SAVE_AREA
79 
80 
81     /* Disable interrupts.  */
82     TX_DISABLE
83 
84     /* Call actual object register function.  */
85     _tx_trace_object_register(object_type, object_ptr, object_name, parameter_1, parameter_2);
86 
87     /* Restore interrupts.  */
88     TX_RESTORE
89 }
90 #endif
91 
92