Xenomai 3.3.2
Loading...
Searching...
No Matches
tunables.h
1/*
2 * Copyright (C) 2015 Philippe Gerum <rpm@xenomai.org>.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17 */
18#ifndef _COPPERPLATE_TUNABLES_H
19#define _COPPERPLATE_TUNABLES_H
20
21#include <boilerplate/tunables.h>
22
23struct copperplate_setup_data {
24 const char *session_root;
25 const char *session_label;
26 const char *registry_root;
27 int no_registry;
28 int shared_registry;
29 size_t mem_pool;
30 gid_t session_gid;
31};
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37extern struct copperplate_setup_data __copperplate_setup_data;
38
39define_config_tunable(session_label, const char *, label);
40
41static inline read_config_tunable(session_label, const char *)
42{
43 return __copperplate_setup_data.session_label;
44}
45
46static inline define_config_tunable(registry_root, const char *, root)
47{
48 __copperplate_setup_data.registry_root = root;
49}
50
51static inline read_config_tunable(registry_root, const char *)
52{
53 return __copperplate_setup_data.registry_root;
54}
55
56static inline define_config_tunable(no_registry, int, noreg)
57{
58 __copperplate_setup_data.no_registry = noreg;
59}
60
61static inline read_config_tunable(no_registry, int)
62{
63 return __copperplate_setup_data.no_registry;
64}
65
66static inline define_config_tunable(shared_registry, int, shared)
67{
68 __copperplate_setup_data.shared_registry = shared;
69}
70
71static inline read_config_tunable(shared_registry, int)
72{
73 return __copperplate_setup_data.shared_registry;
74}
75
76static inline define_config_tunable(mem_pool_size, size_t, size)
77{
78 __copperplate_setup_data.mem_pool = size;
79}
80
81static inline read_config_tunable(mem_pool_size, size_t)
82{
83 return __copperplate_setup_data.mem_pool;
84}
85
86static inline define_config_tunable(session_gid, gid_t, gid)
87{
88 __copperplate_setup_data.session_gid = gid;
89}
90
91static inline read_config_tunable(session_gid, gid_t)
92{
93 return __copperplate_setup_data.session_gid;
94}
95
96#ifdef __cplusplus
97}
98#endif
99
100#endif /* !_COPPERPLATE_TUNABLES_H */