PDK API Guide for AM65xx
QueueP.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-present, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
50 #ifndef ti_osal_QueueP__include
51 #define ti_osal_QueueP__include
52 
53 #include <stdbool.h>
54 #include <stdint.h>
55 #include <stddef.h>
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
64 typedef enum QueueP_Status_e
65 {
67  QueueP_OK = 0,
69  QueueP_FAILURE = (-(int32_t)1),
71 
75 typedef enum QueueP_State_e
76 {
81 } QueueP_State;
82 
89 typedef void *QueueP_Handle;
90 
98 typedef struct QueueP_Elem_s{
100  struct QueueP_Elem_s *next;
101 
103  struct QueueP_Elem_s *prev;
104 } QueueP_Elem;
105 
112 typedef struct QueueP_Params_s
113 {
114  void *pErrBlk;
115 } QueueP_Params;
116 
122 extern void QueueP_Params_init(QueueP_Params *params);
123 
131 extern QueueP_Handle QueueP_create(const QueueP_Params *params);
132 
143 
153 extern void * QueueP_get(QueueP_Handle handle);
154 
167  void *elem);
168 
179 
187 extern void * QueueP_getQPtr(QueueP_Handle handle);
188 
200 typedef struct {
202  struct Osal_QueueElem *next;
203 
205  struct Osal_QueueElem *prev;
207 
213 typedef void *Osal_Queue_Handle;
214 
224 void Osal_Queue_construct(void * structPtr, const void * queueParams);
233 Osal_Queue_Handle Osal_Queue_handle(void *structPtr);
234 
242 bool Osal_Queue_empty(Osal_Queue_Handle queueHandle);
243 
251 void * Osal_Queue_get(Osal_Queue_Handle queueHandle);
252 
261 void Osal_Queue_put(Osal_Queue_Handle queueHandle,Osal_Queue_Elem *ptr);
262 
263 #ifdef __cplusplus
264 }
265 #endif
266 
267 #endif /* ti_osal_QueueP__include */
268 /* @} */
void * Osal_Queue_get(Osal_Queue_Handle queueHandle)
Function to return the element at the front of the queue [NOTE: This will be obsolete in next release...
void QueueP_Params_init(QueueP_Params *params)
Initialize params structure to default values.
Basic QueueP Parameters.
Definition: QueueP.h:112
void Osal_Queue_construct(void *structPtr, const void *queueParams)
Function to construct the queue [NOTE: This will be obsolete in next release].
QueueP_Handle QueueP_create(const QueueP_Params *params)
Function to create a queue.
QueueP_Status QueueP_put(QueueP_Handle handle, void *elem)
Function to Put an element at end of queue.
Definition: QueueP.h:78
void * QueueP_Handle
Opaque client reference to an instance of a QueueP.
Definition: QueueP.h:89
QueueP_Status
Status codes for QueueP APIs.
Definition: QueueP.h:64
Definition: QueueP.h:67
struct Osal_QueueElem * prev
Definition: QueueP.h:205
void * QueueP_getQPtr(QueueP_Handle handle)
Function to get pointer to the queue.
Opaque QueueP element.
Definition: QueueP.h:98
struct QueueP_Elem_s * next
Definition: QueueP.h:100
void * QueueP_get(QueueP_Handle handle)
Function to Get the element at the front of the queue. This function removes an element from the fron...
struct QueueP_Elem_s * prev
Definition: QueueP.h:103
bool Osal_Queue_empty(Osal_Queue_Handle queueHandle)
Function to perform queue empty check [NOTE: This will be obsolete in next release].
Queue element.
Definition: QueueP.h:200
Definition: QueueP.h:69
QueueP_Status QueueP_delete(QueueP_Handle handle)
Function to delete a queue.
Definition: QueueP.h:80
QueueP_State QueueP_isEmpty(QueueP_Handle handle)
Function to perform queue empty check.
QueueP_State
State codes for current queue state.
Definition: QueueP.h:75
void * Osal_Queue_Handle
Definition: QueueP.h:213
Osal_Queue_Handle Osal_Queue_handle(void *structPtr)
Function to return the queue handle from the structure [NOTE: This will be obsolete in next release].
void Osal_Queue_put(Osal_Queue_Handle queueHandle, Osal_Queue_Elem *ptr)
Function to put the element to the queue [NOTE: This will be obsolete in next release].
void * pErrBlk
Definition: QueueP.h:114
struct Osal_QueueElem * next
Definition: QueueP.h:202