/usr/include/xenomai/rtai/sem.h is in libxenomai-dev 2.5.5.2-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | /**
*
* @note Copyright (C) 2004 Philippe Gerum <rpm@xenomai.org>
* @note Copyright (C) 2005 Nextream France S.A.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _RTAI_SEM_H
#define _RTAI_SEM_H
#include <rtai/types.h>
typedef struct rt_sem_placeholder {
xnhandle_t opaque;
} RT_SEM_PLACEHOLDER;
#define BIN_SEM 0x1
#define CNT_SEM 0x2
#define RES_SEM 0x3
#if defined(__KERNEL__) || defined(__XENO_SIM__)
#define RTAI_SEM_MAGIC 0x17170202
#define PRIO_Q 0x0
#define RES_Q 0x3
#define FIFO_Q 0x4
#define SEM_TIMOUT 0xfffe
#define SEM_ERR 0xffff
struct rt_task_struct;
typedef struct rt_semaphore {
unsigned magic; /* !< Magic code - must be first */
xnsynch_t synch_base; /* !< Base synchronization object. */
int count; /* !< Current semaphore value. */
int type; /* !< Semaphore type. */
struct rt_task_struct *owner; /* !< Current owner of a resource sem. */
} SEM;
#ifdef __cplusplus
extern "C" {
#endif
int __rtai_sem_pkg_init(void);
void __rtai_sem_pkg_cleanup(void);
int __rtai_sem_delete(SEM *sem);
static inline int rt_sem_delete(SEM *sem)
{
return __rtai_sem_delete(sem);
}
#ifdef __cplusplus
}
#endif
#else /* !(__KERNEL__ || __XENO_SIM__) */
typedef RT_SEM_PLACEHOLDER SEM;
#ifdef __cplusplus
extern "C" {
#endif
int rt_sem_delete(SEM *sem);
#ifdef __cplusplus
}
#endif
#endif /* __KERNEL__ || __XENO_SIM__ */
#ifdef __cplusplus
extern "C" {
#endif
void rt_typed_sem_init(SEM *sem,
int value,
int type);
int rt_sem_signal(SEM *sem);
int rt_sem_wait(SEM *sem);
int rt_sem_wait_if(SEM *sem);
#ifdef __cplusplus
}
#endif
#endif /* !_RTAI_SEM_H */
|