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