Xenomai  3.0-rc7
internal.h
1 /*
2  * Copyright (C) 2008 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 _LIB_COBALT_INTERNAL_H
19 #define _LIB_COBALT_INTERNAL_H
20 
21 #include <limits.h>
22 #include <cobalt/sys/cobalt.h>
23 #include <boilerplate/ancillaries.h>
24 #include "current.h"
25 
26 #define COBALT_STACKSIZE_DEFAULT (PTHREAD_STACK_MIN * 4)
27 
28 extern void *cobalt_umm_private;
29 
30 extern void *cobalt_umm_shared;
31 
32 void cobalt_sigshadow_install_once(void);
33 
34 static inline
35 struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow)
36 {
37  if (shadow->attr.pshared)
38  return cobalt_umm_shared + shadow->state_offset;
39 
40  return cobalt_umm_private + shadow->state_offset;
41 }
42 
43 static inline atomic_t *mutex_get_ownerp(struct cobalt_mutex_shadow *shadow)
44 {
45  return &mutex_get_state(shadow)->owner;
46 }
47 
48 void cobalt_thread_init(void);
49 
50 void cobalt_print_init(void);
51 
52 void cobalt_print_init_atfork(void);
53 
54 void cobalt_ticks_init(unsigned long long freq);
55 
56 void cobalt_default_mutexattr_init(void);
57 
58 void cobalt_default_condattr_init(void);
59 
60 int cobalt_init(void);
61 
62 struct cobalt_featinfo;
63 
64 void cobalt_check_features(struct cobalt_featinfo *finfo);
65 
66 extern struct sigaction __cobalt_orig_sigdebug;
67 
68 #endif /* _LIB_COBALT_INTERNAL_H */
Copyright © 2011 Gilles Chanteperdrix gilles.chanteperdrix@xenomai.org.
Definition: atomic.h:24