Song Zhao | c03ba12 | 2020-12-23 21:54:02 -0800 | [diff] [blame] | 1 | /* |
bo.xiao | 00387eb | 2023-02-24 18:44:29 +0800 | [diff] [blame] | 2 | * Copyright (C) 2021 Amlogic Corporation. |
Song Zhao | c03ba12 | 2020-12-23 21:54:02 -0800 | [diff] [blame] | 3 | * |
bo.xiao | 00387eb | 2023-02-24 18:44:29 +0800 | [diff] [blame] | 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 |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 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. |
Song Zhao | c03ba12 | 2020-12-23 21:54:02 -0800 | [diff] [blame] | 15 | * |
| 16 | * Description: fifo implementation |
| 17 | * Author: song.zhao@amlogic.com |
| 18 | */ |
| 19 | |
| 20 | #ifndef _AML_QUEUE_H_ |
| 21 | #define _AML_QUEUE_H_ |
| 22 | |
| 23 | #include <stdint.h> |
| 24 | |
| 25 | void* create_q(int max_len); |
| 26 | void destroy_q(void * queue); |
| 27 | int queue_item(void *queue, void * item); |
| 28 | /* cnt 0 for frist one in fifo, cnt 1 for 2nd one in fifo, etc */ |
| 29 | int peek_item(void *queue, void** p_item, uint32_t cnt); |
| 30 | int dqueue_item(void *queue, void** p_item); |
| 31 | int queue_size(void *queue); |
| 32 | |
| 33 | #endif |