EM-ODP 4.4.0
Event Machine on ODP
Loading...
Searching...
No Matches
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#include <odp_api.h>
41
42#include <event_machine.h>
44
45#include "misc/list.h"
46#include "misc/objpool.h"
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52/**
53 * EM EO element
54 */
55typedef struct eo_elem_t {
56 /** EO name */
58 /** EO state */
60 /** EO start function */
62 /** EO core-local start function */
64 /** EO stop function */
66 /** EO core-local stop function */
68 /** EO local start function mode */
70 /** EO local stop function mode */
72 /** Is EO using multi-receive?: true:receive_multi_func(), false:receive_func() */
74 /** Max number of events passed to the receive-function: can be > 1 for multi-rcv */
76 /** EO event receive function */
78 /** EO multi-event receive function */
80
81 /** EO specific error handler function */
83 /** EO context data pointer */
84 void *eo_ctx;
85 /** EO elem lock */
86 odp_ticketlock_t lock;
87 /** EO queue list */
89 /** Number of queues */
90 odp_atomic_u32_t num_queues;
91 /** Buffered events sent during the EO start-function */
92 odp_stash_t stash;
93 /** EO handle */
94 em_eo_t eo;
95 /** EO pool elem for linking free EOs for EO-alloc */
98
99/**
100 * EO EO element table
101 */
102typedef struct {
103 /** EO element table */
105} eo_tbl_t;
106
107typedef struct {
108 objpool_t objpool;
109} eo_pool_t;
110
111#ifdef __cplusplus
112}
113#endif
114
115#endif /* EM_EO_TYPES_H_ */
struct eo_elem_t ENV_CACHE_LINE_ALIGNED
#define EM_EO_NAME_LEN
#define EM_MAX_EOS
em_eo_start_local_mode_t
em_eo_state_t
em_status_t(* em_start_local_func_t)(void *eo_ctx, em_eo_t eo)
void(* em_receive_func_t)(void *eo_ctx, em_event_t event, em_event_type_t type, em_queue_t queue, void *q_ctx)
em_status_t(* em_stop_func_t)(void *eo_ctx, em_eo_t eo)
em_eo_stop_local_mode_t
em_status_t(* em_stop_local_func_t)(void *eo_ctx, em_eo_t eo)
em_status_t(* em_start_func_t)(void *eo_ctx, em_eo_t eo, const em_eo_conf_t *conf)
void(* em_receive_multi_func_t)(void *eo_ctx, em_event_t events[], int num, em_queue_t queue, void *q_ctx)
em_status_t(* em_error_handler_t)(em_eo_t eo, em_status_t error, em_escope_t escope, va_list args)
objpool_elem_t eo_pool_elem
Definition em_eo_types.h:96
em_error_handler_t error_handler_func
Definition em_eo_types.h:82
em_eo_stop_local_mode_t stop_local_mode
Definition em_eo_types.h:71
em_receive_func_t receive_func
Definition em_eo_types.h:77
char name[EM_EO_NAME_LEN] ENV_CACHE_LINE_ALIGNED
Definition em_eo_types.h:57
em_stop_func_t stop_func
Definition em_eo_types.h:65
odp_ticketlock_t lock
Definition em_eo_types.h:86
em_eo_state_t state
Definition em_eo_types.h:59
em_stop_local_func_t stop_local_func
Definition em_eo_types.h:67
int max_events
Definition em_eo_types.h:75
list_node_t queue_list
Definition em_eo_types.h:88
em_receive_multi_func_t receive_multi_func
Definition em_eo_types.h:79
odp_atomic_u32_t num_queues
Definition em_eo_types.h:90
em_eo_start_local_mode_t start_local_mode
Definition em_eo_types.h:69
em_start_func_t start_func
Definition em_eo_types.h:61
odp_stash_t stash
Definition em_eo_types.h:92
em_start_local_func_t start_local_func
Definition em_eo_types.h:63
int use_multi_rcv
Definition em_eo_types.h:73
em_eo_t eo
Definition em_eo_types.h:94
void * eo_ctx
Definition em_eo_types.h:84