EM-ODP 4.4.0
Event Machine on ODP
Loading...
Searching...
No Matches
em_pool.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_POOL_H_
32#define EM_POOL_H_
33
34/**
35 * @file
36 * EM internal event pool functions
37 *
38 */
39
40#include <stdint.h>
41
42#include <odp_api.h>
43
44#include <event_machine.h>
45
46#include "em_pool_inline.h"
47#include "em_pool_types.h"
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
53#define valid_pool(pool) ((unsigned int)pool_hdl2idx((pool)) < \
54 EM_CONFIG_POOLS)
55#define invalid_pool(pool) ((unsigned int)pool_hdl2idx((pool)) > \
56 EM_CONFIG_POOLS - 1)
57
58int invalid_pool_cfg(const em_pool_cfg_t *pool_cfg, const char **err_str/*out*/);
59
60int check_pool_uarea_persistence(const em_pool_cfg_t *pool_cfg, const char **err_str/*out*/);
61
63pool_init(mpool_tbl_t *const mpool_tbl, mpool_pool_t *const mpool_pool,
64 const em_pool_cfg_t *default_pool_cfg);
65
67pool_term(const mpool_tbl_t *pool_tbl);
68
69em_pool_t
70pool_create(const char *name, em_pool_t req_pool, const em_pool_cfg_t *pool_cfg);
71
73pool_delete(em_pool_t pool);
74
75em_pool_t
76pool_find(const char *name);
77
78void pool_info_print_hdr(unsigned int num_pools);
79void pool_info_print(em_pool_t pool);
80void pool_stats_opt_print_hdr(void);
81void pool_stats_opt_print(em_pool_t pool);
82void pool_stats_opt_odp2em(em_pool_stats_opt_t *em_stats_opt /*out*/,
83 const odp_pool_stats_opt_t *odp_stats_opt);
84
85void pool_stats_print(em_pool_t pool);
86
87void subpools_stats_print(em_pool_t pool, const int subpools[], int num_subpools);
88void pool_stats_selected_print(em_pool_t pool, const em_pool_stats_opt_t *opt);
89void subpools_stats_selected_print(em_pool_t pool, const int subpools[],
90 int num_subpools, const em_pool_stats_opt_t *opt);
91
92void print_pool_elem_info(void);
93
94uint32_t align_offset_get(const em_pool_cfg_t *pool_cfg);
95uint32_t odp_align_get(const em_pool_cfg_t *pool_cfg);
96
97unsigned int pool_count(void);
98
99#ifdef __cplusplus
100}
101#endif
102
103#endif /* EM_POOL_H_ */
uint32_t em_status_t