1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Support for Intel Camera Imaging ISP subsystem. 4 * Copyright (c) 2015, Intel Corporation. 5 */ 6 7 #ifndef __EVENT_FIFO_PUBLIC_H 8 #define __EVENT_FIFO_PUBLIC_H 9 10 #include <type_support.h> 11 #include "system_local.h" 12 13 /*! Blocking read from an event source EVENT[ID] 14 15 \param ID[in] EVENT identifier 16 17 \return none, dequeue(event_queue[ID]) 18 */ 19 STORAGE_CLASS_EVENT_H void event_wait_for( 20 const event_ID_t ID); 21 22 /*! Conditional blocking wait for an event source EVENT[ID] 23 24 \param ID[in] EVENT identifier 25 \param cnd[in] predicate 26 27 \return none, if(cnd) dequeue(event_queue[ID]) 28 */ 29 STORAGE_CLASS_EVENT_H void cnd_event_wait_for( 30 const event_ID_t ID, 31 const bool cnd); 32 33 /*! Blocking read from an event source EVENT[ID] 34 35 \param ID[in] EVENT identifier 36 37 \return dequeue(event_queue[ID]) 38 */ 39 STORAGE_CLASS_EVENT_H hrt_data event_receive_token( 40 const event_ID_t ID); 41 42 /*! Blocking write to an event sink EVENT[ID] 43 44 \param ID[in] EVENT identifier 45 \param token[in] token to be written on the event 46 47 \return none, enqueue(event_queue[ID]) 48 */ 49 STORAGE_CLASS_EVENT_H void event_send_token( 50 const event_ID_t ID, 51 const hrt_data token); 52 53 /*! Query an event source EVENT[ID] 54 55 \param ID[in] EVENT identifier 56 57 \return !isempty(event_queue[ID]) 58 */ 59 STORAGE_CLASS_EVENT_H bool is_event_pending( 60 const event_ID_t ID); 61 62 /*! Query an event sink EVENT[ID] 63 64 \param ID[in] EVENT identifier 65 66 \return !isfull(event_queue[ID]) 67 */ 68 STORAGE_CLASS_EVENT_H bool can_event_send_token( 69 const event_ID_t ID); 70 71 #endif /* __EVENT_FIFO_PUBLIC_H */ 72