From 352c9b2035e32e56f10f261d94955d97f4ab0f1c Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 9 Nov 1999 22:07:23 +0000 Subject: This patch adds the basic framework for the ITRON 3.0 API implementation for RTEMS. --- cpukit/score/include/rtems/score/interr.h | 3 +- cpukit/score/include/rtems/score/object.h | 64 +++++++++++++++++++++---------- cpukit/score/include/rtems/score/thread.h | 5 ++- cpukit/score/include/rtems/system.h | 8 ++++ 4 files changed, 57 insertions(+), 23 deletions(-) (limited to 'cpukit/score/include') diff --git a/cpukit/score/include/rtems/score/interr.h b/cpukit/score/include/rtems/score/interr.h index e999ceff7a..f3fba47f66 100644 --- a/cpukit/score/include/rtems/score/interr.h +++ b/cpukit/score/include/rtems/score/interr.h @@ -30,7 +30,8 @@ extern "C" { typedef enum { INTERNAL_ERROR_CORE, INTERNAL_ERROR_RTEMS_API, - INTERNAL_ERROR_POSIX_API + INTERNAL_ERROR_POSIX_API, + INTERNAL_ERROR_ITRON_API } Internal_errors_Source; /* diff --git a/cpukit/score/include/rtems/score/object.h b/cpukit/score/include/rtems/score/object.h index 7c72719679..9f4a6a929d 100644 --- a/cpukit/score/include/rtems/score/object.h +++ b/cpukit/score/include/rtems/score/object.h @@ -86,30 +86,38 @@ typedef unsigned32 Objects_Id; */ typedef enum { - OBJECTS_NO_CLASS = 0, - OBJECTS_INTERNAL_THREADS = 1, - OBJECTS_RTEMS_TASKS = 2, - OBJECTS_POSIX_THREADS = 3, - OBJECTS_RTEMS_TIMERS = 4, - OBJECTS_RTEMS_SEMAPHORES = 5, - OBJECTS_RTEMS_MESSAGE_QUEUES = 6, - OBJECTS_RTEMS_PARTITIONS = 7, - OBJECTS_RTEMS_REGIONS = 8, - OBJECTS_RTEMS_PORTS = 9, - OBJECTS_RTEMS_PERIODS = 10, - OBJECTS_RTEMS_EXTENSIONS = 11, - OBJECTS_POSIX_KEYS = 12, - OBJECTS_POSIX_INTERRUPTS = 13, - OBJECTS_POSIX_MESSAGE_QUEUES = 14, - OBJECTS_POSIX_MUTEXES = 15, - OBJECTS_POSIX_SEMAPHORES = 16, - OBJECTS_POSIX_CONDITION_VARIABLES = 17 + OBJECTS_NO_CLASS = 0, + OBJECTS_INTERNAL_THREADS = 1, + OBJECTS_RTEMS_TASKS = 2, + OBJECTS_POSIX_THREADS = 3, + OBJECTS_ITRON_TASKS = 4, + OBJECTS_RTEMS_TIMERS = 5, + OBJECTS_RTEMS_SEMAPHORES = 6, + OBJECTS_RTEMS_MESSAGE_QUEUES = 7, + OBJECTS_RTEMS_PARTITIONS = 8, + OBJECTS_RTEMS_REGIONS = 9, + OBJECTS_RTEMS_PORTS = 10, + OBJECTS_RTEMS_PERIODS = 11, + OBJECTS_RTEMS_EXTENSIONS = 12, + OBJECTS_POSIX_KEYS = 13, + OBJECTS_POSIX_INTERRUPTS = 14, + OBJECTS_POSIX_MESSAGE_QUEUES = 15, + OBJECTS_POSIX_MUTEXES = 16, + OBJECTS_POSIX_SEMAPHORES = 17, + OBJECTS_POSIX_CONDITION_VARIABLES = 18, + OBJECTS_ITRON_EVENTFLAGS = 19, + OBJECTS_ITRON_MAILBOXES = 20, + OBJECTS_ITRON_MESSAGE_BUFFERS = 21, + OBJECTS_ITRON_PORTS = 22, + OBJECTS_ITRON_SEMAPHORES = 23, + OBJECTS_ITRON_VARIABLE_MEMORY_POOLS = 24, + OBJECTS_ITRON_FIXED_MEMORY_POOLS = 25 } Objects_Classes; #define OBJECTS_CLASSES_FIRST OBJECTS_NO_CLASS -#define OBJECTS_CLASSES_LAST OBJECTS_POSIX_CONDITION_VARIABLES +#define OBJECTS_CLASSES_LAST OBJECTS_ITRON_FIXED_MEMORY_POOLS #define OBJECTS_CLASSES_FIRST_THREAD_CLASS OBJECTS_INTERNAL_THREADS -#define OBJECTS_CLASSES_LAST_THREAD_CLASS OBJECTS_POSIX_THREADS +#define OBJECTS_CLASSES_LAST_THREAD_CLASS OBJECTS_ITRON_TASKS /* * This enumerated type lists the locations which may be returned @@ -284,6 +292,22 @@ Objects_Control *_Objects_Allocate( Objects_Information *information ); +/* + * _Objects_Allocate_by_index + * + * DESCRIPTION: + * + * This function allocates the object control block + * specified by the index from the inactive chain of + * free object control blocks. + */ + +Objects_Control *_Objects_Allocate_by_index( + Objects_Information *information, + unsigned32 index, + unsigned32 sizeof_control +); + /*PAGE * * _Objects_Free diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 1ca0005490..26452bffbe 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -166,11 +166,12 @@ typedef struct { typedef enum { THREAD_API_RTEMS, - THREAD_API_POSIX + THREAD_API_POSIX, + THREAD_API_ITRON } Thread_APIs; #define THREAD_API_FIRST THREAD_API_RTEMS -#define THREAD_API_LAST THREAD_API_POSIX +#define THREAD_API_LAST THREAD_API_ITRON struct Thread_Control_struct { Objects_Control Object; diff --git a/cpukit/score/include/rtems/system.h b/cpukit/score/include/rtems/system.h index 4d7f550141..423952aa56 100644 --- a/cpukit/score/include/rtems/system.h +++ b/cpukit/score/include/rtems/system.h @@ -69,6 +69,14 @@ extern "C" { #define POSIX_EXTERN extern #endif +#ifdef ITRON_API_INIT +#undef ITRON_EXTERN +#define ITRON_EXTERN +#else +#undef ITRON_EXTERN +#define ITRON_EXTERN extern +#endif + /* * The following (in conjunction with compiler arguments) are used * to choose between the use of static inline functions and macro -- cgit v1.2.3