This file is indexed.

/usr/include/xenomai/psos+/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
/**
 * @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 _PSOS_PPD_H
#define _PSOS_PPD_H

#include <nucleus/pod.h>
#include <nucleus/ppd.h>

#ifndef CONFIG_XENO_OPT_DEBUG_PSOS
#define CONFIG_XENO_OPT_DEBUG_PSOS  0
#endif

typedef struct psos_resource_holder {

	xnshadow_ppd_t ppd;

#define ppd2rholder(a)	container_of(a, struct psos_resource_holder, ppd)

	xnqueue_t smq;
	xnqueue_t qq;
	xnqueue_t ptq;
	xnqueue_t rnq;

} psos_rholder_t;

extern psos_rholder_t __psos_global_rholder;

#ifdef CONFIG_XENO_OPT_PERVASIVE

extern int __psos_muxid;

static inline psos_rholder_t *psos_get_rholder(void)
{
	xnshadow_ppd_t *ppd = xnshadow_ppd_get(__psos_muxid);

	if (ppd == NULL)
		return &__psos_global_rholder;

	return ppd2rholder(ppd);
}

#else /* !CONFIG_XENO_OPT_PERVASIVE */

static inline psos_rholder_t *psos_get_rholder(void)
{
	return &__psos_global_rholder;
}

#endif /* !CONFIG_XENO_OPT_PERVASIVE */

#if XENO_DEBUG(PSOS)
#define __psos_trace_release(__name, __obj, __err)			\
	xnprintf("pSOS: cleaning up %s \"%s\" (ret=%lu).\n",		\
		 __name, (__obj)->name, __err)
#else /* !XENO_DEBUG(NATIVE) */
#define __psos_trace_release(__name, __obj, __err)
#endif /* !XENO_DEBUG(NATIVE) */

#define psos_flush_rq(__type, __rq, __name, __dtor)			\
	do {								\
		u_long __dtor(u_long id);				\
		xnholder_t *holder, *nholder;				\
		__type *obj;						\
		u_long 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 = __dtor((u_long)obj);			\
			__psos_trace_release(#__name, obj, err);	\
			xnlock_get_irqsave(&nklock, s);			\
			if (unlikely(err) &&				\
			    (obj->rqueue != &__psos_global_rholder.__name##q)) { \
				removeq(obj->rqueue, holder);		\
				appendq(&__psos_global_rholder.__name##q, holder); \
				obj->rqueue = &__psos_global_rholder.__name##q; \
			    }						\
		}							\
		xnlock_put_irqrestore(&nklock, s);			\
	} while(0)

#endif /* !_PSOS_PPD_H */