Xenomai  3.0.8
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 
23 struct 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
34 extern "C" {
35 #endif
36 
37 extern struct copperplate_setup_data __copperplate_setup_data;
38 
39 define_config_tunable(session_label, const char *, label);
40 
41 static inline read_config_tunable(session_label, const char *)
42 {
43  return __copperplate_setup_data.session_label;
44 }
45 
46 static inline define_config_tunable(registry_root, const char *, root)
47 {
48  __copperplate_setup_data.registry_root = root;
49 }
50 
51 static inline read_config_tunable(registry_root, const char *)
52 {
53  return __copperplate_setup_data.registry_root;
54 }
55 
56 static inline define_config_tunable(no_registry, int, noreg)
57 {
58  __copperplate_setup_data.no_registry = noreg;
59 }
60 
61 static inline read_config_tunable(no_registry, int)
62 {
63  return __copperplate_setup_data.no_registry;
64 }
65 
66 static inline define_config_tunable(shared_registry, int, shared)
67 {
68  __copperplate_setup_data.shared_registry = shared;
69 }
70 
71 static inline read_config_tunable(shared_registry, int)
72 {
73  return __copperplate_setup_data.shared_registry;
74 }
75 
76 static inline define_config_tunable(mem_pool_size, size_t, size)
77 {
78  __copperplate_setup_data.mem_pool = size;
79 }
80 
81 static inline read_config_tunable(mem_pool_size, size_t)
82 {
83  return __copperplate_setup_data.mem_pool;
84 }
85 
86 static inline define_config_tunable(session_gid, gid_t, gid)
87 {
88  __copperplate_setup_data.session_gid = gid;
89 }
90 
91 static 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 */