EM-ODP  3.7.0
Event Machine on ODP
em_eo_types.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, Nokia Solutions and Networks
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * * Neither the name of the copyright holder nor the names of its
15  * contributors may be used to endorse or promote products derived
16  * from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #ifndef EM_EO_TYPES_H_
32 #define EM_EO_TYPES_H_
33 
34 /**
35  * @file
36  * EM internal EO types & definitions
37  *
38  */
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 /**
45  * EM EO element
46  */
47 typedef struct {
48  /** EO name */
50  /** EO state */
52  /** EO start function */
54  /** EO core-local start function */
56  /** EO stop function */
58  /** EO core-local stop function */
60 
61  int use_multi_rcv; /* true:receive_multi_func(), false:receive_func() */
62  int max_events;
63  /** EO event receive function */
65  /** EO multi-event receive function */
67 
68  /** EO specific error handler function */
70  /** EO context data pointer */
71  void *eo_ctx;
72  /** EO elem lock */
73  env_spinlock_t lock;
74  /** EO queue list */
76  /** Number of queues */
78  /** Buffered events sent during the EO start-function */
79  odp_stash_t stash;
80  /** EO handle */
81  em_eo_t eo;
82  /** EO pool elem for linking free EOs for EO-alloc */
85 
86 /**
87  * EO EO element table
88  */
89 typedef struct {
90  /** EO element table */
92 } eo_tbl_t;
93 
94 typedef struct {
95  objpool_t objpool;
96 } eo_pool_t;
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 
102 #endif /* EM_EO_TYPES_H_ */
eo_elem_t::queue_list
list_node_t queue_list
Definition: em_eo_types.h:75
eo_pool_t
Definition: em_eo_types.h:94
eo_elem_t::receive_multi_func
em_receive_multi_func_t receive_multi_func
Definition: em_eo_types.h:66
eo_elem_t::eo_pool_elem
objpool_elem_t eo_pool_elem
Definition: em_eo_types.h:83
eo_elem_t::eo
em_eo_t eo
Definition: em_eo_types.h:81
eo_elem_t::eo_ctx
void * eo_ctx
Definition: em_eo_types.h:71
em_stop_func_t
em_status_t(* em_stop_func_t)(void *eo_ctx, em_eo_t eo)
Definition: event_machine_eo.h:301
eo_elem_t::num_queues
env_atomic32_t num_queues
Definition: em_eo_types.h:77
EM_MAX_EOS
#define EM_MAX_EOS
Definition: event_machine_config.h:149
eo_elem_t::stop_local_func
em_stop_local_func_t stop_local_func
Definition: em_eo_types.h:59
eo_elem_t::stop_func
em_stop_func_t stop_func
Definition: em_eo_types.h:57
list_node_t
Definition: list.h:42
eo_elem_t::error_handler_func
em_error_handler_t error_handler_func
Definition: em_eo_types.h:69
eo_elem_t
Definition: em_eo_types.h:47
em_start_func_t
em_status_t(* em_start_func_t)(void *eo_ctx, em_eo_t eo, const em_eo_conf_t *conf)
Definition: event_machine_eo.h:227
ENV_CACHE_LINE_ALIGNED
#define ENV_CACHE_LINE_ALIGNED
Definition: environment.h:76
EM_EO_NAME_LEN
#define EM_EO_NAME_LEN
Definition: event_machine_config.h:155
eo_elem_t::state
em_eo_state_t state
Definition: em_eo_types.h:51
eo_elem_t::ENV_CACHE_LINE_ALIGNED
char name[EM_EO_NAME_LEN] ENV_CACHE_LINE_ALIGNED
Definition: em_eo_types.h:49
em_start_local_func_t
em_status_t(* em_start_local_func_t)(void *eo_ctx, em_eo_t eo)
Definition: event_machine_eo.h:259
objpool_t
Definition: objpool.h:64
_env_atomic32
Definition: env_atomic.h:44
em_error_handler_t
em_status_t(* em_error_handler_t)(em_eo_t eo, em_status_t error, em_escope_t escope, va_list args)
Definition: event_machine_error.h:94
objpool_elem_t
Definition: objpool.h:48
em_receive_multi_func_t
void(* em_receive_multi_func_t)(void *eo_ctx, em_event_t events[], int num, em_queue_t queue, void *q_ctx)
Definition: event_machine_eo.h:189
eo_elem_t::lock
env_spinlock_t lock
Definition: em_eo_types.h:73
em_stop_local_func_t
em_status_t(* em_stop_local_func_t)(void *eo_ctx, em_eo_t eo)
Definition: event_machine_eo.h:280
eo_elem_t::start_local_func
em_start_local_func_t start_local_func
Definition: em_eo_types.h:55
em_receive_func_t
void(* em_receive_func_t)(void *eo_ctx, em_event_t event, em_event_type_t type, em_queue_t queue, void *q_ctx)
Definition: event_machine_eo.h:149
eo_elem_t::start_func
em_start_func_t start_func
Definition: em_eo_types.h:53
eo_tbl_t
Definition: em_eo_types.h:89
em_eo_state_t
em_eo_state_t
Definition: event_machine_types.h:295
eo_elem_t::receive_func
em_receive_func_t receive_func
Definition: em_eo_types.h:64
eo_elem_t::stash
odp_stash_t stash
Definition: em_eo_types.h:79