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 /** Queue */
19 /** */
20 /**************************************************************************/
21 /**************************************************************************/
22
23 #define TX_SOURCE_CODE
24
25
26 /* Include necessary system files. */
27
28 #include "tx_api.h"
29 #include "tx_queue.h"
30
31
32 /**************************************************************************/
33 /* */
34 /* FUNCTION RELEASE */
35 /* */
36 /* _txe_queue_prioritize PORTABLE C */
37 /* 6.1 */
38 /* AUTHOR */
39 /* */
40 /* William E. Lamie, Microsoft Corporation */
41 /* */
42 /* DESCRIPTION */
43 /* */
44 /* This function checks for errors in the queue prioritize call. */
45 /* */
46 /* INPUT */
47 /* */
48 /* queue_ptr Pointer to queue control block */
49 /* */
50 /* OUTPUT */
51 /* */
52 /* status Completion status */
53 /* */
54 /* CALLS */
55 /* */
56 /* _tx_queue_prioritize Actual queue prioritize function */
57 /* */
58 /* CALLED BY */
59 /* */
60 /* Application Code */
61 /* */
62 /* RELEASE HISTORY */
63 /* */
64 /* DATE NAME DESCRIPTION */
65 /* */
66 /* 05-19-2020 William E. Lamie Initial Version 6.0 */
67 /* 09-30-2020 Yuxin Zhou Modified comment(s), */
68 /* resulting in version 6.1 */
69 /* */
70 /**************************************************************************/
_txe_queue_prioritize(TX_QUEUE * queue_ptr)71 UINT _txe_queue_prioritize(TX_QUEUE *queue_ptr)
72 {
73
74 UINT status;
75
76
77 /* Check for an invalid queue pointer. */
78 if (queue_ptr == TX_NULL)
79 {
80 /* Queue pointer is invalid, return appropriate error code. */
81 status = TX_QUEUE_ERROR;
82 }
83
84 /* Now check for invalid queue ID. */
85 else if (queue_ptr -> tx_queue_id != TX_QUEUE_ID)
86 {
87 /* Queue pointer is invalid, return appropriate error code. */
88 status = TX_QUEUE_ERROR;
89 }
90 else
91 {
92
93 /* Call actual queue prioritize function. */
94 status = _tx_queue_prioritize(queue_ptr);
95 }
96
97 /* Return completion status. */
98 return(status);
99 }
100
101