2 * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 #ifndef __STATIC_QUEUE__
17 #define __STATIC_QUEUE__
19 typedef struct sqbuffer sqbuffer;
20 typedef struct static_queue sq;
22 sq *create_static_queue(int bytes, int count);
23 void destory_static_queue(sq *q);
25 sqbuffer *sq_get_node(sq *q);
26 void sq_put_node(sqbuffer *b);
27 unsigned char *sq_get_buffer(sqbuffer *sqb);
28 int sq_enqueue_node(sq *q, sqbuffer *b);
29 sqbuffer *sq_dequeue_node(sq *q);
33 sqbuffer *sq_get_node_lock(sq *q);
34 void sq_put_node_lock(sqbuffer *b);
35 int sq_enqueue_node_lock(sq *q, sqbuffer *b);
36 sqbuffer *sq_dequeue_node_lock(sq *q);
37 void sq_flush_lock(sq *q);
39 int sq_is_empty(sq *q);
40 int sq_is_empty_lock(sq *q);
41 int sq_get_work_node_count(sq *q);
43 #endif // __STATIC_QUEUE__