Xenomai API  2.6.5
sem.h
1 /*
2  * Written by Gilles Chanteperdrix <[email protected]>.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or (at your option) any later version.
8  *
9  * This program 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
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  */
18 
19 #ifndef _POSIX_SEM_H
20 #define _POSIX_SEM_H
21 
22 #include <posix/thread.h> /* For pse51_current_thread and
23  pse51_thread_t definition. */
24 #include <posix/registry.h> /* For assocq */
25 
26 #ifdef CONFIG_XENO_OPT_PERVASIVE
27 
28 typedef struct {
29  u_long uaddr;
30  unsigned refcnt;
31  pse51_assoc_t assoc;
32 
33 #define assoc2usem(laddr) \
34  ((pse51_usem_t *)((unsigned long) (laddr) - offsetof(pse51_usem_t, assoc)))
35 } pse51_usem_t;
36 
37 void pse51_sem_usems_cleanup(pse51_queues_t *q);
38 
39 #endif /* CONFIG_XENO_OPT_PERVASIVE */
40 
41 void pse51_semq_cleanup(pse51_kqueues_t *q);
42 
43 void pse51_sem_pkg_init(void);
44 
45 void pse51_sem_pkg_cleanup(void);
46 
47 #endif /* !_POSIX_SEM_H */