Commit e15c55fb authored by jdelange's avatar jdelange

* po-hi-c/include/po_hi_protected.h

   po-hi-c/src/po_hi_protected.c
   - Fix testsuite issue for releasing PolyORB-HI-C

 * po-hi-c/examples/aadlv2/packet-store/Makefile.am
   - Fix files to be released



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@3528 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent a4e3a4ed
C_FILES = $(srcdir)/ping.c $(srcdir)/ping.h $(srcdir)/devicesconf.c
C_FILES = $(srcdir)/pinger.c $(srcdir)/pingme.c $(srcdir)/ping.h $(srcdir)/devicesconf.c
AADL_FILES = \
$(srcdir)/software.aadl \
$(srcdir)/ping.aadl
......
......@@ -11,15 +11,6 @@
#ifndef __PO_HI_PROTECTED_H__
#define __PO_HI_PROTECTED_H__
#include <po_hi_config.h>
#include <po_hi_returns.h>
#include <po_hi_debug.h>
#include <po_hi_task.h>
#include <po_hi_types.h>
#include <po_hi_utils.h>
#include <po_hi_protected.h>
#include <stdint.h>
#include <deployment.h>
......@@ -28,6 +19,20 @@
#define __PO_HI_PROTECTED_TYPE_PIP 1
#define __PO_HI_PROTECTED_TYPE_PCP 2
#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
#include <stdlib.h>
#include <stdint.h>
#include <time.h>
#include <pthread.h>
#endif
#if defined (RTEMS_PURE)
#include <rtems.h>
#endif
#if defined (XENO_NATIVE)
#include <native/mutex.h>
#endif
typedef enum
{
......@@ -45,6 +50,25 @@ typedef enum
typedef __po_hi_protected_protocol_t __po_hi_mutex_protocol_t;
typedef struct
{
__po_hi_mutex_protocol_t protocol;
int priority;
#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
pthread_mutex_t posix_mutex;
pthread_mutexattr_t posix_mutexattr;
#endif
#if defined (RTEMS_PURE)
rtems_id rtems_mutex;
#endif
#if defined (XENO_NATIVE)
RT_MUTEX xeno_mutex;
#endif
}__po_hi_mutex_t;
typedef uint8_t __po_hi_protected_t;
/*
......@@ -76,29 +100,6 @@ int __po_hi_protected_unlock (__po_hi_protected_t protected_id);
int __po_hi_protected_init (void);
typedef struct
{
#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
#include <stdlib.h>
#include <stdint.h>
#include <time.h>
#include <pthread.h>
pthread_mutex_t posix_mutex;
pthread_mutexattr_t posix_mutexattr;
#endif
#ifdef RTEMS_PURE
#include <rtems.h>
rtems_id rtems_mutex;
#endif
#ifdef XENO_NATIVE
#include <native/mutex.h>
RT_MUTEX xeno_mutex;
#endif
__po_hi_mutex_protocol_t protocol;
int priority;
}__po_hi_mutex_t;
/**
* \fn __po_hi_mutex_init
*
......
......@@ -50,7 +50,6 @@ extern __po_hi_uint8_t __po_hi_protected_priorities[__PO_HI_NB_P
int __po_hi_protected_init ()
{
__po_hi_uint8_t i;
__po_hi_uint8_t prio;
for (i = 0 ; i < __PO_HI_NB_PROTECTED ; i++ )
{
......@@ -152,7 +151,7 @@ int __po_hi_mutex_init (__po_hi_mutex_t* mutex, const __po_hi_mutex_protocol_t p
return __PO_HI_ERROR_UNKNOWN;
}
#endif
#ifdef XENO_NATIVE
#if defined (XENO_NATIVE)
if (rt_mutex_create (&mutex->xeno_mutex, NULL) != 0)
{
__PO_HI_DEBUG_DEBUG ("[PROTECTED] Error while creating mutex\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment