blob: 9056c6d488b83398b1637ec15d35dcfd2e516bd4 [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001/*****************************************************************************
2* Copyright Statement:
3* --------------------
4* This software is protected by Copyright and the information contained
5* herein is confidential. The software may not be copied and the information
6* contained herein may not be used or disclosed except with the written
7* permission of MediaTek Inc. (C) 2005
8*
9* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
10* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
11* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
12* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
13* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
15* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
16* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
17* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
18* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
19* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
20* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
21*
22* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
23* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
24* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
25* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
26* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
27*
28* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
29* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
30* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
31* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
32* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
33*
34*****************************************************************************/
35
36/*****************************************************************************
37 *
38 * Filename:
39 * ---------
40 * lcd_ip_cqueue.h
41 *
42 * Project:
43 * --------
44 * Maui_Software
45 *
46 * Description:
47 * ------------
48 * This file defines Generic circular queue data structure definition
49 *
50 * Author:
51 * -------
52 * -------
53 *
54 *============================================================================
55 * HISTORY
56 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
57 *------------------------------------------------------------------------------
58 * removed!
59 * removed!
60 * removed!
61 *
62 * removed!
63 * removed!
64 * removed!
65 * removed!
66 *
67 * removed!
68 * removed!
69 * removed!
70 * removed!
71 *
72 * removed!
73 * removed!
74 * removed!
75 * removed!
76 *
77 * removed!
78 * removed!
79 * removed!
80 * removed!
81 *
82 * removed!
83 * removed!
84 * removed!
85 *
86 * removed!
87 * removed!
88 * removed!
89 *
90 * removed!
91 * removed!
92 * removed!
93 *
94 * removed!
95 * removed!
96 * removed!
97 *
98 * removed!
99 * removed!
100 * removed!
101 *
102 * removed!
103 * removed!
104 * removed!
105 *
106 * removed!
107 * removed!
108 * removed!
109 *
110 * removed!
111 * removed!
112 * removed!
113 *
114 * removed!
115 * removed!
116 * removed!
117 *
118 * removed!
119 * removed!
120 * removed!
121 * removed!
122 * removed!
123 * removed!
124 * removed!
125 * removed!
126 * removed!
127 * removed!
128 * removed!
129 * removed!
130 * removed!
131 * removed!
132 * removed!
133 * removed!
134 * removed!
135 *------------------------------------------------------------------------------
136 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
137 *============================================================================
138 ****************************************************************************/
139/*******************************************************************************
140* Copyright Statement:
141* --------------------
142* This software is protected by Copyright and the information contained
143* herein is confidential. The software may not be copied and the information
144* contained herein may not be used or disclosed except with the written
145* permission of MediaTek Inc. (C) 2002
146*
147*******************************************************************************/
148
149/*********************************************************************
150 (C) _____ (year of first publication) Sasken communication
151 Technologies Limited, All rights reserved.
152* This file provides a template for .c files. This space
153* should be used to describe the file contents
154* Component-specific prefix : xxxx
155*********************************************************************/
156
157#ifndef _LCD_IP_CQUEUE_H
158#define _LCD_IP_CQUEUE_H
159
160/*************************************************************************
161 * Include the common header file
162 *************************************************************************/
163#if defined(__MTK_TARGET__)
164#include "kal_itc.h"
165#else
166#include "kal_hrt_api.h"
167#endif
168
169/*************************************************************************
170 * Macros With Parameters
171 *************************************************************************/
172#if defined(__MTK_TARGET__)
173#define LCD_IP_CQUEUE_MT_LOCK(_lock) \
174 unsigned int irq_status = 0, mt_status = 0, prio = 0; \
175 KAL_ITC_LOCK_TAKE_DI_DMT_PRIO(_lock, irq_status, mt_status, prio)
176
177#define LCD_IP_CQUEUE_MT_UNLOCK(_lock) \
178 KAL_ITC_LOCK_GIVE_EI_EMT_PRIO((_lock), irq_status, mt_status, prio)
179#else
180#define LCD_IP_CQUEUE_MT_LOCK(_lock) \
181 kal_hrt_take_itc_lock(KAL_ITC_ISR_Q, KAL_INFINITE_WAIT)
182
183#define LCD_IP_CQUEUE_MT_UNLOCK(_lock) \
184 kal_hrt_give_itc_lock(KAL_ITC_ISR_Q)
185#endif
186
187/*************************************************************************
188* FUNCTION
189* LCD_IP_CQUEUE
190*
191* DESCRIPTION
192*
193* PARAMETERS
194* _type is the type of item to be put in queue.
195* _length is the size of the queue.
196*
197* RETURNS
198*
199* GLOBALS AFFECTED
200*
201*************************************************************************/
202
203#define LCD_IP_CQUEUE(_type, _length) \
204 struct { \
205 unsigned int head; \
206 unsigned int tail; \
207 unsigned int multiple; \
208 unsigned int max_used_item; \
209 unsigned int total_item; \
210 kal_bool is_full; \
211 _type queue[_length]; \
212 }
213
214/*************************************************************************
215* FUNCTION
216* LCD_IP_CQUEUE_INIT
217*
218* DESCRIPTION
219*
220* PARAMETERS
221* _q is the structure variable of the queue
222*
223* RETURNS
224*
225* GLOBALS AFFECTED
226*
227*************************************************************************/
228
229#define LCD_IP_CQUEUE_INIT(_q) \
230do{ \
231 (_q).head = (_q).tail = 0; \
232 (_q).multiple = 1; \
233 (_q).max_used_item = 0; \
234 (_q).total_item = (sizeof((_q).queue)*(_q).multiple / sizeof((_q).queue[0])); \
235 (_q).is_full = KAL_FALSE; \
236}while(0)
237
238#define LCD_IP_CQUEUE_INIT_N(_q, n) \
239do{ \
240 (_q).head = (_q).tail = 0; \
241 (_q).multiple = n; \
242 (_q).max_used_item = 0; \
243 (_q).total_item = (sizeof((_q).queue)*(_q).multiple / sizeof((_q).queue[0])); \
244 (_q).is_full = KAL_FALSE; \
245}while(0)
246
247/*************************************************************************
248* FUNCTION
249* LCD_IP_CQUEUE_INSERT
250*
251* DESCRIPTION
252*
253* PARAMETERS
254* _q is the structure variable of the queue
255* _item is the item to be inserted to the queue
256*
257* RETURNS
258*
259* GLOBALS AFFECTED
260*
261*************************************************************************/
262/* (_q).tail = ((_q).tail + 1) % (sizeof((_q).queue)*(_q).multiple/sizeof((_q).queue[0])); */
263#define LCD_IP_CQUEUE_INSERT(_q, _item) \
264do{ \
265 (_q).queue[(_q).tail] = _item; \
266 (_q).tail++; \
267 if ((_q).tail == (_q).total_item) \
268 (_q).tail = 0; \
269 if ((_q).head == (_q).tail) { (_q).is_full = KAL_TRUE; } \
270}while(0)
271
272/*************************************************************************
273* FUNCTION
274* LCD_IP_CQUEUE_INSERT_DISCARD
275*
276* DESCRIPTION
277*
278* PARAMETERS
279* _q is the structure variable of the queue
280*
281* RETURNS
282*
283* GLOBALS AFFECTED
284*
285*************************************************************************/
286
287#define LCD_IP_CQUEUE_INSERT_DISCARD(_q) \
288do{ \
289 /* (_q).queue[(_q).tail] = _item; */ \
290 (_q).tail++; \
291 if ((_q).tail == (_q).total_item) \
292 (_q).tail = 0; \
293 if ((_q).head == (_q).tail) { (_q).is_full = KAL_TRUE; } \
294}while(0)
295
296/*************************************************************************
297 * FUNCTION
298 * LCD_IP_CQUEUE_INSERT_HEAD
299 *
300 * DESCRIPTION
301 *
302 * PARAMETERS
303 * _q is the structure variable of the queue
304 * _item is the item to be inserted to the queue
305 *
306 * RETURNS
307 *
308 * GLOBALS AFFECTED
309 *
310 *************************************************************************/
311
312#define LCD_IP_CQUEUE_INSERT_HEAD(_q, _item) \
313do{ \
314 if((_q).head == 0) {(_q).head = (_q).total_item; } \
315 (_q).head--; \
316 (_q).queue[(_q).head] = _item; \
317 if ((_q).head == (_q).tail) { (_q).is_full = KAL_TRUE; } \
318}while(0)
319
320/*************************************************************************
321* FUNCTION
322* LCD_IP_CQUEUE_REMOVE
323*
324* DESCRIPTION
325*
326* PARAMETERS
327* _q is the structure variable of the queue
328* _item is the variable to which removed item is stored
329*
330* RETURNS
331*
332* GLOBALS AFFECTED
333*
334*************************************************************************/
335/*(_q).head = ((_q).head + 1) % (sizeof((_q).queue)*(_q).multiple/sizeof((_q).queue[0]));*/
336
337#define LCD_IP_CQUEUE_REMOVE(_q, _item) \
338do{ \
339 _item = (_q).queue[(_q).head]; \
340 (_q).head++; \
341 if((_q).head == (_q).total_item) \
342 (_q).head = 0; \
343 if ((_q).is_full == KAL_TRUE) \
344 (_q).is_full = KAL_FALSE; \
345}while(0)
346
347/*************************************************************************
348* FUNCTION
349* LCD_IP_CQUEUE_DISCARD
350*
351* DESCRIPTION
352* Just for removing last node from CQUEUE
353*
354* PARAMETERS
355* _q is the structure variable of the queue
356*
357* RETURNS
358*
359* GLOBALS AFFECTED
360*
361*************************************************************************/
362/*(_q).head = ((_q).head + 1) % (sizeof((_q).queue)*(_q).multiple/sizeof((_q).queue[0]));*/
363#define LCD_IP_CQUEUE_DISCARD(_q) \
364do{ \
365 /*_item = (_q).queue[(_q).head];*/ \
366 (_q).head++; \
367 if((_q).head == (_q).total_item) \
368 (_q).head = 0; \
369 if ((_q).is_full == KAL_TRUE) \
370 (_q).is_full = KAL_FALSE; \
371}while(0)
372
373/*************************************************************************
374* FUNCTION
375* LCD_IP_CQUEUE_NUM_OF_ITEMS
376*
377* DESCRIPTION
378*
379* PARAMETERS
380* _q is the structure variable of the queue
381* _num_of_items is the variable to which the
382* number of items in the queue is assigned
383*
384* RETURNS
385*
386* GLOBALS AFFECTED
387*
388*************************************************************************/
389
390#define LCD_IP_CQUEUE_NUM_OF_ITEMS(_q,_num_of_items) \
391do{ \
392 if((_q).is_full) \
393 _num_of_items = (_q).total_item; \
394 else if((_q).tail >= (_q).head) \
395 _num_of_items = (_q).tail - (_q).head; \
396 else \
397 _num_of_items = (_q).tail + (_q).total_item - (_q).head; \
398}while(0)
399
400#define LCD_IP_CQUEUE_RETURN_NUM_OF_ITEMS(_q) \
401 ((_q).is_full ? ((_q).total_item) : \
402 ((_q).tail >= (_q).head ? ((_q).tail - (_q).head) : \
403 ((_q).tail + (_q).total_item - (_q).head)))
404
405/*************************************************************************
406* FUNCTION
407* LCD_IP_CQUEUE_INDEX
408*
409* DESCRIPTION
410*
411* PARAMETERS
412* _q is the structure variable of the queue
413* _index is the index position of the queue from which queue item to be accessed
414* _item is the variable to which element at index is stored.
415*
416* RETURNS
417*
418* GLOBALS AFFECTED
419*
420*************************************************************************/
421
422#define LCD_IP_CQUEUE_INDEX(_q,_index,_item) \
423do{ \
424 if(((_q).head + _index) > ((_q).total_item - 1)) \
425 { \
426 /*user need to ensure index must be in scope [0,q->size-1], which is the valid-scope*/ \
427 ASSERT(((_q).head + _index - (_q).total_item) <= ((_q).total_item - 1)); \
428 _item = (_q).queue[(_q).head + _index - (_q).total_item]; \
429 } \
430 else \
431 _item = (_q).queue[(_q).head + _index]; \
432}while(0)
433
434
435#define LCD_IP_CQUEUE_UPDATE_MAX(_q, _max) \
436do{ \
437 LCD_IP_CQUEUE_NUM_OF_ITEMS(_q, _max); \
438 if (_max > (_q).max_used_item) \
439 { \
440 (_q).max_used_item = _max; \
441 } \
442 else if (_max < (_q).max_used_item) \
443 { \
444 _max = (_q).max_used_item; \
445 } \
446}while(0)
447
448#define LCD_UP_CQUEUE_UPDATE_MAX(_q, _max) LCD_IP_CQUEUE_UPDATE_MAX(_q, _max)
449
450/* _q is the structure variable of the queue */
451#define LCD_IP_CQUEUE_IS_FULL(_q) ((_q).is_full)
452#define LCD_IP_CQUEUE_IS_EMPTY(_q) (((_q).head == (_q).tail) && !(_q).is_full)
453
454/*************************************************************************
455* FUNCTION
456* LCD_IP_CQUEUE_MT
457*
458* DESCRIPTION
459*
460* PARAMETERS
461* _type is the type of item to be put in queue.
462* _length is the size of the queue.
463*
464* RETURNS
465*
466* GLOBALS AFFECTED
467*
468*************************************************************************/
469#define LCD_IP_CQUEUE_MT(_type, _length) \
470 struct { \
471 unsigned int head; \
472 unsigned int tail; \
473 unsigned int multiple; \
474 unsigned int max_used_item; \
475 unsigned int total_item; \
476 unsigned int lock_flag; \
477 kal_bool is_full; \
478 _type queue[_length]; \
479 }
480
481/*************************************************************************
482* FUNCTION
483* LCD_IP_CQUEUE_INIT_MT
484*
485* DESCRIPTION
486*
487* PARAMETERS
488* _q is the structure variable of the queue
489*
490* RETURNS
491*
492* GLOBALS AFFECTED
493*
494*************************************************************************/
495
496#define LCD_IP_CQUEUE_INIT_N_MT(_q, n) \
497 do{ \
498 (_q).head = (_q).tail = 0; \
499 (_q).multiple = n; \
500 (_q).max_used_item = 0; \
501 (_q).total_item = (sizeof((_q).queue)*(_q).multiple / sizeof((_q).queue[0])); \
502 (_q).lock_flag = 0; \
503 (_q).is_full = KAL_FALSE; \
504 }while(0)
505
506#define LCD_IP_CQUEUE_INIT_MT(_q) LCD_IP_CQUEUE_INIT_N_MT(_q, 1)
507
508/*************************************************************************
509* FUNCTION
510* LCD_IP_CQUEUE_INSERT_MT
511*
512* DESCRIPTION
513*
514* PARAMETERS
515* _q is the structure variable of the queue
516* _item is the item to be inserted to the queue
517* _is_full is the queue full flag before insert item
518*
519* RETURNS
520* _is_full
521*
522* GLOBALS AFFECTED
523*
524*************************************************************************/
525
526#define LCD_IP_CQUEUE_INSERT_MT(_q, _item, _is_full) \
527do{ \
528 LCD_IP_CQUEUE_MT_LOCK((_q).lock_flag); \
529 if (!LCD_IP_CQUEUE_IS_FULL(_q)) { \
530 _is_full = KAL_FALSE; \
531 LCD_IP_CQUEUE_INSERT(_q, _item); \
532 } else { \
533 _is_full = KAL_TRUE; \
534 } \
535 LCD_IP_CQUEUE_MT_UNLOCK((_q).lock_flag); \
536}while(0)
537
538
539/*************************************************************************
540* FUNCTION
541* LCD_IP_CQUEUE_INSERT_DISCARD_MT
542*
543* DESCRIPTION
544*
545* PARAMETERS
546* _q is the structure variable of the queue
547* _is_full is the queue full flag before insert item
548*
549* RETURNS
550*
551* GLOBALS AFFECTED
552*
553*************************************************************************/
554
555#define LCD_IP_CQUEUE_INSERT_DISCARD_MT(_q, _is_full) \
556do{ \
557 LCD_IP_CQUEUE_MT_LOCK((_q).lock_flag); \
558 if (!LCD_IP_CQUEUE_IS_FULL(_q)) { \
559 _is_full = KAL_FALSE; \
560 LCD_IP_CQUEUE_INSERT_DISCARD(_q); \
561 } else { \
562 _is_full = KAL_TRUE; \
563 } \
564 LCD_IP_CQUEUE_MT_UNLOCK((_q).lock_flag); \
565}while(0)
566
567
568/*************************************************************************
569 * FUNCTION
570 * LCD_IP_CQUEUE_INSERT_HEAD_MT
571 *
572 * DESCRIPTION
573 *
574 * PARAMETERS
575 * _q is the structure variable of the queue
576 * _item is the item to be inserted to the queue
577 * _is_full is the queue full flag before insert item
578 *
579 * RETURNS
580 * _is_full
581 *
582 * GLOBALS AFFECTED
583 *
584 *************************************************************************/
585
586#define LCD_IP_CQUEUE_INSERT_HEAD_MT(_q, _item, _is_full) \
587do{ \
588 LCD_IP_CQUEUE_MT_LOCK((_q).lock_flag); \
589 if (!LCD_IP_CQUEUE_IS_FULL(_q)) { \
590 _is_full = KAL_FALSE; \
591 LCD_IP_CQUEUE_INSERT_HEAD(_q, _item); \
592 } else { \
593 _is_full = KAL_TRUE; \
594 } \
595 LCD_IP_CQUEUE_MT_UNLOCK((_q).lock_flag); \
596}while(0)
597
598
599/*************************************************************************
600* FUNCTION
601* LCD_IP_CQUEUE_REMOVE_MT
602*
603* DESCRIPTION
604*
605* PARAMETERS
606* _q is the structure variable of the queue
607* _item is the variable to which removed item is stored
608* _is_empty is the queue empty flag before remove item
609*
610* RETURNS
611* _is_empty
612*
613* GLOBALS AFFECTED
614*
615*************************************************************************/
616
617#define LCD_IP_CQUEUE_REMOVE_MT(_q, _item, _is_empty) \
618do{ \
619 LCD_IP_CQUEUE_MT_LOCK((_q).lock_flag); \
620 if (!LCD_IP_CQUEUE_IS_EMPTY(_q)) { \
621 _is_empty = KAL_FALSE; \
622 LCD_IP_CQUEUE_REMOVE(_q, _item); \
623 } else { \
624 _is_empty = KAL_TRUE; \
625 } \
626 LCD_IP_CQUEUE_MT_UNLOCK((_q).lock_flag); \
627}while(0)
628
629/*************************************************************************
630* FUNCTION
631* LCD_IP_CQUEUE_DISCARD_MT
632*
633* DESCRIPTION
634* Just for removing last node from CQUEUE
635*
636* PARAMETERS
637* _q is the structure variable of the queue
638* _is_empty is the queue empty flag before remove item
639*
640* RETURNS
641* _is_empty
642*
643* GLOBALS AFFECTED
644*
645*************************************************************************/
646
647#define LCD_IP_CQUEUE_DISCARD_MT(_q, _is_empty) \
648do{ \
649 LCD_IP_CQUEUE_MT_LOCK((_q).lock_flag); \
650 if (!LCD_IP_CQUEUE_IS_EMPTY(_q)) { \
651 _is_empty = KAL_FALSE; \
652 LCD_IP_CQUEUE_DISCARD(_q); \
653 } else { \
654 _is_empty = KAL_TRUE; \
655 } \
656 LCD_IP_CQUEUE_MT_UNLOCK((_q).lock_flag); \
657}while(0)
658
659/*************************************************************************
660* FUNCTION
661* LCD_IP_CQUEUE_NUM_OF_ITEMS_MT
662*
663* DESCRIPTION
664*
665* PARAMETERS
666* _q is the structure variable of the queue
667* _num_of_items is the variable to which the
668* number of items in the queue is assigned
669*
670* RETURNS
671*
672* GLOBALS AFFECTED
673*
674*************************************************************************/
675
676#define LCD_IP_CQUEUE_NUM_OF_ITEMS_MT(_q,_num_of_items) \
677do{ \
678 LCD_IP_CQUEUE_MT_LOCK((_q).lock_flag); \
679 if((_q).is_full) \
680 _num_of_items = (_q).total_item; \
681 else if((_q).tail >= (_q).head) \
682 _num_of_items = (_q).tail - (_q).head; \
683 else \
684 _num_of_items = (_q).tail + (_q).total_item - (_q).head; \
685 LCD_IP_CQUEUE_MT_UNLOCK((_q).lock_flag); \
686}while(0)
687
688/*************************************************************************
689* FUNCTION
690* LCD_IP_CQUEUE_INDEX_MT
691*
692* DESCRIPTION
693*
694* PARAMETERS
695* _q is the structure variable of the queue
696* _index is the index position of the queue from which queue item to be accessed
697* _item is the variable to which element at index is stored.
698* _is_full is the queue full flag before insert item
699* _is_empty is the queue empty flag before remove item
700*
701* RETURNS
702* _is_full, _is_empty
703*
704* GLOBALS AFFECTED
705*
706*************************************************************************/
707
708#define LCD_IP_CQUEUE_INDEX_MT(_q,_index,_item, _is_full, _is_empty) \
709do{ \
710 LCD_IP_CQUEUE_MT_LOCK((_q).lock_flag); \
711 if (LCD_IP_CQUEUE_IS_FULL(_q)) \
712 _is_full = KAL_TRUE; \
713 else \
714 _is_full = KAL_FALSE; \
715 if (LCD_IP_CQUEUE_IS_EMPTY(_q) || (_index >= LCD_IP_CQUEUE_RETURN_NUM_OF_ITEMS(_q))) \
716 _is_empty = KAL_TRUE; \
717 else \
718 _is_empty = KAL_FALSE; \
719 LCD_IP_CQUEUE_INDEX(_q,_index,_item); \
720 LCD_IP_CQUEUE_MT_UNLOCK((_q).lock_flag); \
721}while(0)
722
723#define LCD_IP_CQUEUE_IS_FULL_MT(_q, _is_full) \
724do{ \
725 LCD_IP_CQUEUE_MT_LOCK((_q).lock_flag); \
726 _is_full = LCD_IP_CQUEUE_IS_FULL(_q); \
727 LCD_IP_CQUEUE_MT_UNLOCK((_q).lock_flag); \
728}while(0)
729
730#define LCD_IP_CQUEUE_IS_EMPTY_MT(_q, _is_empty) \
731do{ \
732 LCD_IP_CQUEUE_MT_LOCK((_q).lock_flag); \
733 _is_empty = LCD_IP_CQUEUE_IS_EMPTY(_q); \
734 LCD_IP_CQUEUE_MT_UNLOCK((_q).lock_flag); \
735}while(0)
736
737
738#endif /* _LCD_IP_CQUEUE_H */