/usr/include/xenomai/native/ppd.h is in libxenomai-dev 2.6.4+dfsg-1.
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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | /**
* @file
* This file is part of the Xenomai project.
*
* @note Copyright (C) 2007 Philippe Gerum <rpm@xenomai.org>
*
* 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 _XENO_PPD_H
#define _XENO_PPD_H
#include <nucleus/pod.h>
#include <nucleus/ppd.h>
#include <nucleus/heap.h>
typedef struct xeno_resource_holder {
xnshadow_ppd_t ppd;
#define ppd2rholder(a) container_of(a, struct xeno_resource_holder, ppd)
xnqueue_t alarmq;
xnqueue_t condq;
xnqueue_t eventq;
xnqueue_t heapq;
xnqueue_t intrq;
xnqueue_t mutexq;
xnqueue_t pipeq;
xnqueue_t queueq;
xnqueue_t semq;
xnqueue_t ioregionq;
xnqueue_t bufferq;
} xeno_rholder_t;
extern xeno_rholder_t __native_global_rholder;
#ifdef CONFIG_XENO_OPT_PERVASIVE
extern int __native_muxid;
static inline xeno_rholder_t *xeno_get_rholder(void)
{
xnshadow_ppd_t *ppd = xnshadow_ppd_get(__native_muxid);
if (ppd == NULL)
return &__native_global_rholder;
return ppd2rholder(ppd);
}
#define __xeno_release_obj(obj) \
do { \
if ((obj)->cpid) \
xnfree(obj); \
} while(0)
#else /* !CONFIG_XENO_OPT_PERVASIVE */
static inline xeno_rholder_t *xeno_get_rholder(void)
{
return &__native_global_rholder;
}
#define __xeno_release_obj(obj) do { } while(0)
#endif /* !CONFIG_XENO_OPT_PERVASIVE */
#if XENO_DEBUG(NATIVE)
#define __xeno_trace_release(__name, __obj, __err) \
xnprintf("native: cleaning up %s \"%s\" (ret=%d).\n", \
__name, (__obj)->name, __err)
#else /* !XENO_DEBUG(NATIVE) */
#define __xeno_trace_release(__name, __obj, __err)
#endif /* !XENO_DEBUG(NATIVE) */
#define __xeno_flush_rq(__type, __rq, __name, __release) \
do { \
int rt_##__name##_delete(__type *); \
xnholder_t *holder, *nholder; \
__type *obj; \
int err; \
spl_t s; \
xnlock_get_irqsave(&nklock, s); \
nholder = getheadq(__rq); \
while ((holder = nholder) != NULL) { \
nholder = nextq((__rq), holder); \
xnlock_put_irqrestore(&nklock, s); \
obj = rlink2##__name(holder); \
err = rt_##__name##_delete(obj); \
__xeno_trace_release(#__name, obj, err); \
if (unlikely(err)) { \
xnlock_get_irqsave(&nklock, s); \
if ((__rq) != &__native_global_rholder.__name##q) { \
nholder = popq((__rq), holder); \
appendq(&__native_global_rholder.__name##q, holder); \
obj->rqueue = &__native_global_rholder.__name##q; \
} \
} else { \
if (__release) \
__xeno_release_obj(obj); \
xnlock_get_irqsave(&nklock, s); \
} \
} \
xnlock_put_irqrestore(&nklock, s); \
} while(0)
#define xeno_flush_rq(__type, __rq, __name) \
__xeno_flush_rq(__type, __rq, __name, 1)
#define xeno_flush_rq_norelease(__type, __rq, __name) \
__xeno_flush_rq(__type, __rq, __name, 0)
#endif /* !_XENO_PPD_H */
|