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