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_MODULE_OBJECT_POINTER_GET_CALL_NOT_USED
26 /**************************************************************************/
27 /*                                                                        */
28 /*  FUNCTION                                               RELEASE        */
29 /*                                                                        */
30 /*    _txm_module_manager_object_pointer_get              PORTABLE C      */
31 /*                                                           6.1.10       */
32 /*  AUTHOR                                                                */
33 /*                                                                        */
34 /*    Scott Larson, Microsoft Corporation                                 */
35 /*                                                                        */
36 /*  DESCRIPTION                                                           */
37 /*                                                                        */
38 /*    This function is deprecated and calls the secure version of this    */
39 /*    function (_txm_module_manager_object_pointer_get_extended) with the */
40 /*    maximum possible name length since none was passed.                 */
41 /*                                                                        */
42 /*  INPUT                                                                 */
43 /*                                                                        */
44 /*    object_type                       Type of object, as follows:       */
45 /*                                                                        */
46 /*                                          TXM_BLOCK_POOL_OBJECT         */
47 /*                                          TXM_BYTE_POOL_OBJECT          */
48 /*                                          TXM_EVENT_FLAGS_OBJECT        */
49 /*                                          TXM_MUTEX_OBJECT              */
50 /*                                          TXM_QUEUE_OBJECT              */
51 /*                                          TXM_SEMAPHORE_OBJECT          */
52 /*                                          TXM_THREAD_OBJECT             */
53 /*                                          TXM_TIMER_OBJECT              */
54 /*    name                              Name to search for                */
55 /*    object_ptr                        Pointer to the object             */
56 /*                                                                        */
57 /*  OUTPUT                                                                */
58 /*                                                                        */
59 /*    TX_SUCCESS                        Successful completion             */
60 /*    TX_PTR_ERROR                      Invalid name or object ptr        */
61 /*    TX_OPTION_ERROR                   Invalid option type               */
62 /*    TX_NO_INSTANCE                    Object not found                  */
63 /*                                                                        */
64 /*  CALLS                                                                 */
65 /*                                                                        */
66 /*    _txm_module_kernel_call_dispatcher                                  */
67 /*                                                                        */
68 /*  CALLED BY                                                             */
69 /*                                                                        */
70 /*    Module application code                                             */
71 /*                                                                        */
72 /*  RELEASE HISTORY                                                       */
73 /*                                                                        */
74 /*    DATE              NAME                      DESCRIPTION             */
75 /*                                                                        */
76 /*  09-30-2020      Scott Larson            Initial Version 6.1           */
77 /*  01-31-2022      Scott Larson            Modified comments and added   */
78 /*                                            CALL_NOT_USED option,       */
79 /*                                            resulting in version 6.1.10 */
80 /*                                                                        */
81 /**************************************************************************/
_txm_module_object_pointer_get(UINT object_type,CHAR * name,VOID ** object_ptr)82 UINT _txm_module_object_pointer_get(UINT object_type, CHAR *name, VOID **object_ptr)
83 {
84 
85 UINT return_value;
86 
87     /* Call module manager dispatcher.  */
88     return_value = (UINT) (_txm_module_kernel_call_dispatcher)(TXM_MODULE_OBJECT_POINTER_GET_CALL, (ALIGN_TYPE) object_type, (ALIGN_TYPE) name, (ALIGN_TYPE) object_ptr);
89 
90     /* Return value to the caller.  */
91     return(return_value);
92 }
93 #endif
94