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 Manager                                                      */
19 /**                                                                       */
20 /**************************************************************************/
21 /**************************************************************************/
22 
23 #define TX_SOURCE_CODE
24 
25 #include "txm_module.h"
26 #include "txm_module_manager_util.h"
27 
28 /**************************************************************************/
29 /*                                                                        */
30 /*  FUNCTION                                               RELEASE        */
31 /*                                                                        */
32 /*    _txm_module_manager_object_pointer_get              PORTABLE C      */
33 /*                                                           6.1          */
34 /*  AUTHOR                                                                */
35 /*                                                                        */
36 /*    Scott Larson, Microsoft Corporation                                 */
37 /*                                                                        */
38 /*  DESCRIPTION                                                           */
39 /*                                                                        */
40 /*    This function is deprecated and calls the secure version of this    */
41 /*    function (_txm_module_manager_object_pointer_get_extended) with the */
42 /*    maximum possible name length since none was passed.                 */
43 /*                                                                        */
44 /*  INPUT                                                                 */
45 /*                                                                        */
46 /*    object_type                       Type of object, as follows:       */
47 /*                                                                        */
48 /*                                          TXM_BLOCK_POOL_OBJECT         */
49 /*                                          TXM_BYTE_POOL_OBJECT          */
50 /*                                          TXM_EVENT_FLAGS_OBJECT        */
51 /*                                          TXM_MUTEX_OBJECT              */
52 /*                                          TXM_QUEUE_OBJECT              */
53 /*                                          TXM_SEMAPHORE_OBJECT          */
54 /*                                          TXM_THREAD_OBJECT             */
55 /*                                          TXM_TIMER_OBJECT              */
56 /*    name                              Name to search for                */
57 /*    object_ptr                        Pointer to the object             */
58 /*                                                                        */
59 /*  OUTPUT                                                                */
60 /*                                                                        */
61 /*    TX_SUCCESS                        Successful completion             */
62 /*    TX_PTR_ERROR                      Invalid name or object ptr        */
63 /*    TX_OPTION_ERROR                   Invalid option type               */
64 /*    TX_NO_INSTANCE                    Object not found                  */
65 /*                                                                        */
66 /*  CALLS                                                                 */
67 /*                                                                        */
68 /*    _txm_module_manager_object_pointer_get_extended                     */
69 /*                                      Secure version of this function   */
70 /*                                                                        */
71 /*  CALLED BY                                                             */
72 /*                                                                        */
73 /*    Application code                                                    */
74 /*                                                                        */
75 /*  RELEASE HISTORY                                                       */
76 /*                                                                        */
77 /*    DATE              NAME                      DESCRIPTION             */
78 /*                                                                        */
79 /*  09-30-2020      Scott Larson            Initial Version 6.1           */
80 /*                                                                        */
81 /**************************************************************************/
_txm_module_manager_object_pointer_get(UINT object_type,CHAR * name,VOID ** object_ptr)82 UINT  _txm_module_manager_object_pointer_get(UINT object_type, CHAR *name, VOID **object_ptr)
83 {
84 
85 UINT    status;
86 
87     /* Call the secure version of this function with the maximum length
88        possible since none was passed.  */
89     status =  _txm_module_manager_object_pointer_get_extended(object_type, name, TXM_MODULE_MANAGER_UTIL_MAX_VALUE_OF_TYPE_UNSIGNED(UINT), object_ptr);
90     return(status);
91 }
92