Xenomai API  2.5.6.1
ksrc/skins/posix/sem.h
00001 /*
00002  * Written by Gilles Chanteperdrix <[email protected]>.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License as
00006  * published by the Free Software Foundation; either version 2 of the
00007  * License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 #ifndef _POSIX_SEM_H
00020 #define _POSIX_SEM_H
00021 
00022 #include <posix/thread.h>       /* For pse51_current_thread and
00023                                    pse51_thread_t definition. */
00024 #include <posix/registry.h>     /* For assocq */
00025 
00026 #ifdef CONFIG_XENO_OPT_PERVASIVE
00027 
00028 typedef struct {
00029     u_long uaddr;
00030     unsigned refcnt;
00031     pse51_assoc_t assoc;
00032 
00033 #define assoc2usem(laddr) \
00034     ((pse51_usem_t *)((unsigned long) (laddr) - offsetof(pse51_usem_t, assoc)))
00035 } pse51_usem_t;
00036 
00037 void pse51_sem_usems_cleanup(pse51_queues_t *q);
00038 
00039 #endif /* CONFIG_XENO_OPT_PERVASIVE */
00040 
00041 void pse51_semq_cleanup(pse51_kqueues_t *q);
00042 
00043 void pse51_sem_pkg_init(void);
00044 
00045 void pse51_sem_pkg_cleanup(void);
00046 
00047 #endif /* !_POSIX_SEM_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines