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_SEMAPHORE_INFO_GET_CALL_NOT_USED
26 /**************************************************************************/
27 /* */
28 /* FUNCTION RELEASE */
29 /* */
30 /* _txe_semaphore_info_get PORTABLE C */
31 /* 6.1.10 */
32 /* AUTHOR */
33 /* */
34 /* Scott Larson, Microsoft Corporation */
35 /* */
36 /* DESCRIPTION */
37 /* */
38 /* This function checks for errors in the semaphore information get */
39 /* service. */
40 /* */
41 /* INPUT */
42 /* */
43 /* semaphore_ptr Pointer to semaphore control block*/
44 /* name Destination for the semaphore name*/
45 /* current_value Destination for current value of */
46 /* the semaphore */
47 /* first_suspended Destination for pointer of first */
48 /* thread suspended on semaphore */
49 /* suspended_count Destination for suspended count */
50 /* next_semaphore Destination for pointer to next */
51 /* semaphore on the created list */
52 /* */
53 /* OUTPUT */
54 /* */
55 /* TX_SEMAPHORE_ERROR Invalid semaphore pointer */
56 /* status Completion status */
57 /* */
58 /* CALLS */
59 /* */
60 /* _txm_module_kernel_call_dispatcher */
61 /* */
62 /* CALLED BY */
63 /* */
64 /* Module application code */
65 /* */
66 /* RELEASE HISTORY */
67 /* */
68 /* DATE NAME DESCRIPTION */
69 /* */
70 /* 09-30-2020 Scott Larson Initial Version 6.1 */
71 /* 01-31-2022 Scott Larson Modified comments and added */
72 /* CALL_NOT_USED option, */
73 /* resulting in version 6.1.10 */
74 /* */
75 /**************************************************************************/
_txe_semaphore_info_get(TX_SEMAPHORE * semaphore_ptr,CHAR ** name,ULONG * current_value,TX_THREAD ** first_suspended,ULONG * suspended_count,TX_SEMAPHORE ** next_semaphore)76 UINT _txe_semaphore_info_get(TX_SEMAPHORE *semaphore_ptr, CHAR **name, ULONG *current_value, TX_THREAD **first_suspended, ULONG *suspended_count, TX_SEMAPHORE **next_semaphore)
77 {
78
79 UINT return_value;
80 ALIGN_TYPE extra_parameters[4];
81
82 extra_parameters[0] = (ALIGN_TYPE) current_value;
83 extra_parameters[1] = (ALIGN_TYPE) first_suspended;
84 extra_parameters[2] = (ALIGN_TYPE) suspended_count;
85 extra_parameters[3] = (ALIGN_TYPE) next_semaphore;
86
87 /* Call module manager dispatcher. */
88 return_value = (UINT) (_txm_module_kernel_call_dispatcher)(TXM_SEMAPHORE_INFO_GET_CALL, (ALIGN_TYPE) semaphore_ptr, (ALIGN_TYPE) name, (ALIGN_TYPE) extra_parameters);
89
90 /* Return value to the caller. */
91 return(return_value);
92 }
93 #endif
94