GNU Linux-libre 4.14.262-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / hive_isp_css_include / host / event_fifo_public.h
1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 2015, Intel Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  */
14
15 #ifndef __EVENT_FIFO_PUBLIC_H
16 #define __EVENT_FIFO_PUBLIC_H
17
18 #include <type_support.h>
19 #include "system_types.h"
20
21 /*! Blocking read from an event source EVENT[ID]
22  
23  \param ID[in]                          EVENT identifier
24
25  \return none, dequeue(event_queue[ID])
26  */
27 STORAGE_CLASS_EVENT_H void event_wait_for(
28         const event_ID_t                ID);
29
30 /*! Conditional blocking wait for an event source EVENT[ID]
31  
32  \param ID[in]                          EVENT identifier
33  \param cnd[in]                         predicate
34
35  \return none, if(cnd) dequeue(event_queue[ID])
36  */
37 STORAGE_CLASS_EVENT_H void cnd_event_wait_for(
38         const event_ID_t                ID,
39         const bool                              cnd);
40
41 /*! Blocking read from an event source EVENT[ID]
42  
43  \param ID[in]                          EVENT identifier
44
45  \return dequeue(event_queue[ID])
46  */
47 STORAGE_CLASS_EVENT_H hrt_data event_receive_token(
48         const event_ID_t                ID);
49
50 /*! Blocking write to an event sink EVENT[ID]
51  
52  \param ID[in]                          EVENT identifier
53  \param token[in]                       token to be written on the event
54
55  \return none, enqueue(event_queue[ID])
56  */
57 STORAGE_CLASS_EVENT_H void event_send_token(
58         const event_ID_t                ID,
59         const hrt_data                  token);
60
61 /*! Query an event source EVENT[ID]
62  
63  \param ID[in]                          EVENT identifier
64
65  \return !isempty(event_queue[ID])
66  */
67 STORAGE_CLASS_EVENT_H bool is_event_pending(
68         const event_ID_t                ID);
69
70 /*! Query an event sink EVENT[ID]
71  
72  \param ID[in]                          EVENT identifier
73
74  \return !isfull(event_queue[ID])
75  */
76 STORAGE_CLASS_EVENT_H bool can_event_send_token(
77         const event_ID_t                ID);
78
79 #endif /* __EVENT_FIFO_PUBLIC_H */