Xenomai 3.3.2
Loading...
Searching...
No Matches
internal.h
1/*
2 * Copyright (C) 2014 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 _TRANK_INTERNAL_H
19#define _TRANK_INTERNAL_H
20
21#include <pthread.h>
22#include <time.h>
23#include <signal.h>
24#include <xeno_config.h>
25
26struct trank_context {
27 timer_t periodic_timer;
28};
29
30#ifdef HAVE_TLS
31extern __thread __attribute__ ((tls_model (CONFIG_XENO_TLS_MODEL)))
32struct trank_context trank_context;
33
34static inline struct trank_context *trank_get_context(void)
35{
36 return &trank_context;
37}
38
39#else
40
41extern pthread_key_t trank_context_key;
42
43static inline struct trank_context *trank_get_context(void)
44{
45 return pthread_getspecific(trank_context_key);
46}
47
48#endif
49
50int trank_init_interface(void);
51
52extern sigset_t trank_sigperiod_set;
53
54#endif /* !_TRANK_INTERNAL_H */