Commit afeb37ed authored by yoogx's avatar yoogx
Browse files

* Change RTEMS_PURE to __PO_HI_RTEMS_CLASSIC_API to avoid

          collision with RTEMS own RTEMS_PURE macro

          For issue #114
parent b72f7934
......@@ -13,7 +13,7 @@
#include <deployment.h>
#if (defined (RTEMS_POSIX) || defined (RTEMS_PURE))
#if (defined (RTEMS_POSIX) || defined (__PO_HI_RTEMS_CLASSIC_API))
#if defined (__PO_HI_NEED_DRIVER_ETH_LEON) || \
defined (__PO_HI_NEED_DRIVER_ETH_LEON_SENDER) || \
defined (__PO_HI_NEED_DRIVER_ETH_LEON_RECEIVER)
......@@ -63,7 +63,7 @@
#endif /* RTEMS_POSIX */
#if defined(RTEMS_PURE)
#if defined(__PO_HI_RTEMS_CLASSIC_API)
#include <rtems.h>
#include <inttypes.h>
#define CONFIGURE_INIT
......@@ -105,7 +105,7 @@
#define CONFIGURE_MAXIMUM_BARRIERS 1 + __PO_HI_NB_PORTS + 1
#include <rtems/confdefs.h>
#endif /* RTEMS_PURE */
#endif /* __PO_HI_RTEMS_CLASSIC_API */
#if defined (X86_RTEMS) && defined (__PO_HI_USE_TRANSPORT) && __PO_HI_NB_DEVICES > 1
#include <rtems/rtems_bsdnet.h>
......
......@@ -25,7 +25,7 @@
#include <pthread.h>
#endif
#if defined (RTEMS_PURE)
#if defined (__PO_HI_RTEMS_CLASSIC_API)
#include <rtems.h>
#endif
......@@ -60,7 +60,7 @@ typedef struct
pthread_mutex_t posix_mutex;
pthread_mutexattr_t posix_mutexattr;
#endif
#if defined (RTEMS_PURE)
#if defined (__PO_HI_RTEMS_CLASSIC_API)
rtems_id rtems_mutex;
#endif
#if defined (XENO_NATIVE)
......
......@@ -48,7 +48,7 @@
#define __PO_HI_MAIN_RETURN 0
#define __ERRORMSG(s, args...) fprintf(stderr, s, ##args)
#elif defined(RTEMS_PURE)
#elif defined(__PO_HI_RTEMS_CLASSIC_API)
#define __PO_HI_MAIN_NAME Init
#define __PO_HI_MAIN_TYPE rtems_task
#define __PO_HI_MAIN_ARGS rtems_task_argument argument
......@@ -92,7 +92,7 @@
#define __PO_HI_MAX_PRIORITY 2
#define __PO_HI_MIN_PRIORITY 0
#elif defined(RTEMS_PURE)
#elif defined(__PO_HI_RTEMS_CLASSIC_API)
#include <rtems.h>
#include <inttypes.h>
#include <po_hi_time.h>
......
......@@ -14,7 +14,7 @@
#include <po_hi_types.h>
#ifndef HAVE_CLOCK_GETTIME
#if defined (__CYGWIN__) || defined (__MINGW32__) || defined (RTEMS_POSIX) || defined (RTEMS_PURE)
#if defined (__CYGWIN__) || defined (__MINGW32__) || defined (RTEMS_POSIX) || defined (__PO_HI_RTEMS_CLASSIC_API)
#else
#include <xlocale.h>
#endif
......
......@@ -15,7 +15,7 @@ TARGET_SOURCES =
#TARGET_TRANSPORT_SOURCES = $(RUNTIME_PATH)/config/leon-rtems/config.c
TARGET_TRANSPORT_SOURCES =
TARGET_CFLAGS = -DRTEMS_PURE -DGUMSTIX_RTEMS -mstructure-size-boundary=8 -mcpu=xscale -mfpu=vfp -mfloat-abi=soft $(GCC_GENERIC_FLAGS)
TARGET_CFLAGS = -D__PO_HI_RTEMS_CLASSIC_API -DGUMSTIX_RTEMS -mstructure-size-boundary=8 -mcpu=xscale -mfpu=vfp -mfloat-abi=soft $(GCC_GENERIC_FLAGS)
TARGET_INCLUDE =
LD = arm-rtems4.10-gcc
......
......@@ -29,7 +29,7 @@ TARGET_SOURCES =
#TARGET_TRANSPORT_SOURCES = $(RUNTIME_PATH)/config/leon-rtems/config.c
TARGET_TRANSPORT_SOURCES =
TARGET_CFLAGS = -DRTEMS_PURE -DLEON_RTEMS $(GCC_GENERIC_FLAGS) $(CPU_FLAGS) $(AM_FLAGS) $(GCCSPECS)
TARGET_CFLAGS = -D__PO_HI_RTEMS_CLASSIC_API -DLEON_RTEMS $(GCC_GENERIC_FLAGS) $(CPU_FLAGS) $(AM_FLAGS) $(GCCSPECS)
TARGET_INCLUDE = -I$(RUNTIME_PATH)/config/leon-rtems/
TARGET_LDFLAGS = -lrtemsbsp -lc -lm
......
......@@ -27,7 +27,7 @@ TARGET_SOURCES =
#TARGET_TRANSPORT_SOURCES = $(RUNTIME_PATH)/config/leon-rtems/config.c
TARGET_TRANSPORT_SOURCES =
TARGET_CFLAGS = -DRTEMS_PURE -DLEON_RTEMS $(GCC_GENERIC_FLAGS) $(CPU_FLAGS) $(AM_FLAGS) $(GCCSPECS)
TARGET_CFLAGS = -D__PO_HI_RTEMS_CLASSIC_API -DLEON_RTEMS $(GCC_GENERIC_FLAGS) $(CPU_FLAGS) $(AM_FLAGS) $(GCCSPECS)
TARGET_INCLUDE = -I $(RUNTIME_PATH)/config/leon-rtems/
TARGET_LDFLAGS = -lrtemsbsp -lc -lm
......
......@@ -21,7 +21,7 @@ GPROF = sparc-rtems-gprof
TARGET_SOURCES =
TARGET_TRANSPORT_SOURCES =
TARGET_CFLAGS = -DRTEMS_PURE -DSPARC_RTEMS -mcpu=v8 -I$(XTRATUM_PATH)/include -B$(RTEMS_PATH)/sparc-rtems/leon3xm3/lib --include xm_inc/config.h --include xm_inc/arch/arch_types.h -DXM_SRC -DXM3_RTEMS_MODE $(GCC_GENERIC_FLAGS)
TARGET_CFLAGS = -D__PO_HI_RTEMS_CLASSIC_API -DSPARC_RTEMS -mcpu=v8 -I$(XTRATUM_PATH)/include -B$(RTEMS_PATH)/sparc-rtems/leon3xm3/lib --include xm_inc/config.h --include xm_inc/arch/arch_types.h -DXM_SRC -DXM3_RTEMS_MODE $(GCC_GENERIC_FLAGS)
LD = sparc-rtems-gcc
TARGET_LDFLAGS = -lrtemsbsp -lc -lm -mcpu=v8 -msoft-float -qrtems -L$(XTRATUM_PATH)/lib -Wl,--defsym=PARTITION_START=$(call xpathstart,$(BINARY),../$(MAINAPP)_xtratum-conf.xml),--defsym=PARTITION_SIZE=$(call xpathsize,$(BINARY),../$(MAINAPP_xtratum-conf.xml)) -Ttext=$(call xpathstart,$(BINARY),../$(MAINAPP)_xtratum-conf.xml)
......
......@@ -22,7 +22,7 @@ TARGET_SOURCES =
#TARGET_TRANSPORT_SOURCES = $(RUNTIME_PATH)/config/leon-rtems/config.c
TARGET_TRANSPORT_SOURCES =
TARGET_CFLAGS = -DRTEMS_PURE -DNDS_RTEMS -mstructure-size-boundary=8 -mcpu=arm9tdmi -mfpu=vfp -mfloat-abi=soft $(GCC_GENERIC_FLAGS) -mthumb-interwork -g
TARGET_CFLAGS = -D__PO_HI_RTEMS_CLASSIC_API -DNDS_RTEMS -mstructure-size-boundary=8 -mcpu=arm9tdmi -mfpu=vfp -mfloat-abi=soft $(GCC_GENERIC_FLAGS) -mthumb-interwork -g
TARGET_INCLUDE = -I $(RUNTIME_PATH)/config/leon-rtems/
LD = $(LD_FOR_TARGET)
......
......@@ -24,7 +24,7 @@ GPROF = i386-rtems4.8-gprof
TARGET_SOURCES =
TARGET_TRANSPORT_SOURCES =
TARGET_CFLAGS = -DRTEMS_PURE -DX86_RTEMS $(GCC_GENERIC_FLAGS)
TARGET_CFLAGS = -D__PO_HI_RTEMS_CLASSIC_API -DX86_RTEMS $(GCC_GENERIC_FLAGS)
TARGET_INCLUDE = -I $(RUNTIME_PATH)/config/
LD = i386-rtems4.8-gcc
......
......@@ -29,7 +29,7 @@
#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
#include <pthread.h>
#elif defined(RTEMS_PURE)
#elif defined(__PO_HI_RTEMS_CLASSIC_API)
#include <rtems.h>
#include <inttypes.h>
#include <po_hi_time.h>
......@@ -72,7 +72,7 @@ pthread_mutex_t __po_hi_gqueues_mutexes[__PO_HI_NB_TASKS];
pthread_cond_t __po_hi_gqueues_conds[__PO_HI_NB_TASKS];
pthread_mutexattr_t __po_hi_gqueues_mutexes_attr[__PO_HI_NB_TASKS];
pthread_condattr_t __po_hi_gqueues_conds_attr[__PO_HI_NB_TASKS];
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
rtems_id __po_hi_gqueues_semaphores[__PO_HI_NB_TASKS];
rtems_id __po_hi_gqueues_barriers[__PO_HI_NB_TASKS];
#elif defined (XENO_NATIVE)
......@@ -102,7 +102,7 @@ void __po_hi_gqueue_init (__po_hi_task_id id,
__po_hi_uint32_t off; /* XXX May overflow for large value .. */
int err;
#if defined (RTEMS_PURE)
#if defined (__PO_HI_RTEMS_CLASSIC_API)
rtems_status_code ret;
#elif defined (XENO_NATIVE)
int ret;
......@@ -156,7 +156,7 @@ void __po_hi_gqueue_init (__po_hi_task_id id,
#endif
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
__PO_HI_DEBUG_INFO ("[GQUEUE] Create semaphore for queue of task %d\n", id);
ret = rtems_semaphore_create (rtems_build_name ('G', 'S', 'E' , 'A' + (char) id), 1, RTEMS_BINARY_SEMAPHORE, __PO_HI_DEFAULT_PRIORITY, &(__po_hi_gqueues_semaphores[id]));
if (ret != RTEMS_SUCCESSFUL)
......@@ -253,7 +253,7 @@ __po_hi_port_id_t __po_hi_gqueue_store_in (__po_hi_task_id id,
__po_hi_request_t* ptr;
__po_hi_request_t* tmp;
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
rtems_status_code ret;
#endif
ptr = &__po_hi_gqueues_most_recent_values[id][port];
......@@ -268,7 +268,7 @@ __po_hi_port_id_t __po_hi_gqueue_store_in (__po_hi_task_id id,
pthread_mutex_lock (&__po_hi_gqueues_mutexes[id]);
#elif defined (XENO_NATIVE)
rt_mutex_acquire (&__po_hi_gqueues_mutexes[id], TM_INFINITE);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
__DEBUGMSG ("[GQUEUE] Try to obtain semaphore for queue of task %d\n", id);
ret = rtems_semaphore_obtain (__po_hi_gqueues_semaphores[id], RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (ret != RTEMS_SUCCESSFUL)
......@@ -296,7 +296,7 @@ __po_hi_port_id_t __po_hi_gqueue_store_in (__po_hi_task_id id,
pthread_mutex_unlock (&__po_hi_gqueues_mutexes[id]);
#elif defined (XENO_NATIVE)
rt_mutex_release (&__po_hi_gqueues_mutexes[id]);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
ret = rtems_semaphore_release (__po_hi_gqueues_semaphores[id]);
if (ret != RTEMS_SUCCESSFUL)
{
......@@ -349,7 +349,7 @@ __po_hi_port_id_t __po_hi_gqueue_store_in (__po_hi_task_id id,
{
__DEBUGMSG("SetEvent failed (%d)\n", GetLastError());
}
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
ret = rtems_semaphore_release (__po_hi_gqueues_semaphores[id]);
if (ret != RTEMS_SUCCESSFUL)
{
......@@ -366,7 +366,7 @@ __po_hi_port_id_t __po_hi_gqueue_store_in (__po_hi_task_id id,
void __po_hi_gqueue_wait_for_incoming_event (__po_hi_task_id id,
__po_hi_local_port_t* port)
{
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
rtems_status_code ret;
#endif
......@@ -380,7 +380,7 @@ void __po_hi_gqueue_wait_for_incoming_event (__po_hi_task_id id,
__DEBUGMSG("*** Locking (%d) %d\n", id, error);
#elif defined (XENO_NATIVE)
rt_mutex_acquire (&__po_hi_gqueues_mutexes[id], TM_INFINITE);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
ret = rtems_semaphore_obtain (__po_hi_gqueues_semaphores[id], RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (ret != RTEMS_SUCCESSFUL)
{
......@@ -402,7 +402,7 @@ void __po_hi_gqueue_wait_for_incoming_event (__po_hi_task_id id,
__DEBUGMSG("*** Done Waiting (%d) %d\n", id, error);
#elif defined (XENO_NATIVE)
rt_cond_wait (&__po_hi_gqueues_conds[id], &__po_hi_gqueues_mutexes[id], TM_INFINITE);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
ret = rtems_semaphore_release (__po_hi_gqueues_semaphores[id]);
if (ret != RTEMS_SUCCESSFUL)
{
......@@ -442,7 +442,7 @@ void __po_hi_gqueue_wait_for_incoming_event (__po_hi_task_id id,
rt_mutex_release (&__po_hi_gqueues_mutexes[id]);
#elif defined (_WIN32)
LeaveCriticalSection(&__po_hi_gqueues_cs[id]);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
ret = rtems_semaphore_release (__po_hi_gqueues_semaphores[id]);
if (ret != RTEMS_SUCCESSFUL)
{
......@@ -473,7 +473,7 @@ int __po_hi_gqueue_get_value (__po_hi_task_id id,
__po_hi_request_t* request)
{
__po_hi_request_t* ptr;
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
rtems_status_code ret;
#endif
......@@ -487,7 +487,7 @@ int __po_hi_gqueue_get_value (__po_hi_task_id id,
pthread_mutex_lock (&__po_hi_gqueues_mutexes[id]);
#elif defined (XENO_NATIVE)
rt_mutex_acquire (&__po_hi_gqueues_mutexes[id], TM_INFINITE);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
ret = rtems_semaphore_obtain (__po_hi_gqueues_semaphores[id], RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (ret != RTEMS_SUCCESSFUL)
{
......@@ -511,7 +511,7 @@ int __po_hi_gqueue_get_value (__po_hi_task_id id,
#elif defined (XENO_NATIVE)
rt_cond_wait (&__po_hi_gqueues_conds[id], &__po_hi_gqueues_mutexes[id], TM_INFINITE);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
#elif defined (_WIN32)
LeaveCriticalSection(&__po_hi_gqueues_cs[id]);
......@@ -547,7 +547,7 @@ int __po_hi_gqueue_get_value (__po_hi_task_id id,
pthread_mutex_unlock (&__po_hi_gqueues_mutexes[id]);
#elif defined (XENO_NATIVE)
rt_mutex_release (&__po_hi_gqueues_mutexes[id]);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
ret = rtems_semaphore_release (__po_hi_gqueues_semaphores[id]);
if (ret != RTEMS_SUCCESSFUL)
{
......@@ -562,7 +562,7 @@ int __po_hi_gqueue_get_value (__po_hi_task_id id,
int __po_hi_gqueue_next_value (__po_hi_task_id id, __po_hi_local_port_t port)
{
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
rtems_status_code ret;
#endif
......@@ -581,7 +581,7 @@ int __po_hi_gqueue_next_value (__po_hi_task_id id, __po_hi_local_port_t port)
rt_mutex_acquire (&__po_hi_gqueues_mutexes[id], TM_INFINITE);
#elif defined (_WIN32)
EnterCriticalSection(&__po_hi_gqueues_cs[id]);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
ret = rtems_semaphore_obtain (__po_hi_gqueues_semaphores[id], RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (ret != RTEMS_SUCCESSFUL)
{
......@@ -617,7 +617,7 @@ int __po_hi_gqueue_next_value (__po_hi_task_id id, __po_hi_local_port_t port)
pthread_mutex_unlock (&__po_hi_gqueues_mutexes[id]);
#elif defined (XENO_NATIVE)
rt_mutex_release (&__po_hi_gqueues_mutexes[id]);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
ret = rtems_semaphore_release (__po_hi_gqueues_semaphores[id]);
if (ret != RTEMS_SUCCESSFUL)
{
......
......@@ -35,12 +35,12 @@ pthread_cond_t cond_init;
pthread_mutex_t mutex_init;
#endif
#if defined (RTEMS_POSIX) || defined (RTEMS_PURE)
#if defined (RTEMS_POSIX) || defined (__PO_HI_RTEMS_CLASSIC_API)
#include <rtems.h>
#include <rtems/rtems/clock.h>
#endif
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
rtems_id __po_hi_main_initialization_barrier;
#endif
......@@ -167,7 +167,7 @@ int __po_hi_initialize_early ()
#endif
#if defined (RTEMS_POSIX) || defined (RTEMS_PURE)
#if defined (RTEMS_POSIX) || defined (__PO_HI_RTEMS_CLASSIC_API)
rtems_status_code ret;
rtems_time_of_day time;
......@@ -187,7 +187,7 @@ int __po_hi_initialize_early ()
}
#endif
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
__DEBUGMSG ("[MAIN] Create a barrier that wait for %d tasks\n", __po_hi_nb_tasks_to_init);
ret = rtems_barrier_create (rtems_build_name ('B', 'A', 'R', 'M'), RTEMS_BARRIER_AUTOMATIC_RELEASE, __po_hi_nb_tasks_to_init, &__po_hi_main_initialization_barrier);
......@@ -356,7 +356,7 @@ int __po_hi_wait_initialization (void)
LeaveCriticalSection (&__po_hi_main_initialization_critical_section);
return (__PO_HI_SUCCESS);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
rtems_status_code ret;
__DEBUGMSG ("[MAIN] Task wait for the barrier\n");
......@@ -409,7 +409,7 @@ int __po_hi_wait_initialization (void)
#ifdef __PO_HI_USE_GPROF
void __po_hi_wait_end_of_instrumentation ()
{
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
rtems_task_wake_after (10000000 / _TOD_Microseconds_per_tick);
#else
#include <po_hi_time.h>
......@@ -428,7 +428,7 @@ void __po_hi_wait_end_of_instrumentation ()
exit (1);
__DEBUGMSG ("exit() called\n");
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
rtems_task_delete (rtems_self ());
#endif
}
......
......@@ -14,7 +14,7 @@
/* Headers from PolyORB-HI-C */
#if defined (__CYGWIN__) || defined (__MINGW32__) || defined (RTEMS_POSIX) || defined (RTEMS_PURE) || defined (FREERTOS)
#if defined (__CYGWIN__) || defined (__MINGW32__) || defined (RTEMS_POSIX) || defined (__PO_HI_RTEMS_CLASSIC_API) || defined (FREERTOS)
#else
#include <xlocale.h>
#endif
......
......@@ -31,7 +31,7 @@
#include <native/mutex.h>
#endif
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
#include <rtems.h>
#endif
......@@ -93,7 +93,7 @@ int __po_hi_protected_unlock (__po_hi_protected_t protected_id)
int __po_hi_mutex_init (__po_hi_mutex_t* mutex, const __po_hi_mutex_protocol_t protocol, const int priority)
{
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
static int nb_mutex = 0;
#endif
......@@ -166,7 +166,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 RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
if (rtems_semaphore_create (rtems_build_name ('P', 'S', 'E' , 'A' + (char) nb_mutex++), 1, RTEMS_BINARY_SEMAPHORE, __PO_HI_DEFAULT_PRIORITY, &mutex->rtems_mutex) != RTEMS_SUCCESSFUL)
{
__PO_HI_DEBUG_CRITICAL ("[PROTECTED] Cannot create RTEMS binary semaphore\n");
......@@ -194,7 +194,7 @@ int __po_hi_mutex_lock (__po_hi_mutex_t* mutex)
return __PO_HI_ERROR_MUTEX_LOCK;
}
#endif
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
if (rtems_semaphore_obtain (mutex->rtems_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT) != RTEMS_SUCCESSFUL)
{
__PO_HI_DEBUG_CRITICAL ("[PROTECTED] Error when trying to lock mutex\n");
......@@ -236,7 +236,7 @@ int __po_hi_mutex_unlock (__po_hi_mutex_t* mutex)
return __PO_HI_ERROR_MUTEX_UNLOCK;
}
#endif
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
if (rtems_semaphore_release (mutex->rtems_mutex) != RTEMS_SUCCESSFUL)
{
__PO_HI_DEBUG_CRITICAL ("[PROTECTED] Error when trying to unlock mutex\n");
......
......@@ -8,7 +8,7 @@
* Copyright (C) 2011-2017 ESA & ISAE.
*/
#if defined (__CYGWIN__) || defined (__MINGW32__) || defined (RTEMS_POSIX) || defined (RTEMS_PURE) || defined (FREERTOS)
#if defined (__CYGWIN__) || defined (__MINGW32__) || defined (RTEMS_POSIX) || defined (__PO_HI_RTEMS_CLASSIC_API) || defined (FREERTOS)
#else
#include <xlocale.h>
#endif
......
......@@ -26,14 +26,14 @@
#undef POSIX
#endif
#if defined (RTEMS_POSIX) || defined (RTEMS_PURE)
#if defined (RTEMS_POSIX) || defined (__PO_HI_RTEMS_CLASSIC_API)
#ifdef RTEMS412
#include <sys/cpuset.h>
#endif
#endif
#if defined (RTEMS_POSIX) || defined (POSIX) || defined (XENO_POSIX)
#if defined (__CYGWIN__) || defined (__MINGW32__) || defined (RTEMS_POSIX) || defined (RTEMS_PURE)
#if defined (__CYGWIN__) || defined (__MINGW32__) || defined (RTEMS_POSIX) || defined (__PO_HI_RTEMS_CLASSIC_API)
#else
#include <xlocale.h>
#include <unistd.h>
......@@ -94,7 +94,7 @@ typedef struct
#elif defined (_WIN32)
__po_hi_time_t timer;
DWORD tid;
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
rtems_id ratemon_period;
rtems_id rtems_id;
#elif defined(XENO_NATIVE)
......@@ -141,7 +141,7 @@ void __po_hi_wait_for_tasks ()
pthread_join( tasks[i].tid , NULL );
}
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
rtems_task_suspend(RTEMS_SELF);
#elif defined (_WIN32)
......@@ -212,7 +212,7 @@ int __po_hi_compute_next_period (__po_hi_task_id task)
return (__PO_HI_SUCCESS);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
rtems_status_code ret;
rtems_name name;
......@@ -276,7 +276,7 @@ int __po_hi_wait_for_next_period (__po_hi_task_id task)
return (__PO_HI_SUCCESS);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
rtems_status_code ret;
ret = rtems_rate_monotonic_period (tasks[task].ratemon_period, (rtems_interval)__PO_HI_TIME_TO_US(tasks[task].period) / rtems_configuration_get_microseconds_per_tick());
/*
......@@ -329,7 +329,7 @@ int __po_hi_initialize_tasking( )
{
__po_hi_seconds (&(tasks[i].period), 0);
tasks[i].id = invalid_task_id;
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
tasks[i].ratemon_period = RTEMS_INVALID_ID;
#endif
}
......@@ -514,7 +514,7 @@ DWORD __po_hi_win32_create_thread (__po_hi_task_id id,
}
#endif
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
rtems_id __po_hi_rtems_create_thread (__po_hi_priority_t priority,
__po_hi_stack_t stack_size,
__po_hi_int8_t core_id,
......@@ -607,7 +607,7 @@ int __po_hi_create_generic_task (const __po_hi_task_id id,
__DEBUGMSG ("ERROR when starting the task\n");
}
return (__PO_HI_SUCCESS);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
(void) arg;
__po_hi_rtems_create_thread (priority, stack_size, core_id, start_routine, arg);
return (__PO_HI_SUCCESS);
......@@ -627,7 +627,7 @@ int __po_hi_create_generic_task (const __po_hi_task_id id,
(priority, stack_size, core_id, start_routine, arg);
my_task->timer = ORIGIN_OF_TIME;
__po_hi_posix_initialize_task (my_task);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
my_task->rtems_id = __po_hi_rtems_create_thread
(priority, stack_size, core_id, start_routine, arg);
#elif defined (_WIN32)
......@@ -826,7 +826,7 @@ void __po_hi_tasks_killall ()
for (i = 0; i < __PO_HI_NB_TASKS; i++)
{
__DEBUGMSG ("Kill task %d\n", i);
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
rtems_task_delete (tasks[i].rtems_id);
#elif defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
pthread_cancel (tasks[i].tid);
......
......@@ -18,7 +18,7 @@
#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
#include <pthread.h>
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
#include <bsp.h>
#endif
......@@ -120,7 +120,7 @@ int __po_hi_get_time (__po_hi_time_t* mytime)
mytime->nsec *= 100;
return (__PO_HI_SUCCESS);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
rtems_time_of_day current_time;
if (rtems_clock_get (RTEMS_CLOCK_GET_TOD, &current_time) != RTEMS_SUCCESSFUL)
......@@ -225,7 +225,7 @@ int __po_hi_delay_until (const __po_hi_time_t* time)
}
return (ret);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
return (__PO_HI_UNAVAILABLE);
#elif defined (XENO_NATIVE)
......
......@@ -34,12 +34,12 @@ pthread_cond_t cond_init;
pthread_mutex_t mutex_init;
#endif
#if defined (RTEMS_POSIX) || defined (RTEMS_PURE)
#if defined (RTEMS_POSIX) || defined (__PO_HI_RTEMS_CLASSIC_API)
#include <rtems.h>
#include <rtems/rtems/clock.h>
#endif
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
rtems_id __po_hi_main_initialization_barrier;
#endif
......@@ -168,7 +168,7 @@ int __po_hi_initialize_early ()
#endif
#if defined (RTEMS_POSIX) || defined (RTEMS_PURE)
#if defined (RTEMS_POSIX) || defined (__PO_HI_RTEMS_CLASSIC_API)
rtems_status_code ret;
rtems_time_of_day time;
......@@ -188,7 +188,7 @@ int __po_hi_initialize_early ()
}
#endif
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
__DEBUGMSG ("[MAIN] Create a barrier that wait for %d tasks\n", __po_hi_nb_tasks_to_init);
ret = rtems_barrier_create (rtems_build_name ('B', 'A', 'R', 'M'), RTEMS_BARRIER_AUTOMATIC_RELEASE, __po_hi_nb_tasks_to_init, &__po_hi_main_initialization_barrier);
......@@ -351,7 +351,7 @@ int __po_hi_wait_initialization ()
LeaveCriticalSection (&__po_hi_main_initialization_critical_section);
return (__PO_HI_SUCCESS);
#elif defined (RTEMS_PURE)
#elif defined (__PO_HI_RTEMS_CLASSIC_API)
rtems_status_code ret;
__DEBUGMSG ("[MAIN] Task wait for the barrier\n");
......@@ -404,7 +404,7 @@ int __po_hi_wait_initialization ()
#ifdef __PO_HI_USE_GPROF
void __po_hi_wait_end_of_instrumentation ()
{
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
rtems_task_wake_after (10000000 / _TOD_Microseconds_per_tick);
#else
#include <po_hi_time.h>
......@@ -423,7 +423,7 @@ void __po_hi_wait_end_of_instrumentation ()
exit (1);
__DEBUGMSG ("exit() called\n");
#ifdef RTEMS_PURE
#ifdef __PO_HI_RTEMS_CLASSIC_API
rtems_task_delete (rtems_self ());
#endif
}
......
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