summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpukit/Makefile.am1
-rw-r--r--cpukit/include/rtems/confdefs.h462
-rw-r--r--cpukit/include/rtems/config.h12
-rw-r--r--cpukit/include/rtems/extensiondata.h25
-rw-r--r--cpukit/include/rtems/extensionimpl.h2
-rw-r--r--cpukit/include/rtems/posix/key.h42
-rw-r--r--cpukit/include/rtems/posix/keyimpl.h5
-rw-r--r--cpukit/include/rtems/posix/mqueue.h31
-rw-r--r--cpukit/include/rtems/posix/mqueueimpl.h6
-rw-r--r--cpukit/include/rtems/posix/pthread.h8
-rw-r--r--cpukit/include/rtems/posix/pthreadimpl.h6
-rw-r--r--cpukit/include/rtems/posix/semaphore.h29
-rw-r--r--cpukit/include/rtems/posix/semaphoreimpl.h6
-rw-r--r--cpukit/include/rtems/posix/shm.h25
-rw-r--r--cpukit/include/rtems/posix/shmimpl.h2
-rw-r--r--cpukit/include/rtems/posix/sigset.h3
-rw-r--r--cpukit/include/rtems/posix/timer.h24
-rw-r--r--cpukit/include/rtems/posix/timerimpl.h6
-rw-r--r--cpukit/include/rtems/rtems/barrierdata.h25
-rw-r--r--cpukit/include/rtems/rtems/barrierimpl.h6
-rw-r--r--cpukit/include/rtems/rtems/config.h55
-rw-r--r--cpukit/include/rtems/rtems/dpmemdata.h25
-rw-r--r--cpukit/include/rtems/rtems/dpmemimpl.h6
-rw-r--r--cpukit/include/rtems/rtems/messagedata.h39
-rw-r--r--cpukit/include/rtems/rtems/messageimpl.h6
-rw-r--r--cpukit/include/rtems/rtems/msgmp.h12
-rw-r--r--cpukit/include/rtems/rtems/partdata.h39
-rw-r--r--cpukit/include/rtems/rtems/partimpl.h6
-rw-r--r--cpukit/include/rtems/rtems/partmp.h12
-rw-r--r--cpukit/include/rtems/rtems/ratemondata.h25
-rw-r--r--cpukit/include/rtems/rtems/ratemonimpl.h8
-rw-r--r--cpukit/include/rtems/rtems/regiondata.h25
-rw-r--r--cpukit/include/rtems/rtems/regionimpl.h6
-rw-r--r--cpukit/include/rtems/rtems/semdata.h39
-rw-r--r--cpukit/include/rtems/rtems/semimpl.h6
-rw-r--r--cpukit/include/rtems/rtems/semmp.h12
-rw-r--r--cpukit/include/rtems/rtems/tasksdata.h6
-rw-r--r--cpukit/include/rtems/rtems/tasksimpl.h6
-rw-r--r--cpukit/include/rtems/rtems/timerdata.h25
-rw-r--r--cpukit/include/rtems/rtems/timerimpl.h6
-rw-r--r--cpukit/include/rtems/score/freechain.h18
-rw-r--r--cpukit/include/rtems/score/interr.h2
-rw-r--r--cpukit/include/rtems/score/object.h23
-rw-r--r--cpukit/include/rtems/score/objectdata.h183
-rw-r--r--cpukit/include/rtems/score/objectimpl.h186
-rw-r--r--cpukit/include/rtems/score/thread.h118
-rw-r--r--cpukit/include/rtems/score/threadimpl.h22
-rw-r--r--cpukit/include/rtems/score/threadq.h9
-rw-r--r--cpukit/posix/src/key.c175
-rw-r--r--cpukit/posix/src/keycreate.c119
-rw-r--r--cpukit/posix/src/keyzerokvp.c36
-rw-r--r--cpukit/posix/src/mqueue.c81
-rw-r--r--cpukit/posix/src/mqueueopen.c12
-rw-r--r--cpukit/posix/src/psxsemaphore.c72
-rw-r--r--cpukit/posix/src/psxtimercreate.c17
-rw-r--r--cpukit/posix/src/pthread.c191
-rw-r--r--cpukit/posix/src/pthreadcreate.c138
-rw-r--r--cpukit/posix/src/ptimer.c94
-rw-r--r--cpukit/posix/src/semopen.c12
-rw-r--r--cpukit/posix/src/shm.c66
-rw-r--r--cpukit/posix/src/shmopen.c12
-rw-r--r--cpukit/rtems/src/barrier.c68
-rw-r--r--cpukit/rtems/src/barriercreate.c33
-rw-r--r--cpukit/rtems/src/dpmem.c68
-rw-r--r--cpukit/rtems/src/dpmemcreate.c15
-rw-r--r--cpukit/rtems/src/msg.c83
-rw-r--r--cpukit/rtems/src/msgqcreate.c35
-rw-r--r--cpukit/rtems/src/part.c79
-rw-r--r--cpukit/rtems/src/partcreate.c43
-rw-r--r--cpukit/rtems/src/ratemon.c67
-rw-r--r--cpukit/rtems/src/ratemoncreate.c31
-rw-r--r--cpukit/rtems/src/region.c76
-rw-r--r--cpukit/rtems/src/regioncreate.c32
-rw-r--r--cpukit/rtems/src/rtemstimer.c69
-rw-r--r--cpukit/rtems/src/sem.c76
-rw-r--r--cpukit/rtems/src/semcreate.c19
-rw-r--r--cpukit/rtems/src/taskcreate.c62
-rw-r--r--cpukit/rtems/src/tasks.c86
-rw-r--r--cpukit/rtems/src/timercreate.c14
-rw-r--r--cpukit/sapi/src/extension.c60
-rw-r--r--cpukit/sapi/src/extensioncreate.c16
-rw-r--r--cpukit/score/src/freechain.c25
-rw-r--r--cpukit/score/src/mpci.c2
-rw-r--r--cpukit/score/src/objectallocate.c11
-rw-r--r--cpukit/score/src/objectextendinformation.c52
-rw-r--r--cpukit/score/src/objectfree.c25
-rw-r--r--cpukit/score/src/objectinitializeinformation.c99
-rw-r--r--cpukit/score/src/objectshrinkinformation.c5
-rw-r--r--cpukit/score/src/thread.c36
-rw-r--r--cpukit/score/src/threadcreateidle.c2
-rw-r--r--cpukit/score/src/threadinitialize.c6
-rw-r--r--cpukit/score/src/threadmp.c3
-rw-r--r--cpukit/score/src/threadrestart.c2
-rw-r--r--cpukit/score/src/wkspace.c20
-rw-r--r--testsuites/psxtests/psxobj01/init.c35
-rw-r--r--testsuites/sptests/Makefile.am10
-rw-r--r--testsuites/sptests/configure.ac1
-rw-r--r--testsuites/sptests/spfatal13/spfatal13.doc19
-rw-r--r--testsuites/sptests/spfatal13/spfatal13.scn3
-rw-r--r--testsuites/sptests/spfatal13/testcase.h26
-rw-r--r--testsuites/sptests/spfreechain01/init.c9
-rw-r--r--testsuites/sptests/spsimplesched02/init.c2
-rw-r--r--testsuites/sptests/spsize/size.c2
-rw-r--r--testsuites/sptests/spsysinit01/init.c357
104 files changed, 2357 insertions, 2103 deletions
diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index d7d25aab2d..143c5d6686 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -509,6 +509,7 @@ librtemscpu_a_SOURCES += posix/src/keycreate.c
librtemscpu_a_SOURCES += posix/src/keydelete.c
librtemscpu_a_SOURCES += posix/src/keygetspecific.c
librtemscpu_a_SOURCES += posix/src/keysetspecific.c
+librtemscpu_a_SOURCES += posix/src/keyzerokvp.c
librtemscpu_a_SOURCES += posix/src/lio_listio.c
librtemscpu_a_SOURCES += posix/src/mlockall.c
librtemscpu_a_SOURCES += posix/src/mlock.c
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index d66e23e0ab..f147d67dae 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -44,9 +44,11 @@
#include <rtems/rtems/timerdata.h>
#include <rtems/posix/key.h>
#include <rtems/posix/mqueue.h>
+#include <rtems/posix/psignal.h>
#include <rtems/posix/pthread.h>
#include <rtems/posix/semaphore.h>
#include <rtems/posix/shm.h>
+#include <rtems/posix/timer.h>
#include <limits.h>
@@ -1354,24 +1356,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
*/
#define _Configure_Max_Objects(_max) \
(_Configure_Zero_or_One(_max) * rtems_resource_maximum_per_allocation(_max))
-
-/**
- * This macro accounts for how memory for a set of configured objects is
- * allocated from the Executive Workspace.
- *
- * NOTE: It does NOT attempt to address the more complex case of unlimited
- * objects.
- */
-#define _Configure_Object_RAM(_number, _size) ( \
- _Configure_From_workspace(_Configure_Max_Objects(_number) * (_size)) + \
- _Configure_From_workspace( \
- _Configure_Zero_or_One(_number) * ( \
- (_Configure_Max_Objects(_number) + 1) * sizeof(Objects_Control *) + \
- _Configure_Align_up(sizeof(void *), CPU_ALIGNMENT) + \
- _Configure_Align_up(sizeof(uint32_t), CPU_ALIGNMENT) \
- ) \
- ) \
- )
/**@}*/
/**
@@ -1853,7 +1837,7 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
#define _CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \
_Configure_From_workspace((_proxies) \
* (sizeof(Thread_Proxy_control) \
- + THREAD_QUEUE_HEADS_SIZE(_CONFIGURE_SCHEDULER_COUNT)))
+ + sizeof(Thread_queue_Configured_heads)))
#ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
#include <mpci.h>
@@ -1971,12 +1955,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
#define CONFIGURE_MAXIMUM_POSIX_TIMERS \
rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
#endif
-/*
- #if !defined(CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS)
- #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS \
- rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
- #endif
-*/
#endif /* RTEMS_POSIX_API */
#endif /* CONFIGURE_UNLIMITED_OBJECTS */
@@ -2006,16 +1984,11 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
#ifndef CONFIGURE_MAXIMUM_TIMERS
/** This specifies the maximum number of Classic API timers. */
#define CONFIGURE_MAXIMUM_TIMERS 0
- /*
- * This macro is calculated to specify the memory required for
- * Classic API timers.
- */
- #define _CONFIGURE_MEMORY_FOR_TIMERS(_timers) 0
-#else
- #define _CONFIGURE_MEMORY_FOR_TIMERS(_timers) \
- _Configure_Object_RAM(_timers, sizeof(Timer_Control) )
#endif
+#define _CONFIGURE_TIMERS \
+ (CONFIGURE_MAXIMUM_TIMERS + _CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER)
+
#ifndef CONFIGURE_MAXIMUM_SEMAPHORES
/** This specifies the maximum number of Classic API semaphores. */
#define CONFIGURE_MAXIMUM_SEMAPHORES 0
@@ -2037,35 +2010,12 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
)
#endif
-/*
- * This macro is calculated to specify the memory required for
- * Classic API Semaphores.
- *
- * If there are no user or support semaphores defined, then we can assume
- * that no memory need be allocated at all for semaphores.
- */
-#if CONFIGURE_MAXIMUM_SEMAPHORES == 0
- #define _CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) 0
-#else
- #define _CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \
- _Configure_Object_RAM(_semaphores, sizeof(Semaphore_Control) ) + \
- _CONFIGURE_MEMORY_FOR_MRSP_SEMAPHORES
-#endif
-
#ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
/**
* This configuration parameter specifies the maximum number of
* Classic API Message Queues.
*/
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 0
- /*
- * This macro is calculated to specify the RTEMS Workspace required for
- * the Classic API Message Queues.
- */
- #define _CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) 0
-#else
- #define _CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \
- _Configure_Object_RAM(_queues, sizeof(Message_queue_Control) )
#endif
#ifndef CONFIGURE_MAXIMUM_PARTITIONS
@@ -2074,14 +2024,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
* Classic API Partitions.
*/
#define CONFIGURE_MAXIMUM_PARTITIONS 0
- /*
- * This macro is calculated to specify the memory required for
- * Classic API
- */
- #define _CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) 0
-#else
- #define _CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \
- _Configure_Object_RAM(_partitions, sizeof(Partition_Control) )
#endif
#ifndef CONFIGURE_MAXIMUM_REGIONS
@@ -2090,14 +2032,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
* Classic API Regions.
*/
#define CONFIGURE_MAXIMUM_REGIONS 0
- /*
- * This macro is calculated to specify the memory required for
- * Classic API Regions.
- */
- #define _CONFIGURE_MEMORY_FOR_REGIONS(_regions) 0
-#else
- #define _CONFIGURE_MEMORY_FOR_REGIONS(_regions) \
- _Configure_Object_RAM(_regions, sizeof(Region_Control) )
#endif
#ifndef CONFIGURE_MAXIMUM_PORTS
@@ -2106,14 +2040,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
* Classic API Dual-Ported Memory Ports.
*/
#define CONFIGURE_MAXIMUM_PORTS 0
- /**
- * This macro is calculated to specify the memory required for
- * Classic API Dual-Ported Memory Ports.
- */
- #define _CONFIGURE_MEMORY_FOR_PORTS(_ports) 0
-#else
- #define _CONFIGURE_MEMORY_FOR_PORTS(_ports) \
- _Configure_Object_RAM(_ports, sizeof(Dual_ported_memory_Control) )
#endif
#ifndef CONFIGURE_MAXIMUM_PERIODS
@@ -2122,14 +2048,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
* Classic API Rate Monotonic Periods.
*/
#define CONFIGURE_MAXIMUM_PERIODS 0
- /*
- * This macro is calculated to specify the memory required for
- * Classic API Rate Monotonic Periods.
- */
- #define _CONFIGURE_MEMORY_FOR_PERIODS(_periods) 0
-#else
- #define _CONFIGURE_MEMORY_FOR_PERIODS(_periods) \
- _Configure_Object_RAM(_periods, sizeof(Rate_monotonic_Control) )
#endif
/**
@@ -2145,18 +2063,7 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
* Barriers required by the application and configured capabilities.
*/
#define _CONFIGURE_BARRIERS \
- (CONFIGURE_MAXIMUM_BARRIERS + _CONFIGURE_BARRIERS_FOR_FIFOS)
-
-/*
- * This macro is calculated to specify the memory required for
- * Classic API Barriers.
- */
-#if _CONFIGURE_BARRIERS == 0
- #define _CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) 0
-#else
- #define _CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) \
- _Configure_Object_RAM(_barriers, sizeof(Barrier_Control) )
-#endif
+ (CONFIGURE_MAXIMUM_BARRIERS + _CONFIGURE_BARRIERS_FOR_FIFOS)
#ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS
/**
@@ -2164,14 +2071,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
* Classic API User Extensions.
*/
#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0
- /*
- * This macro is calculated to specify the memory required for
- * Classic API User Extensions.
- */
- #define _CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) 0
-#else
- #define _CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \
- _Configure_Object_RAM(_extensions, sizeof(Extension_Control) )
#endif
/**@}*/ /* end of Classic API Configuration */
@@ -2297,16 +2196,6 @@ struct _reent *__getreent(void)
#define _CONFIGURE_POSIX_KEYS \
(CONFIGURE_MAXIMUM_POSIX_KEYS + _CONFIGURE_LIBIO_POSIX_KEYS)
-/*
- * This macro is calculated to specify the memory required for
- * POSIX API keys.
- */
-#define _CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys, _key_value_pairs) \
- (_Configure_Object_RAM(_keys, sizeof(POSIX_Keys_Control) ) \
- + _Configure_From_workspace( \
- _Configure_Max_Objects(_key_value_pairs) \
- * sizeof(POSIX_Keys_Key_value_pair)))
-
/**
* This configuration parameter specifies the maximum number of
* POSIX API threads.
@@ -2320,9 +2209,8 @@ struct _reent *__getreent(void)
* of the object to be duplicated.
*/
#define _Configure_POSIX_Named_Object_RAM(_number, _size) \
- (_Configure_Object_RAM(_number, _size) \
- + _Configure_Max_Objects(_number) \
- * _Configure_From_workspace(_POSIX_PATH_MAX + 1))
+ (_Configure_Max_Objects(_number) \
+ * _Configure_From_workspace(_POSIX_PATH_MAX + 1))
/**
* This configuration parameter specifies the maximum number of
@@ -2370,48 +2258,37 @@ struct _reent *__getreent(void)
#define _CONFIGURE_MEMORY_FOR_POSIX_SHMS(_shms) \
_Configure_POSIX_Named_Object_RAM(_shms, sizeof(POSIX_Shm_Control) )
-/*
- * The rest of the POSIX threads API features are only available when
- * POSIX is enabled.
+/**
+ * This configuration parameter specifies the maximum number of
+ * POSIX API timers.
*/
-#ifdef RTEMS_POSIX_API
- #include <sys/types.h>
- #include <signal.h>
- #include <rtems/posix/psignal.h>
- #include <rtems/posix/threadsup.h>
- #include <rtems/posix/timer.h>
+#ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS
+ #define CONFIGURE_MAXIMUM_POSIX_TIMERS 0
+#endif
- /**
- * This configuration parameter specifies the maximum number of
- * POSIX API timers.
- */
- #ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS
- #define CONFIGURE_MAXIMUM_POSIX_TIMERS 0
- #endif
+#if !defined(RTEMS_POSIX_API) && CONFIGURE_MAXIMUM_POSIX_TIMERS != 0
+ #error "CONFIGURE_MAXIMUM_POSIX_TIMERS must be zero if POSIX API is disabled"
+#endif
- /*
- * This macro is calculated to specify the memory required for
- * POSIX API timers.
- */
- #define _CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \
- _Configure_Object_RAM(_timers, sizeof(POSIX_Timer_Control) )
+/**
+ * This configuration parameter specifies the maximum number of
+ * POSIX API queued signals.
+ */
+#ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
+ #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0
+#endif
- /**
- * This configuration parameter specifies the maximum number of
- * POSIX API queued signals.
- */
- #ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
- #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0
- #endif
+#if !defined(RTEMS_POSIX_API) && CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0
+ #error "CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS must be zero if POSIX API is disabled"
+#endif
- /*
- * This macro is calculated to specify the memory required for
- * POSIX API queued signals.
- */
- #define _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \
- _Configure_From_workspace( \
- (_queued_signals) * (sizeof(POSIX_signals_Siginfo_node)) )
-#endif /* RTEMS_POSIX_API */
+#if CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS > 0
+ #define _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS \
+ _Configure_From_workspace( (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS) * \
+ sizeof( POSIX_signals_Siginfo_node ) )
+#else
+ #define _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS 0
+#endif
#ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
#ifndef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
@@ -2536,23 +2413,6 @@ struct _reent *__getreent(void)
CONFIGURE_MAXIMUM_ADA_TASKS + \
CONFIGURE_MAXIMUM_GOROUTINES)
-#ifdef RTEMS_POSIX_API
- /*
- * This macro is calculated to specify the memory required for
- * the POSIX API in its entirety.
- */
- #define _CONFIGURE_MEMORY_FOR_POSIX \
- (_CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \
- CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS) + \
- _CONFIGURE_MEMORY_FOR_POSIX_TIMERS(CONFIGURE_MAXIMUM_POSIX_TIMERS))
-#else
- /*
- * This macro is calculated to specify the memory required for
- * the POSIX API in its entirety.
- */
- #define _CONFIGURE_MEMORY_FOR_POSIX 0
-#endif
-
/*
* We must be able to split the free block used for the second last allocation
* into two parts so that we have a free block for the last allocation. See
@@ -2561,6 +2421,12 @@ struct _reent *__getreent(void)
#define _CONFIGURE_HEAP_HANDLER_OVERHEAD \
_Configure_Align_up( HEAP_BLOCK_HEADER_SIZE, CPU_HEAP_ALIGNMENT )
+/**
+ * This calculates the amount of memory reserved for the IDLE tasks.
+ * In an SMP system, each CPU core has its own idle task.
+ */
+#define _CONFIGURE_IDLE_TASKS_COUNT _CONFIGURE_MAXIMUM_PROCESSORS
+
/*
* Calculate the RAM size based on the maximum number of objects configured.
*/
@@ -2573,13 +2439,8 @@ struct _reent *__getreent(void)
* entry in the local pointer table.
*/
#define _CONFIGURE_MEMORY_FOR_TASKS(_tasks, _number_FP_tasks) \
- ( \
- _Configure_Object_RAM(_tasks, sizeof(Configuration_Thread_control)) \
- + _Configure_From_workspace(_Configure_Max_Objects(_tasks) \
- * THREAD_QUEUE_HEADS_SIZE(_CONFIGURE_SCHEDULER_COUNT)) \
- + _Configure_Max_Objects(_number_FP_tasks) \
- * _Configure_From_workspace(CONTEXT_FP_SIZE) \
- )
+ (_Configure_Max_Objects(_number_FP_tasks) \
+ * _Configure_From_workspace(CONTEXT_FP_SIZE))
/*
* This defines the amount of memory configured for the multiprocessing
@@ -2629,12 +2490,6 @@ struct _reent *__getreent(void)
#endif
/**
- * This calculates the amount of memory reserved for the IDLE tasks.
- * In an SMP system, each CPU core has its own idle task.
- */
-#define _CONFIGURE_IDLE_TASKS_COUNT _CONFIGURE_MAXIMUM_PROCESSORS
-
-/**
* This defines the formula used to compute the amount of memory
* reserved for internal task control structures.
*/
@@ -2670,23 +2525,6 @@ struct _reent *__getreent(void)
))
/**
- * This macro provides a summation of the memory required by the
- * Classic API as configured.
- */
-#define _CONFIGURE_MEMORY_FOR_CLASSIC \
- (_CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS + \
- _CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER ) + \
- _CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES) + \
- _CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \
- _CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \
- _CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ) + \
- _CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \
- _CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \
- _CONFIGURE_MEMORY_FOR_BARRIERS(_CONFIGURE_BARRIERS) + \
- _CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS) \
- )
-
-/**
* This calculates the memory required for the executive workspace.
*
* This is an internal parameter.
@@ -2698,17 +2536,14 @@ struct _reent *__getreent(void)
_CONFIGURE_TASKS, _CONFIGURE_TASKS) + \
_CONFIGURE_MEMORY_FOR_TASKS( \
_CONFIGURE_POSIX_THREADS, _CONFIGURE_POSIX_THREADS) + \
- _CONFIGURE_MEMORY_FOR_CLASSIC + \
- _CONFIGURE_MEMORY_FOR_POSIX_KEYS( \
- _CONFIGURE_POSIX_KEYS, \
- CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS ) + \
+ _CONFIGURE_MEMORY_FOR_MRSP_SEMAPHORES + \
_CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \
CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) + \
_CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \
CONFIGURE_MAXIMUM_POSIX_SEMAPHORES) + \
_CONFIGURE_MEMORY_FOR_POSIX_SHMS( \
CONFIGURE_MAXIMUM_POSIX_SHMS) + \
- _CONFIGURE_MEMORY_FOR_POSIX + \
+ _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS + \
_CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS + \
_CONFIGURE_MEMORY_FOR_MP + \
CONFIGURE_MESSAGE_BUFFER_MEMORY + \
@@ -2882,7 +2717,7 @@ struct _reent *__getreent(void)
const size_t _Thread_Maximum_name_size = CONFIGURE_MAXIMUM_THREAD_NAME_SIZE;
- typedef struct {
+ struct Thread_Configured_control {
Thread_Control Control;
#if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
void *extensions[ CONFIGURE_MAXIMUM_USER_EXTENSIONS + 1 ];
@@ -2902,43 +2737,41 @@ struct _reent *__getreent(void)
#else
struct { /* Empty */ } Newlib;
#endif
- } Configuration_Thread_control;
-
- const size_t _Thread_Control_size = sizeof( Configuration_Thread_control );
+ };
const Thread_Control_add_on _Thread_Control_add_ons[] = {
{
- offsetof( Configuration_Thread_control, Control.Scheduler.nodes ),
- offsetof( Configuration_Thread_control, Scheduler_nodes )
+ offsetof( Thread_Configured_control, Control.Scheduler.nodes ),
+ offsetof( Thread_Configured_control, Scheduler_nodes )
}, {
offsetof(
- Configuration_Thread_control,
+ Thread_Configured_control,
Control.API_Extensions[ THREAD_API_RTEMS ]
),
- offsetof( Configuration_Thread_control, API_RTEMS )
+ offsetof( Thread_Configured_control, API_RTEMS )
}, {
offsetof(
- Configuration_Thread_control,
+ Thread_Configured_control,
Control.libc_reent
),
- offsetof( Configuration_Thread_control, Newlib )
+ offsetof( Thread_Configured_control, Newlib )
}
#if CONFIGURE_MAXIMUM_THREAD_NAME_SIZE > 1
, {
offsetof(
- Configuration_Thread_control,
+ Thread_Configured_control,
Control.Join_queue.Queue.name
),
- offsetof( Configuration_Thread_control, name )
+ offsetof( Thread_Configured_control, name )
}
#endif
#ifdef RTEMS_POSIX_API
, {
offsetof(
- Configuration_Thread_control,
+ Thread_Configured_control,
Control.API_Extensions[ THREAD_API_POSIX ]
),
- offsetof( Configuration_Thread_control, API_POSIX )
+ offsetof( Thread_Configured_control, API_POSIX )
}
#endif
};
@@ -2946,46 +2779,122 @@ struct _reent *__getreent(void)
const size_t _Thread_Control_add_on_count =
RTEMS_ARRAY_SIZE( _Thread_Control_add_ons );
+ #if defined(RTEMS_SMP)
+ struct Thread_queue_Configured_heads {
+ Thread_queue_Heads Heads;
+ Thread_queue_Priority_queue Priority[ _CONFIGURE_SCHEDULER_COUNT ];
+ };
+
+ const size_t _Thread_queue_Heads_size =
+ sizeof( Thread_queue_Configured_heads );
+ #endif
+
const uint32_t _Watchdog_Nanoseconds_per_tick =
- 1000 * CONFIGURE_MICROSECONDS_PER_TICK;
+ (uint32_t) 1000 * CONFIGURE_MICROSECONDS_PER_TICK;
const uint32_t _Watchdog_Ticks_per_second = _CONFIGURE_TICKS_PER_SECOND;
+ const size_t _Thread_Initial_thread_count = _CONFIGURE_IDLE_TASKS_COUNT +
+ _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT +
+ rtems_resource_maximum_per_allocation( _CONFIGURE_TASKS ) +
+ rtems_resource_maximum_per_allocation( _CONFIGURE_POSIX_THREADS );
+
+ THREAD_INFORMATION_DEFINE(
+ _Thread,
+ OBJECTS_INTERNAL_API,
+ OBJECTS_INTERNAL_THREADS,
+ _CONFIGURE_IDLE_TASKS_COUNT + _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT
+ );
+
+ #if _CONFIGURE_BARRIERS > 0
+ BARRIER_INFORMATION_DEFINE( _CONFIGURE_BARRIERS );
+ #endif
+
+ #if CONFIGURE_MAXIMUM_MESSAGE_QUEUES > 0
+ MESSAGE_QUEUE_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_MESSAGE_QUEUES );
+ #endif
+
+ #if CONFIGURE_MAXIMUM_PARTITIONS > 0
+ PARTITION_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_PARTITIONS );
+ #endif
+
+ #if CONFIGURE_MAXIMUM_PERIODS > 0
+ RATE_MONOTONIC_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_PERIODS );
+ #endif
+
+ #if CONFIGURE_MAXIMUM_PORTS > 0
+ DUAL_PORTED_MEMORY_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_PORTS );
+ #endif
+
+ #if CONFIGURE_MAXIMUM_REGIONS > 0
+ REGION_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_REGIONS );
+ #endif
+
+ #if CONFIGURE_MAXIMUM_SEMAPHORES > 0
+ SEMAPHORE_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_SEMAPHORES );
+ #endif
+
+ #if _CONFIGURE_TIMERS > 0
+ TIMER_INFORMATION_DEFINE( _CONFIGURE_TIMERS );
+ #endif
+
+ #if _CONFIGURE_TASKS > 0
+ THREAD_INFORMATION_DEFINE(
+ _RTEMS_tasks,
+ OBJECTS_CLASSIC_API,
+ OBJECTS_RTEMS_TASKS,
+ _CONFIGURE_TASKS
+ );
+ #endif
+
+ #if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
+ EXTENSION_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_USER_EXTENSIONS );
+ #endif
+
/**
* This is the Classic API Configuration Table.
*/
rtems_api_configuration_table Configuration_RTEMS_API = {
- _CONFIGURE_TASKS,
- CONFIGURE_MAXIMUM_TIMERS + _CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER,
- CONFIGURE_MAXIMUM_SEMAPHORES,
- CONFIGURE_MAXIMUM_MESSAGE_QUEUES,
- CONFIGURE_MAXIMUM_PARTITIONS,
- CONFIGURE_MAXIMUM_REGIONS,
- CONFIGURE_MAXIMUM_PORTS,
- CONFIGURE_MAXIMUM_PERIODS,
- _CONFIGURE_BARRIERS,
CONFIGURE_INIT_TASK_TABLE_SIZE,
CONFIGURE_INIT_TASK_TABLE
};
+ #if CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS > 0
+ POSIX_Keys_Key_value_pair _POSIX_Keys_Key_value_pairs[
+ rtems_resource_maximum_per_allocation(
+ CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS
+ )
+ ];
+
+ const uint32_t _POSIX_Keys_Key_value_pair_maximum =
+ CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS;
+ #endif
+
+ #if _CONFIGURE_POSIX_KEYS > 0
+ POSIX_KEYS_INFORMATION_DEFINE( _CONFIGURE_POSIX_KEYS );
+ #endif
+
#if CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES > 0
- const uint32_t _Configuration_POSIX_Maximum_message_queues =
- CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES;
+ POSIX_MESSAGE_QUEUE_INFORMATION_DEFINE(
+ CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
+ );
#endif
#if CONFIGURE_MAXIMUM_POSIX_SEMAPHORES > 0
- const uint32_t _Configuration_POSIX_Maximum_named_semaphores =
- CONFIGURE_MAXIMUM_POSIX_SEMAPHORES;
+ POSIX_SEMAPHORE_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES );
#endif
#if CONFIGURE_MAXIMUM_POSIX_SHMS > 0
- const uint32_t _Configuration_POSIX_Maximum_shms =
- CONFIGURE_MAXIMUM_POSIX_SHMS;
+ POSIX_SHM_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_POSIX_SHMS );
#endif
#if _CONFIGURE_POSIX_THREADS > 0
- const uint32_t _Configuration_POSIX_Maximum_threads =
- _CONFIGURE_POSIX_THREADS;
+ THREAD_INFORMATION_DEFINE(
+ _POSIX_Threads,
+ OBJECTS_POSIX_API,
+ OBJECTS_POSIX_THREADS,
+ CONFIGURE_MAXIMUM_POSIX_THREADS
+ );
#endif
#ifdef RTEMS_POSIX_API
@@ -2995,8 +2904,7 @@ struct _reent *__getreent(void)
#endif
#if CONFIGURE_MAXIMUM_POSIX_TIMERS > 0
- const uint32_t _Configuration_POSIX_Maximum_timers =
- CONFIGURE_MAXIMUM_POSIX_TIMERS;
+ POSIX_TIMER_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_POSIX_TIMERS );
#endif
#endif
@@ -3021,8 +2929,6 @@ struct _reent *__getreent(void)
CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */
_CONFIGURE_STACK_SPACE_SIZE, /* required stack space */
CONFIGURE_MAXIMUM_USER_EXTENSIONS, /* maximum dynamic extensions */
- _CONFIGURE_POSIX_KEYS, /* POSIX keys are always */
- CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS, /* enabled */
CONFIGURE_MICROSECONDS_PER_TICK, /* microseconds per clock tick */
CONFIGURE_TICKS_PER_TIMESLICE, /* ticks per timeslice quantum */
CONFIGURE_IDLE_TASK_BODY, /* user's IDLE task */
@@ -3182,35 +3088,12 @@ struct _reent *__getreent(void)
uint32_t PER_INTEGER_TASK;
uint32_t FP_OVERHEAD;
- uint32_t CLASSIC;
- uint32_t POSIX;
/* System overhead pieces */
uint32_t MEMORY_FOR_IDLE_TASK;
- /* Classic API Pieces */
- uint32_t CLASSIC_TASKS;
- uint32_t TIMERS;
- uint32_t SEMAPHORES;
- uint32_t MESSAGE_QUEUES;
- uint32_t PARTITIONS;
- uint32_t REGIONS;
- uint32_t PORTS;
- uint32_t PERIODS;
- uint32_t BARRIERS;
- uint32_t USER_EXTENSIONS;
-
- /* POSIX API managers that are always enabled */
- uint32_t POSIX_KEYS;
-
/* POSIX API Pieces */
-#ifdef RTEMS_POSIX_API
- uint32_t POSIX_TIMERS;
uint32_t POSIX_QUEUED_SIGNALS;
-#endif
- uint32_t POSIX_MESSAGE_QUEUES;
- uint32_t POSIX_SEMAPHORES;
- uint32_t POSIX_SHMS;
/* Stack space sizes */
uint32_t IDLE_TASKS_STACK;
@@ -3230,36 +3113,12 @@ struct _reent *__getreent(void)
_CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS,
_CONFIGURE_MEMORY_FOR_TASKS(1, 0),
_CONFIGURE_MEMORY_FOR_TASKS(0, 1),
- _CONFIGURE_MEMORY_FOR_CLASSIC,
- _CONFIGURE_MEMORY_FOR_POSIX,
/* System overhead pieces */
_CONFIGURE_MEMORY_FOR_INTERNAL_TASKS,
- /* Classic API Pieces */
- _CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS, 0),
- _CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS),
- _CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES),
- _CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES),
- _CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS),
- _CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ),
- _CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS),
- _CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS),
- _CONFIGURE_MEMORY_FOR_BARRIERS(_CONFIGURE_BARRIERS),
- _CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS),
- _CONFIGURE_MEMORY_FOR_POSIX_KEYS( _CONFIGURE_POSIX_KEYS, \
- CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS ),
-
/* POSIX API Pieces */
-#ifdef RTEMS_POSIX_API
- _CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ),
- _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(
- CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ),
-#endif
- _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(
- CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ),
- _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ),
- _CONFIGURE_MEMORY_FOR_POSIX_SHMS( CONFIGURE_MAXIMUM_POSIX_SHMS ),
+ _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS,
/* Stack space sizes */
_CONFIGURE_IDLE_TASKS_STACK,
@@ -3311,21 +3170,6 @@ struct _reent *__getreent(void)
#error "CONFIGURATION ERROR: RTEMS not configured for multiprocessing!!"
#endif
-/*
- * If an attempt was made to configure POSIX objects and
- * the POSIX API was not configured into RTEMS, error out.
- *
- * @note POSIX Keys are always available so the parameters
- * CONFIGURE_MAXIMUM_POSIX_KEYS and
- * CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS are not in this list.
- */
-#if !defined(RTEMS_POSIX_API)
- #if ((CONFIGURE_MAXIMUM_POSIX_TIMERS != 0) || \
- (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0))
- #error "CONFIGURATION ERROR: POSIX API support not configured!!"
- #endif
-#endif
-
#if !defined(RTEMS_SCHEDSIM)
#if !defined(CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE)
/*
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index 36b20dba09..ae11fd9df8 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -127,18 +127,6 @@ typedef struct {
*/
uintptr_t stack_space_size;
- /**
- * This field specifies the maximum number of dynamically installed
- * used extensions.
- */
- uint32_t maximum_extensions;
-
- /**
- * This field contains the maximum number of POSIX API
- * keys which are configured for this application.
- */
- uint32_t maximum_keys;
-
/**
* This field contains the maximum number of POSIX API
* key value pairs which are configured for this application.
diff --git a/cpukit/include/rtems/extensiondata.h b/cpukit/include/rtems/extensiondata.h
index e665fda04f..61319d5668 100644
--- a/cpukit/include/rtems/extensiondata.h
+++ b/cpukit/include/rtems/extensiondata.h
@@ -37,6 +37,31 @@ typedef struct {
User_extensions_Control Extension;
} Extension_Control;
+/**
+ * @brief The Classic Extensions objects information.
+ */
+extern Objects_Information _Extension_Information;
+
+/**
+ * @brief Macro to define the objects information for the Classic Extensions
+ * objects.
+ *
+ * This macro should only be used by <rtems/confdefs.h>.
+ *
+ * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
+ * may be set).
+ */
+#define EXTENSION_INFORMATION_DEFINE( max ) \
+ OBJECTS_INFORMATION_DEFINE( \
+ _Extension, \
+ OBJECTS_CLASSIC_API, \
+ OBJECTS_RTEMS_EXTENSIONS, \
+ Extension_Control, \
+ max, \
+ OBJECTS_NO_STRING_NAME, \
+ NULL \
+ )
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/extensionimpl.h b/cpukit/include/rtems/extensionimpl.h
index fd71d530ae..6ad4956b3a 100644
--- a/cpukit/include/rtems/extensionimpl.h
+++ b/cpukit/include/rtems/extensionimpl.h
@@ -33,8 +33,6 @@ extern "C" {
* @{
*/
-extern Objects_Information _Extension_Information;
-
RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Allocate( void )
{
return (Extension_Control *) _Objects_Allocate( &_Extension_Information );
diff --git a/cpukit/include/rtems/posix/key.h b/cpukit/include/rtems/posix/key.h
index 1f09916f06..a710855b93 100644
--- a/cpukit/include/rtems/posix/key.h
+++ b/cpukit/include/rtems/posix/key.h
@@ -71,6 +71,24 @@ typedef struct {
} POSIX_Keys_Key_value_pair;
/**
+ * @brief The initial set of POSIX key and value pairs.
+ *
+ * This array is provided via <rtems/confdefs.h> in case POSIX key and value
+ * pairs are configured. The POSIX key and value pair count in this array must
+ * be equal to
+ * _Objects_Maximum_per_allocation( _POSIX_Keys_Key_value_pair_maximum ).
+ */
+extern POSIX_Keys_Key_value_pair _POSIX_Keys_Key_value_pairs[];
+
+/**
+ * @brief The POSIX key and value pairs maximum.
+ *
+ * This value is provided via <rtems/confdefs.h> in case POSIX key and value
+ * pairs are configured. The OBJECTS_UNLIMITED_OBJECTS flag may be set.
+ */
+extern const uint32_t _POSIX_Keys_Key_value_pair_maximum;
+
+/**
* @brief The data structure used to manage a POSIX key.
*/
typedef struct {
@@ -85,6 +103,30 @@ typedef struct {
Chain_Control Key_value_pairs;
} POSIX_Keys_Control;
+/**
+ * @brief The POSIX Key objects information.
+ */
+extern Objects_Information _POSIX_Keys_Information;
+
+/**
+ * @brief Macro to define the objects information for the POSIX Key objects.
+ *
+ * This macro should only be used by <rtems/confdefs.h>.
+ *
+ * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
+ * may be set).
+ */
+#define POSIX_KEYS_INFORMATION_DEFINE( max ) \
+ OBJECTS_INFORMATION_DEFINE( \
+ _POSIX_Keys, \
+ OBJECTS_POSIX_API, \
+ OBJECTS_POSIX_KEYS, \
+ POSIX_Keys_Control, \
+ max, \
+ OBJECTS_NO_STRING_NAME, \
+ NULL \
+ )
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/posix/keyimpl.h b/cpukit/include/rtems/posix/keyimpl.h
index 1148123638..d27244fe81 100644
--- a/cpukit/include/rtems/posix/keyimpl.h
+++ b/cpukit/include/rtems/posix/keyimpl.h
@@ -37,11 +37,6 @@ extern "C" {
*/
/**
- * @brief The information control block used to manage this class of objects.
- */
-extern Objects_Information _POSIX_Keys_Information;
-
-/**
* @brief This freechain is used as a memory pool for POSIX_Keys_Key_value_pair.
*/
extern Freechain_Control _POSIX_Keys_Keypool;
diff --git a/cpukit/include/rtems/posix/mqueue.h b/cpukit/include/rtems/posix/mqueue.h
index bec82ee3d9..84010e7d4f 100644
--- a/cpukit/include/rtems/posix/mqueue.h
+++ b/cpukit/include/rtems/posix/mqueue.h
@@ -31,11 +31,13 @@
#ifndef _RTEMS_POSIX_MQUEUE_H
#define _RTEMS_POSIX_MQUEUE_H
-#include <signal.h>
-#include <mqueue.h> /* struct mq_attr */
#include <rtems/score/coremsg.h>
#include <rtems/score/objectdata.h>
+#include <limits.h>
+#include <mqueue.h>
+#include <signal.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -61,7 +63,30 @@ typedef struct {
int oflag;
} POSIX_Message_queue_Control;
-extern const uint32_t _Configuration_POSIX_Maximum_message_queues;
+/**
+ * @brief The POSIX Message Queue objects information.
+ */
+extern Objects_Information _POSIX_Message_queue_Information;
+
+/**
+ * @brief Macro to define the objects information for the POSIX Message Queue
+ * objects.
+ *
+ * This macro should only be used by <rtems/confdefs.h>.
+ *
+ * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
+ * may be set).
+ */
+#define POSIX_MESSAGE_QUEUE_INFORMATION_DEFINE( max ) \
+ OBJECTS_INFORMATION_DEFINE( \
+ _POSIX_Message_queue, \
+ OBJECTS_POSIX_API, \
+ OBJECTS_POSIX_MESSAGE_QUEUES, \
+ POSIX_Message_queue_Control, \
+ max, \
+ _POSIX_PATH_MAX, \
+ NULL \
+ )
/** @} */
diff --git a/cpukit/include/rtems/posix/mqueueimpl.h b/cpukit/include/rtems/posix/mqueueimpl.h
index 28381ad54b..14573287ad 100644
--- a/cpukit/include/rtems/posix/mqueueimpl.h
+++ b/cpukit/include/rtems/posix/mqueueimpl.h
@@ -31,12 +31,6 @@ extern "C" {
#endif
/**
- * This defines the information control block used to manage
- * this class of objects.
- */
-extern Objects_Information _POSIX_Message_queue_Information;
-
-/**
* @brief Delete a POSIX Message Queue
*
* This routine supports the mq_unlink and mq_close routines by
diff --git a/cpukit/include/rtems/posix/pthread.h b/cpukit/include/rtems/posix/pthread.h
index 25bf40ef27..9b59fd922d 100644
--- a/cpukit/include/rtems/posix/pthread.h
+++ b/cpukit/include/rtems/posix/pthread.h
@@ -38,8 +38,6 @@ extern "C" {
extern const size_t _Configuration_POSIX_Minimum_stack_size;
-extern const uint32_t _Configuration_POSIX_Maximum_threads;
-
/**
* @brief POSIX threads initialize user threads body.
*
@@ -48,6 +46,12 @@ extern const uint32_t _Configuration_POSIX_Maximum_threads;
*/
extern void _POSIX_Threads_Initialize_user_threads_body(void);
+/**
+ * The following defines the information control block used to manage
+ * this class of objects.
+ */
+extern Thread_Information _POSIX_Threads_Information;
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/posix/pthreadimpl.h b/cpukit/include/rtems/posix/pthreadimpl.h
index be44716983..abb4d0f942 100644
--- a/cpukit/include/rtems/posix/pthreadimpl.h
+++ b/cpukit/include/rtems/posix/pthreadimpl.h
@@ -42,12 +42,6 @@ extern "C" {
*/
#define PTHREAD_MINIMUM_STACK_SIZE _Configuration_POSIX_Minimum_stack_size
-/**
- * The following defines the information control block used to manage
- * this class of objects.
- */
-extern Thread_Information _POSIX_Threads_Information;
-
#if defined(RTEMS_POSIX_API)
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Sporadic_timer_insert(
Thread_Control *the_thread,
diff --git a/cpukit/include/rtems/posix/semaphore.h b/cpukit/include/rtems/posix/semaphore.h
index 16b6d711cc..db36b39c9d 100644
--- a/cpukit/include/rtems/posix/semaphore.h
+++ b/cpukit/include/rtems/posix/semaphore.h
@@ -19,9 +19,11 @@
#ifndef _RTEMS_POSIX_SEMAPHORE_H
#define _RTEMS_POSIX_SEMAPHORE_H
-#include <semaphore.h>
#include <rtems/score/objectdata.h>
+#include <limits.h>
+#include <semaphore.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -46,7 +48,30 @@ typedef struct {
uint32_t open_count;
} POSIX_Semaphore_Control;
-extern const uint32_t _Configuration_POSIX_Maximum_named_semaphores;
+/**
+ * @brief The POSIX Semaphore objects information.
+ */
+extern Objects_Information _POSIX_Semaphore_Information;
+
+/**
+ * @brief Macro to define the objects information for the POSIX Semaphore
+ * objects.
+ *
+ * This macro should only be used by <rtems/confdefs.h>.
+ *
+ * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
+ * may be set).
+ */
+#define POSIX_SEMAPHORE_INFORMATION_DEFINE( max ) \
+ OBJECTS_INFORMATION_DEFINE( \
+ _POSIX_Semaphore, \
+ OBJECTS_POSIX_API, \
+ OBJECTS_POSIX_SEMAPHORES, \
+ POSIX_Semaphore_Control, \
+ max, \
+ _POSIX_PATH_MAX, \
+ NULL \
+ )
/** @} */
diff --git a/cpukit/include/rtems/posix/semaphoreimpl.h b/cpukit/include/rtems/posix/semaphoreimpl.h
index 5ae6a300fa..b662d001cb 100644
--- a/cpukit/include/rtems/posix/semaphoreimpl.h
+++ b/cpukit/include/rtems/posix/semaphoreimpl.h
@@ -34,12 +34,6 @@ extern "C" {
*/
#define POSIX_SEMAPHORE_MAGIC 0x5d367fe7UL
-/**
- * This defines the information control block used to manage
- * this class of objects.
- */
-extern Objects_Information _POSIX_Semaphore_Information;
-
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *
_POSIX_Semaphore_Allocate_unprotected( void )
{
diff --git a/cpukit/include/rtems/posix/shm.h b/cpukit/include/rtems/posix/shm.h
index ae0416e1fe..3d10e65fea 100644
--- a/cpukit/include/rtems/posix/shm.h
+++ b/cpukit/include/rtems/posix/shm.h
@@ -126,7 +126,30 @@ typedef struct {
time_t ctime;
} POSIX_Shm_Control;
-extern const uint32_t _Configuration_POSIX_Maximum_shms;
+/**
+ * @brief The POSIX Shared Memory objects information.
+ */
+extern Objects_Information _POSIX_Shm_Information;
+
+/**
+ * @brief Macro to define the objects information for the POSIX Shared Memory
+ * objects.
+ *
+ * This macro should only be used by <rtems/confdefs.h>.
+ *
+ * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
+ * may be set).
+ */
+#define POSIX_SHM_INFORMATION_DEFINE( max ) \
+ OBJECTS_INFORMATION_DEFINE( \
+ _POSIX_Shm, \
+ OBJECTS_POSIX_API, \
+ OBJECTS_POSIX_SHMS, \
+ POSIX_Shm_Control, \
+ max, \
+ _POSIX_PATH_MAX, \
+ NULL \
+ )
/**
* @brief object_create operation for shm objects stored in RTEMS Workspace.
diff --git a/cpukit/include/rtems/posix/shmimpl.h b/cpukit/include/rtems/posix/shmimpl.h
index f16af8123d..6882119a83 100644
--- a/cpukit/include/rtems/posix/shmimpl.h
+++ b/cpukit/include/rtems/posix/shmimpl.h
@@ -31,8 +31,6 @@ extern "C" {
* @{
*/
-extern Objects_Information _POSIX_Shm_Information;
-
RTEMS_INLINE_ROUTINE POSIX_Shm_Control *_POSIX_Shm_Allocate_unprotected( void )
{
return (POSIX_Shm_Control *)
diff --git a/cpukit/include/rtems/posix/sigset.h b/cpukit/include/rtems/posix/sigset.h
index 96bcc086ba..6f46f61104 100644
--- a/cpukit/include/rtems/posix/sigset.h
+++ b/cpukit/include/rtems/posix/sigset.h
@@ -19,7 +19,8 @@
#ifndef _RTEMS_POSIX_SIGSET_H
#define _RTEMS_POSIX_SIGSET_H
-#include <signal.h> // sigset_t
+#include <stdbool.h>
+#include <signal.h>
/*
* Currently 32 signals numbered 1-32 are defined
diff --git a/cpukit/include/rtems/posix/timer.h b/cpukit/include/rtems/posix/timer.h
index 2cbc56e873..0b7a91e256 100644
--- a/cpukit/include/rtems/posix/timer.h
+++ b/cpukit/include/rtems/posix/timer.h
@@ -50,7 +50,29 @@ typedef struct {
struct timespec time; /* Time at which the timer was started */
} POSIX_Timer_Control;
-extern const uint32_t _Configuration_POSIX_Maximum_timers;
+/**
+ * @brief The POSIX Timer objects information.
+ */
+extern Objects_Information _POSIX_Timer_Information;
+
+/**
+ * @brief Macro to define the objects information for the POSIX Timer objects.
+ *
+ * This macro should only be used by <rtems/confdefs.h>.
+ *
+ * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
+ * may be set).
+ */
+#define POSIX_TIMER_INFORMATION_DEFINE( max ) \
+ OBJECTS_INFORMATION_DEFINE( \
+ _POSIX_Timer, \
+ OBJECTS_POSIX_API, \
+ OBJECTS_POSIX_TIMERS, \
+ POSIX_Timer_Control, \
+ max, \
+ OBJECTS_NO_STRING_NAME, \
+ NULL \
+ )
/** @} */
diff --git a/cpukit/include/rtems/posix/timerimpl.h b/cpukit/include/rtems/posix/timerimpl.h
index 42a814c992..2b4eec1e24 100644
--- a/cpukit/include/rtems/posix/timerimpl.h
+++ b/cpukit/include/rtems/posix/timerimpl.h
@@ -52,12 +52,6 @@ extern "C" {
#endif
/**
- * The following defines the information control block used to manage
- * this class of objects.
- */
-extern Objects_Information _POSIX_Timer_Information;
-
-/**
* @brief POSIX Timer Allocate
*
* This function allocates a timer control block from
diff --git a/cpukit/include/rtems/rtems/barrierdata.h b/cpukit/include/rtems/rtems/barrierdata.h
index 12b2eab2d8..1598bbf6db 100644
--- a/cpukit/include/rtems/rtems/barrierdata.h
+++ b/cpukit/include/rtems/rtems/barrierdata.h
@@ -44,6 +44,31 @@ typedef struct {
rtems_attribute attribute_set;
} Barrier_Control;
+/**
+ * @brief The Classic Barrier objects information.
+ */
+extern Objects_Information _Barrier_Information;
+
+/**
+ * @brief Macro to define the objects information for the Classic Barrier
+ * objects.
+ *
+ * This macro should only be used by <rtems/confdefs.h>.
+ *
+ * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
+ * may be set).
+ */
+#define BARRIER_INFORMATION_DEFINE( max ) \
+ OBJECTS_INFORMATION_DEFINE( \
+ _Barrier, \
+ OBJECTS_CLASSIC_API, \
+ OBJECTS_RTEMS_BARRIERS, \
+ Barrier_Control, \
+ max, \
+ OBJECTS_NO_STRING_NAME, \
+ NULL \
+ )
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/rtems/barrierimpl.h b/cpukit/include/rtems/rtems/barrierimpl.h
index 0acef05af3..5494191610 100644
--- a/cpukit/include/rtems/rtems/barrierimpl.h
+++ b/cpukit/include/rtems/rtems/barrierimpl.h
@@ -35,12 +35,6 @@ extern "C" {
*/
/**
- * The following defines the information control block used to manage
- * this class of objects.
- */
-extern Objects_Information _Barrier_Information;
-
-/**
* @brief _Barrier_Allocate
*
* This function allocates a barrier control block from
diff --git a/cpukit/include/rtems/rtems/config.h b/cpukit/include/rtems/rtems/config.h
index 51b3dbe30f..a3e3988cd6 100644
--- a/cpukit/include/rtems/rtems/config.h
+++ b/cpukit/include/rtems/rtems/config.h
@@ -47,61 +47,6 @@ extern "C" {
* + required number of each object type
*/
typedef struct {
- /**
- * This field contains the maximum number of Classic API
- * Tasks which are configured for this application.
- */
- uint32_t maximum_tasks;
-
- /**
- * This field contains the maximum number of Classic API
- * Timers which are configured for this application.
- */
- uint32_t maximum_timers;
-
- /**
- * This field contains the maximum number of Classic API
- * Semaphores which are configured for this application.
- */
- uint32_t maximum_semaphores;
-
- /**
- * This field contains the maximum number of Classic API
- * Message Queues which are configured for this application.
- */
- uint32_t maximum_message_queues;
-
- /**
- * This field contains the maximum number of Classic API
- * Partitions which are configured for this application.
- */
- uint32_t maximum_partitions;
-
- /**
- * This field contains the maximum number of Classic API
- * Regions which are configured for this application.
- */
- uint32_t maximum_regions;
-
- /**
- * This field contains the maximum number of Classic API
- * Dual Ported Memory Areas which are configured for this
- * application.
- */
- uint32_t maximum_ports;
-
- /**
- * This field contains the maximum number of Classic API
- * Rate Monotonic Periods which are configured for this
- * application.
- */
- uint32_t maximum_periods;
-
- /**
- * This field contains the maximum number of Classic API
- * Barriers which are configured for this application.
- */
- uint32_t maximum_barriers;
/**
* This field contains the number of Classic API Initialization
diff --git a/cpukit/include/rtems/rtems/dpmemdata.h b/cpukit/include/rtems/rtems/dpmemdata.h
index 86302f9089..3727297482 100644
--- a/cpukit/include/rtems/rtems/dpmemdata.h
+++ b/cpukit/include/rtems/rtems/dpmemdata.h
@@ -46,6 +46,31 @@ typedef struct {
uint32_t length;
} Dual_ported_memory_Control;
+/**
+ * @brief The Classic Dual Ported Memory objects information.
+ */
+extern Objects_Information _Dual_ported_memory_Information;
+
+/**
+ * @brief Macro to define the objects information for the Classic Dual Ported
+ * Memory objects.
+ *
+ * This macro should only be used by <rtems/confdefs.h>.
+ *
+ * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
+ * may be set).
+ */
+#define DUAL_PORTED_MEMORY_INFORMATION_DEFINE( max ) \
+ OBJECTS_INFORMATION_DEFINE( \
+ _Dual_ported_memory, \
+ OBJECTS_CLASSIC_API, \
+ OBJECTS_RTEMS_PORTS, \
+ Dual_ported_memory_Control, \
+ max, \
+ OBJECTS_NO_STRING_NAME, \
+ NULL \
+ )
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/rtems/dpmemimpl.h b/cpukit/include/rtems/rtems/dpmemimpl.h
index 2b3fefd199..3da0d5237b 100644
--- a/cpukit/include/rtems/rtems/dpmemimpl.h
+++ b/cpukit/include/rtems/rtems/dpmemimpl.h
@@ -33,12 +33,6 @@ extern "C" {
*/
/**
- * @brief Define the internal Dual Ported Memory information
- * The following define the internal Dual Ported Memory information.
- */
-extern Objects_Information _Dual_ported_memory_Information;
-
-/**
* @brief Allocates a port control block from the inactive chain
* of free port control blocks.
*
diff --git a/cpukit/include/rtems/rtems/messagedata.h b/cpukit/include/rtems/rtems/messagedata.h
index b035dff97b..fa1f681473 100644
--- a/cpukit/include/rtems/rtems/messagedata.h
+++ b/cpukit/include/rtems/rtems/messagedata.h
@@ -44,6 +44,45 @@ typedef struct {
rtems_attribute attribute_set;
} Message_queue_Control;
+/**
+ * @brief The Classic Message Queue objects information.
+ */
+extern Objects_Information _Message_queue_Information;
+
+#if defined(RTEMS_MULTIPROCESSING)
+/**
+ * @brief _Message_queue_MP_Send_extract_proxy
+ *
+ * This routine is invoked when a task is deleted and it
+ * has a proxy which must be removed from a thread queue and
+ * the remote node must be informed of this.
+ */
+void _Message_queue_MP_Send_extract_proxy (
+ Thread_Control *the_thread,
+ Objects_Id id
+);
+#endif
+
+/**
+ * @brief Macro to define the objects information for the Classic Message Queue
+ * objects.
+ *
+ * This macro should only be used by <rtems/confdefs.h>.
+ *
+ * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
+ * may be set).
+ */
+#define MESSAGE_QUEUE_INFORMATION_DEFINE( max ) \
+ OBJECTS_INFORMATION_DEFINE( \
+ _Message_queue, \
+ OBJECTS_CLASSIC_API, \
+ OBJECTS_RTEMS_MESSAGE_QUEUES, \
+ Message_queue_Control, \
+ max, \
+ OBJECTS_NO_STRING_NAME, \
+ _Message_queue_MP_Send_extract_proxy \
+ )
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/rtems/messageimpl.h b/cpukit/include/rtems/rtems/messageimpl.h
index 098e310804..5872b67e04 100644
--- a/cpukit/include/rtems/rtems/messageimpl.h
+++ b/cpukit/include/rtems/rtems/messageimpl.h
@@ -52,12 +52,6 @@ typedef enum {
} Message_queue_Submit_types;
/**
- * The following defines the information control block used to
- * manage this class of objects.
- */
-extern Objects_Information _Message_queue_Information;
-
-/**
* @brief Message_queue_Submit
*
* This routine implements the directives rtems_message_queue_send
diff --git a/cpukit/include/rtems/rtems/msgmp.h b/cpukit/include/rtems/rtems/msgmp.h
index 3dabd8d46b..1c5818b44e 100644
--- a/cpukit/include/rtems/rtems/msgmp.h
+++ b/cpukit/include/rtems/rtems/msgmp.h
@@ -189,18 +189,6 @@ void _Message_queue_MP_Send_object_was_deleted (
Objects_Id mp_id
);
-/**
- * @brief _Message_queue_MP_Send_extract_proxy
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-void _Message_queue_MP_Send_extract_proxy (
- Thread_Control *the_thread,
- Objects_Id id
-);
-
/**@}*/
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/rtems/partdata.h b/cpukit/include/rtems/rtems/partdata.h
index 3b030c8f34..3be94b6cd1 100644
--- a/cpukit/include/rtems/rtems/partdata.h
+++ b/cpukit/include/rtems/rtems/partdata.h
@@ -53,6 +53,45 @@ typedef struct {
Chain_Control Memory;
} Partition_Control;
+/**
+ * @brief The Classic Partition objects information.
+ */
+extern Objects_Information _Partition_Information;
+
+#if defined(RTEMS_MULTIPROCESSING)
+/**
+ * @brief Partition_MP_Send_extract_proxy
+ *
+ * This routine is invoked when a task is deleted and it
+ * has a proxy which must be removed from a thread queue and
+ * the remote node must be informed of this.
+ */
+void _Partition_MP_Send_extract_proxy (
+ Thread_Control *the_thread,
+ Objects_Id id
+);
+#endif
+
+/**
+ * @brief Macro to define the objects information for the Classic Partition
+ * objects.
+ *
+ * This macro should only be used by <rtems/confdefs.h>.
+ *
+ * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
+ * may be set).
+ */
+#define PARTITION_INFORMATION_DEFINE( max ) \
+ OBJECTS_INFORMATION_DEFINE( \
+ _Partition, \
+ OBJECTS_CLASSIC_API, \
+ OBJECTS_RTEMS_PARTITIONS, \
+ Partition_Control, \
+ max, \
+ OBJECTS_NO_STRING_NAME, \
+ _Partition_MP_Send_extract_proxy \
+ )
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/rtems/partimpl.h b/cpukit/include/rtems/rtems/partimpl.h
index d795748723..0160d4add6 100644
--- a/cpukit/include/rtems/rtems/partimpl.h
+++ b/cpukit/include/rtems/rtems/partimpl.h
@@ -34,12 +34,6 @@ extern "C" {
*/
/**
- * The following defines the information control block used to
- * manage this class of objects.
- */
-extern Objects_Information _Partition_Information;
-
-/**
* @brief Allocate a buffer from the_partition.
*
* This function attempts to allocate a buffer from the_partition.
diff --git a/cpukit/include/rtems/rtems/partmp.h b/cpukit/include/rtems/rtems/partmp.h
index b9eaa08b8c..5fffd68480 100644
--- a/cpukit/include/rtems/rtems/partmp.h
+++ b/cpukit/include/rtems/rtems/partmp.h
@@ -122,18 +122,6 @@ void _Partition_MP_Process_packet (
* cannot be deleted when buffers are in use.
*/
-/**
- * @brief Partition_MP_Send_extract_proxy
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-void _Partition_MP_Send_extract_proxy (
- Thread_Control *the_thread,
- Objects_Id id
-);
-
#ifdef __cplusplus
}
#endif
diff --git a/cpukit/include/rtems/rtems/ratemondata.h b/cpukit/include/rtems/rtems/ratemondata.h
index 898fc653c1..0e4415237b 100644
--- a/cpukit/include/rtems/rtems/ratemondata.h
+++ b/cpukit/include/rtems/rtems/ratemondata.h
@@ -130,6 +130,31 @@ typedef struct {
uint64_t latest_deadline;
} Rate_monotonic_Control;
+/**
+ * @brief The Classic Rate Monotonic objects information.
+ */
+extern Objects_Information _Rate_monotonic_Information;
+
+/**
+ * @brief Macro to define the objects information for the Classic Rate
+ * Monotonic objects.
+ *
+ * This macro should only be used by <rtems/confdefs.h>.
+ *
+ * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
+ * may be set).
+ */
+#define RATE_MONOTONIC_INFORMATION_DEFINE( max ) \
+ OBJECTS_INFORMATION_DEFINE( \
+ _Rate_monotonic, \
+ OBJECTS_CLASSIC_API, \
+ OBJECTS_RTEMS_PERIODS, \
+ Rate_monotonic_Control, \
+ max, \
+ OBJECTS_NO_STRING_NAME, \
+ NULL \
+ )
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/rtems/ratemonimpl.h b/cpukit/include/rtems/rtems/ratemonimpl.h
index 2a417f66c6..eb359b17c8 100644
--- a/cpukit/include/rtems/rtems/ratemonimpl.h
+++ b/cpukit/include/rtems/rtems/ratemonimpl.h
@@ -49,14 +49,6 @@ extern "C" {
( THREAD_WAIT_CLASS_PERIOD | THREAD_WAIT_STATE_READY_AGAIN )
/**
- * @brief Rate Monotonic Period Class Management Structure
- *
- * This instance of Objects_Information is used to manage the
- * set of rate monotonic period instances.
- */
-extern Objects_Information _Rate_monotonic_Information;
-
-/**
* @brief Allocates a period control block from
* the inactive chain of free period control blocks.
*
diff --git a/cpukit/include/rtems/rtems/regiondata.h b/cpukit/include/rtems/rtems/regiondata.h
index cfbc07f713..c64f623c1d 100644
--- a/cpukit/include/rtems/rtems/regiondata.h
+++ b/cpukit/include/rtems/rtems/regiondata.h
@@ -46,6 +46,31 @@ typedef struct {
Heap_Control Memory;
} Region_Control;
+/**
+ * @brief The Classic Region objects information.
+ */
+extern Objects_Information _Region_Information;
+
+/**
+ * @brief Macro to define the objects information for the Classic Region
+ * objects.
+ *
+ * This macro should only be used by <rtems/confdefs.h>.
+ *
+ * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
+ * may be set).
+ */
+#define REGION_INFORMATION_DEFINE( max ) \
+ OBJECTS_INFORMATION_DEFINE( \
+ _Region, \
+ OBJECTS_CLASSIC_API, \
+ OBJECTS_RTEMS_REGIONS, \
+ Region_Control, \
+ max, \
+ OBJECTS_NO_STRING_NAME, \
+ NULL \
+ )
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/rtems/regionimpl.h b/cpukit/include/rtems/rtems/regionimpl.h
index 8a7ee258cc..35775671e6 100644
--- a/cpukit/include/rtems/rtems/regionimpl.h
+++ b/cpukit/include/rtems/rtems/regionimpl.h
@@ -39,12 +39,6 @@ extern "C" {
RTEMS_CONTAINER_OF( queue, Region_Control, Wait_queue.Queue )
/**
- * The following defines the information control block used to
- * manage this class of objects.
- */
-extern Objects_Information _Region_Information;
-
-/**
* @brief Region_Allocate
*
* This function allocates a region control block from
diff --git a/cpukit/include/rtems/rtems/semdata.h b/cpukit/include/rtems/rtems/semdata.h
index 04db07d6a0..d2275e5dfe 100644
--- a/cpukit/include/rtems/rtems/semdata.h
+++ b/cpukit/include/rtems/rtems/semdata.h
@@ -92,6 +92,45 @@ typedef struct {
#endif
} Semaphore_Control;
+/**
+ * @brief The Classic Semaphore objects information.
+ */
+extern Objects_Information _Semaphore_Information;
+
+#if defined(RTEMS_MULTIPROCESSING)
+/**
+ * @brief Semaphore MP Send Extract Proxy
+ *
+ * This routine is invoked when a task is deleted and it
+ * has a proxy which must be removed from a thread queue and
+ * the remote node must be informed of this.
+ */
+void _Semaphore_MP_Send_extract_proxy (
+ Thread_Control *the_thread,
+ Objects_Id id
+);
+#endif
+
+/**
+ * @brief Macro to define the objects information for the Classic Semaphore
+ * objects.
+ *
+ * This macro should only be used by <rtems/confdefs.h>.
+ *
+ * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
+ * may be set).
+ */
+#define SEMAPHORE_INFORMATION_DEFINE( max ) \
+ OBJECTS_INFORMATION_DEFINE( \
+ _Semaphore, \
+ OBJECTS_CLASSIC_API, \
+ OBJECTS_RTEMS_SEMAPHORES, \
+ Semaphore_Control, \
+ max, \
+ OBJECTS_NO_STRING_NAME, \
+ _Semaphore_MP_Send_extract_proxy \
+ )
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/rtems/semimpl.h b/cpukit/include/rtems/rtems/semimpl.h
index 1028879f39..743a4a9c6b 100644
--- a/cpukit/include/rtems/rtems/semimpl.h
+++ b/cpukit/include/rtems/rtems/semimpl.h
@@ -56,12 +56,6 @@ typedef enum {
SEMAPHORE_DISCIPLINE_FIFO
} Semaphore_Discipline;
-/**
- * The following defines the information control block used to manage
- * this class of objects.
- */
-extern Objects_Information _Semaphore_Information;
-
RTEMS_INLINE_ROUTINE const Thread_queue_Operations *_Semaphore_Get_operations(
const Semaphore_Control *the_semaphore
)
diff --git a/cpukit/include/rtems/rtems/semmp.h b/cpukit/include/rtems/rtems/semmp.h
index 9d7669f43e..31774c39ba 100644
--- a/cpukit/include/rtems/rtems/semmp.h
+++ b/cpukit/include/rtems/rtems/semmp.h
@@ -120,18 +120,6 @@ void _Semaphore_MP_Send_object_was_deleted (
);
/**
- * @brief Semaphore MP Send Extract Proxy
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-void _Semaphore_MP_Send_extract_proxy (
- Thread_Control *the_thread,
- Objects_Id id
-);
-
-/**
* @brief Semaphore Core Mutex MP Support
*
* This function processes the global actions necessary for remote
diff --git a/cpukit/include/rtems/rtems/tasksdata.h b/cpukit/include/rtems/rtems/tasksdata.h
index 18562bf067..19e6a8a618 100644
--- a/cpukit/include/rtems/rtems/tasksdata.h
+++ b/cpukit/include/rtems/rtems/tasksdata.h
@@ -67,6 +67,12 @@ typedef struct {
extern void _RTEMS_tasks_Initialize_user_tasks_body( void );
+/**
+ * The following instantiates the information control block used to
+ * manage this class of objects.
+ */
+extern Thread_Information _RTEMS_tasks_Information;
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/rtems/tasksimpl.h b/cpukit/include/rtems/rtems/tasksimpl.h
index b6694cc416..c98f1a3ab0 100644
--- a/cpukit/include/rtems/rtems/tasksimpl.h
+++ b/cpukit/include/rtems/rtems/tasksimpl.h
@@ -35,12 +35,6 @@ extern "C" {
*/
/**
- * The following instantiates the information control block used to
- * manage this class of objects.
- */
-extern Thread_Information _RTEMS_tasks_Information;
-
-/**
* @brief RTEMS User Task Initialization
*
* This routine creates and starts all configured user
diff --git a/cpukit/include/rtems/rtems/timerdata.h b/cpukit/include/rtems/rtems/timerdata.h
index db32739488..ed00671b10 100644
--- a/cpukit/include/rtems/rtems/timerdata.h
+++ b/cpukit/include/rtems/rtems/timerdata.h
@@ -57,6 +57,31 @@ typedef struct {
Watchdog_Interval stop_time;
} Timer_Control;
+/**
+ * @brief The Classic Timer objects information.
+ */
+extern Objects_Information _Timer_Information;
+
+/**
+ * @brief Macro to define the objects information for the Classic Timer
+ * objects.
+ *
+ * This macro should only be used by <rtems/confdefs.h>.
+ *
+ * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
+ * may be set).
+ */
+#define TIMER_INFORMATION_DEFINE( max ) \
+ OBJECTS_INFORMATION_DEFINE( \
+ _Timer, \
+ OBJECTS_CLASSIC_API, \
+ OBJECTS_RTEMS_TIMERS, \
+ Timer_Control, \
+ max, \
+ OBJECTS_NO_STRING_NAME, \
+ NULL \
+ )
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/rtems/timerimpl.h b/cpukit/include/rtems/rtems/timerimpl.h
index d62db3b34a..59b2b9f816 100644
--- a/cpukit/include/rtems/rtems/timerimpl.h
+++ b/cpukit/include/rtems/rtems/timerimpl.h
@@ -53,12 +53,6 @@ typedef struct Timer_server_Control {
extern Timer_server_Control *volatile _Timer_server;
/**
- * The following defines the information control block used to manage
- * this class of objects.
- */
-extern Objects_Information _Timer_Information;
-
-/**
* @brief Timer_Allocate
*
* This function allocates a timer control block from
diff --git a/cpukit/include/rtems/score/freechain.h b/cpukit/include/rtems/score/freechain.h
index 1540c0e2a1..6282178347 100644
--- a/cpukit/include/rtems/score/freechain.h
+++ b/cpukit/include/rtems/score/freechain.h
@@ -17,7 +17,7 @@
#define _RTEMS_SCORE_FREECHAIN_H
#include <rtems/score/basedefs.h>
-#include <rtems/score/chain.h>
+#include <rtems/score/chainimpl.h>
#ifdef __cplusplus
extern "C" {
@@ -58,16 +58,24 @@ typedef struct {
* get more nodes.
*
* @param[in] freechain The freechain control to initialize.
- * @param[in] allocator The allocator function.
+ * @param[in] initial_nodes Array with the initial nodes.
* @param[in] number_nodes The initial number of nodes.
* @param[in] node_size The node size.
*/
-void _Freechain_Initialize(
+RTEMS_INLINE_ROUTINE void _Freechain_Initialize(
Freechain_Control *freechain,
- Freechain_Allocator allocator,
+ void *initial_nodes,
size_t number_nodes,
size_t node_size
-);
+)
+{
+ _Chain_Initialize(
+ &freechain->Free,
+ initial_nodes,
+ number_nodes,
+ node_size
+ );
+}
/**
* @brief Gets a node from the freechain.
diff --git a/cpukit/include/rtems/score/interr.h b/cpukit/include/rtems/score/interr.h
index 0c734e855f..df1a1298d9 100644
--- a/cpukit/include/rtems/score/interr.h
+++ b/cpukit/include/rtems/score/interr.h
@@ -173,7 +173,7 @@ typedef enum {
/* INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY = 16, */
/* INTERNAL_ERROR_IMPLEMENTATION_BLOCKING_OPERATION_CANCEL = 17, */
/* INTERNAL_ERROR_THREAD_QUEUE_ENQUEUE_FROM_BAD_STATE = 18, */
- INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0 = 19,
+ /* INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0 = 19, */
/* INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP = 20, */
INTERNAL_ERROR_GXX_KEY_ADD_FAILED = 21,
INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED = 22,
diff --git a/cpukit/include/rtems/score/object.h b/cpukit/include/rtems/score/object.h
index e7861ecab1..f75d1de2ab 100644
--- a/cpukit/include/rtems/score/object.h
+++ b/cpukit/include/rtems/score/object.h
@@ -307,18 +307,11 @@ RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Get_index(
*
* @return This method returns an object Id constructed from the arguments.
*/
-RTEMS_INLINE_ROUTINE Objects_Id _Objects_Build_id(
- Objects_APIs the_api,
- uint16_t the_class,
- uint8_t node,
- uint16_t index
-)
-{
- return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
- (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
- (( (Objects_Id) node ) << OBJECTS_NODE_START_BIT) |
- (( (Objects_Id) index ) << OBJECTS_INDEX_START_BIT);
-}
+#define _Objects_Build_id( the_api, the_class, node, index ) \
+ ( (Objects_Id) ( (Objects_Id) the_api << OBJECTS_API_START_BIT ) | \
+ ( (Objects_Id) the_class << OBJECTS_CLASS_START_BIT ) | \
+ ( (Objects_Id) node << OBJECTS_NODE_START_BIT ) | \
+ ( (Objects_Id) index << OBJECTS_INDEX_START_BIT ) )
/**
* Returns if the object maximum specifies unlimited objects.
@@ -328,10 +321,8 @@ RTEMS_INLINE_ROUTINE Objects_Id _Objects_Build_id(
* @retval true Unlimited objects are available.
* @retval false The object count is fixed.
*/
-RTEMS_INLINE_ROUTINE bool _Objects_Is_unlimited( uint32_t maximum )
-{
- return (maximum & OBJECTS_UNLIMITED_OBJECTS) != 0;
-}
+#define _Objects_Is_unlimited( maximum ) \
+ ( ( ( maximum ) & OBJECTS_UNLIMITED_OBJECTS ) != 0 )
/*
* We cannot use an inline function for this since it may be evaluated at
diff --git a/cpukit/include/rtems/score/objectdata.h b/cpukit/include/rtems/score/objectdata.h
index 51258fa4a4..6139bfc1ec 100644
--- a/cpukit/include/rtems/score/objectdata.h
+++ b/cpukit/include/rtems/score/objectdata.h
@@ -19,7 +19,7 @@
#define _RTEMS_SCORE_OBJECTDATA_H
#include <rtems/score/object.h>
-#include <rtems/score/chain.h>
+#include <rtems/score/chainimpl.h>
#include <rtems/score/rbtree.h>
#ifdef __cplusplus
@@ -45,7 +45,57 @@ typedef struct {
Objects_Name name;
} Objects_Control;
+/**
+ * This enumerated type is used in the class field of the object ID
+ * for RTEMS internal object classes.
+ */
+typedef enum {
+ OBJECTS_INTERNAL_NO_CLASS = 0,
+ OBJECTS_INTERNAL_THREADS = 1
+} Objects_Internal_API;
+
+/**
+ * This enumerated type is used in the class field of the object ID
+ * for the RTEMS Classic API.
+ */
+typedef enum {
+ OBJECTS_CLASSIC_NO_CLASS = 0,
+ OBJECTS_RTEMS_TASKS = 1,
+ OBJECTS_RTEMS_TIMERS = 2,
+ OBJECTS_RTEMS_SEMAPHORES = 3,
+ OBJECTS_RTEMS_MESSAGE_QUEUES = 4,
+ OBJECTS_RTEMS_PARTITIONS = 5,
+ OBJECTS_RTEMS_REGIONS = 6,
+ OBJECTS_RTEMS_PORTS = 7,
+ OBJECTS_RTEMS_PERIODS = 8,
+ OBJECTS_RTEMS_EXTENSIONS = 9,
+ OBJECTS_RTEMS_BARRIERS = 10
+} Objects_Classic_API;
+
+/**
+ * This enumerated type is used in the class field of the object ID
+ * for the POSIX API.
+ */
+typedef enum {
+ OBJECTS_POSIX_NO_CLASS = 0,
+ OBJECTS_POSIX_THREADS = 1,
+ OBJECTS_POSIX_KEYS = 2,
+ OBJECTS_POSIX_INTERRUPTS = 3,
+ OBJECTS_POSIX_MESSAGE_QUEUES = 5,
+ OBJECTS_POSIX_SEMAPHORES = 7,
+ OBJECTS_POSIX_TIMERS = 9,
+ OBJECTS_POSIX_SHMS = 12
+} Objects_POSIX_API;
+
+/**
+ * @brief Constant for the object information string name length to indicate
+ * that this object class has no string names.
+ */
+#define OBJECTS_NO_STRING_NAME 0
+
#if defined( RTEMS_MULTIPROCESSING )
+struct _Thread_Control;
+
/**
* @brief This defines the Global Object Control Block used to manage objects
* resident on other nodes.
@@ -86,8 +136,139 @@ typedef struct {
*/
uint32_t name;
} Objects_MP_Control;
+
+/**
+ * The following type defines the callout used when a local task
+ * is extracted from a remote thread queue (i.e. it's proxy must
+ * extracted from the remote queue).
+ */
+typedef void ( *Objects_Thread_queue_Extract_callout )(
+ struct _Thread_Control *,
+ Objects_Id
+);
#endif
+/**
+ * The following defines the structure for the information used to
+ * manage each class of objects.
+ */
+typedef struct {
+ /** This is the maximum valid id of this object class. */
+ Objects_Id maximum_id;
+ /** This points to the table of local objects. */
+ Objects_Control **local_table;
+ /** This is the number of objects on the Inactive list. */
+ Objects_Maximum inactive;
+ /** This is the number of objects in a block. */
+ Objects_Maximum objects_per_block;
+ /** This is the size in bytes of each object instance. */
+ uint16_t object_size;
+ /**
+ * @brief This is the maximum length of names.
+ *
+ * A length of zero indicates that this object has a no string name
+ * (OBJECTS_NO_STRING_NAME).
+ */
+ uint16_t name_length;
+ /** This is the chain of inactive control blocks. */
+ Chain_Control Inactive;
+ /** This is the number of inactive objects per block. */
+ Objects_Maximum *inactive_per_block;
+ /** This is a table to the chain of inactive object memory blocks. */
+ Objects_Control **object_blocks;
+ Objects_Control *initial_objects;
+ #if defined(RTEMS_MULTIPROCESSING)
+ /** This is this object class' method called when extracting a thread. */
+ Objects_Thread_queue_Extract_callout extract;
+
+ /**
+ * @brief The global objects of this object information sorted by object
+ * identifier.
+ */
+ RBTree_Control Global_by_id;
+
+ /**
+ * @brief The global objects of this object information sorted by object
+ * name.
+ *
+ * Objects with the same name are sorted according to their identifier.
+ */
+ RBTree_Control Global_by_name;
+ #endif
+} Objects_Information;
+
+#if defined(RTEMS_MULTIPROCESSING)
+#define OBJECTS_INFORMATION_MP( name, extract ) \
+ , \
+ extract, \
+ RBTREE_INITIALIZER_EMPTY( name.Global_by_id ), \
+ RBTREE_INITIALIZER_EMPTY( name.Global_by_name )
+#else
+#define OBJECTS_INFORMATION_MP( name, extract )
+#endif
+
+/**
+ * @brief Statically initializes an objects information.
+ *
+ * The initialized objects information contains no objects.
+ *
+ * @param name The object class C designator namespace prefix, e.g. _Semaphore.
+ * @param api The object API number, e.g. OBJECTS_CLASSIC_API.
+ * @param cls The object class number, e.g. OBJECTS_RTEMS_SEMAPHORES.
+ * @param nl The object name string length, use OBJECTS_NO_STRING_NAME for
+ * objects without a string name.
+ */
+#define OBJECTS_INFORMATION_DEFINE_ZERO( name, api, cls, nl ) \
+Objects_Information name##_Information = { \
+ _Objects_Build_id( api, cls, 1, 0 ), \
+ NULL, \
+ 0, \
+ 0, \
+ 0, \
+ nl, \
+ CHAIN_INITIALIZER_EMPTY( name##_Information.Inactive ), \
+ NULL, \
+ NULL, \
+ NULL \
+ OBJECTS_INFORMATION_MP( name##_Information, NULL ) \
+}
+
+/**
+ * @brief Statically initializes an objects information.
+ *
+ * The initialized objects information references a table with statically
+ * allocated objects as specified by the object maximum parameter. These
+ * objects must be registered via a call to _Objects_Information().
+ *
+ * @param name The object class C designator namespace prefix, e.g. _Semaphore.
+ * @param api The object API number, e.g. OBJECTS_CLASSIC_API.
+ * @param cls The object class number, e.g. OBJECTS_RTEMS_SEMAPHORES.
+ * @param type The object class type.
+ * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
+ * may be set).
+ * @param nl The object name string length, use OBJECTS_NO_STRING_NAME for
+ * objects without a string name.
+ * @param ex The optional object extraction method. Used only if
+ * multiprocessing (RTEMS_MULTIPROCESSING) is enabled.
+ */
+#define OBJECTS_INFORMATION_DEFINE( name, api, cls, type, max, nl, ex ) \
+static Objects_Control * \
+name##_Local_table[ _Objects_Maximum_per_allocation( max ) ]; \
+static type name##_Objects[ _Objects_Maximum_per_allocation( max ) ]; \
+Objects_Information name##_Information = { \
+ _Objects_Build_id( api, cls, 1, _Objects_Maximum_per_allocation( max ) ), \
+ name##_Local_table, \
+ 0, \
+ _Objects_Is_unlimited( max ) ? _Objects_Maximum_per_allocation( max ) : 0, \
+ sizeof( type ), \
+ nl, \
+ CHAIN_INITIALIZER_EMPTY( name##_Information.Inactive ), \
+ NULL, \
+ NULL, \
+ &name##_Objects[ 0 ].Object \
+ OBJECTS_INFORMATION_MP( name##_Information, ex ) \
+}
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/score/objectimpl.h b/cpukit/include/rtems/score/objectimpl.h
index bbf32fcd80..c5a315e57f 100644
--- a/cpukit/include/rtems/score/objectimpl.h
+++ b/cpukit/include/rtems/score/objectimpl.h
@@ -43,54 +43,12 @@ typedef bool (*Objects_Name_comparators)(
uint16_t /* length */
);
-/**
- * This enumerated type is used in the class field of the object ID
- * for RTEMS internal object classes.
- */
-typedef enum {
- OBJECTS_INTERNAL_NO_CLASS = 0,
- OBJECTS_INTERNAL_THREADS = 1
-} Objects_Internal_API;
-
/** This macro is used to generically specify the last API index. */
#define OBJECTS_INTERNAL_CLASSES_LAST OBJECTS_INTERNAL_THREADS
-/**
- * This enumerated type is used in the class field of the object ID
- * for the RTEMS Classic API.
- */
-typedef enum {
- OBJECTS_CLASSIC_NO_CLASS = 0,
- OBJECTS_RTEMS_TASKS = 1,
- OBJECTS_RTEMS_TIMERS = 2,
- OBJECTS_RTEMS_SEMAPHORES = 3,
- OBJECTS_RTEMS_MESSAGE_QUEUES = 4,
- OBJECTS_RTEMS_PARTITIONS = 5,
- OBJECTS_RTEMS_REGIONS = 6,
- OBJECTS_RTEMS_PORTS = 7,
- OBJECTS_RTEMS_PERIODS = 8,
- OBJECTS_RTEMS_EXTENSIONS = 9,
- OBJECTS_RTEMS_BARRIERS = 10
-} Objects_Classic_API;
-
/** This macro is used to generically specify the last API index. */
#define OBJECTS_RTEMS_CLASSES_LAST OBJECTS_RTEMS_BARRIERS
-/**
- * This enumerated type is used in the class field of the object ID
- * for the POSIX API.
- */
-typedef enum {
- OBJECTS_POSIX_NO_CLASS = 0,
- OBJECTS_POSIX_THREADS = 1,
- OBJECTS_POSIX_KEYS = 2,
- OBJECTS_POSIX_INTERRUPTS = 3,
- OBJECTS_POSIX_MESSAGE_QUEUES = 5,
- OBJECTS_POSIX_SEMAPHORES = 7,
- OBJECTS_POSIX_TIMERS = 9,
- OBJECTS_POSIX_SHMS = 12
-} Objects_POSIX_API;
-
/** This macro is used to generically specify the last API index. */
#define OBJECTS_POSIX_CLASSES_LAST OBJECTS_POSIX_SHMS
@@ -103,71 +61,6 @@ typedef enum {
OBJECTS_FAKE_OBJECTS_SCHEDULERS = 1
} Objects_Fake_objects_API;
-#if defined(RTEMS_MULTIPROCESSING)
-/**
- * The following type defines the callout used when a local task
- * is extracted from a remote thread queue (i.e. it's proxy must
- * extracted from the remote queue).
- */
-typedef void ( *Objects_Thread_queue_Extract_callout )(
- Thread_Control *,
- Objects_Id
-);
-#endif
-
-/**
- * The following defines the structure for the information used to
- * manage each class of objects.
- */
-typedef struct {
- /** This is the maximum valid id of this object class. */
- Objects_Id maximum_id;
- /** This points to the table of local objects. */
- Objects_Control **local_table;
- /** This is the number of objects on the Inactive list. */
- Objects_Maximum inactive;
- /**
- * @brief This is the number of objects in a block if the automatic extension
- * is enabled.
- *
- * This member is zero if the automatic extension is disabled.
- */
- Objects_Maximum objects_per_block;
- /** This is the size in bytes of each object instance. */
- uint16_t object_size;
- /**
- * @brief This is the maximum length of names.
- *
- * A length of zero indicates that this object has a no string name
- * (OBJECTS_NO_STRING_NAME).
- */
- uint16_t name_length;
- /** This is the chain of inactive control blocks. */
- Chain_Control Inactive;
- /** This is the number of inactive objects per block. */
- Objects_Maximum *inactive_per_block;
- /** This is a table to the chain of inactive object memory blocks. */
- Objects_Control **object_blocks;
- #if defined(RTEMS_MULTIPROCESSING)
- /** This is this object class' method called when extracting a thread. */
- Objects_Thread_queue_Extract_callout extract;
-
- /**
- * @brief The global objects of this object information sorted by object
- * identifier.
- */
- RBTree_Control Global_by_id;
-
- /**
- * @brief The global objects of this object information sorted by object
- * name.
- *
- * Objects with the same name are sorted according to their identifier.
- */
- RBTree_Control Global_by_name;
- #endif
-} Objects_Information;
-
/**
* The following is referenced to the node number of the local node.
*/
@@ -222,84 +115,13 @@ void _Objects_Shrink_information(
Objects_Information *information
);
-void _Objects_Do_initialize_information(
- Objects_Information *information,
- Objects_APIs the_api,
- uint16_t the_class,
- uint32_t maximum,
- uint16_t object_size,
- uint16_t maximum_name_length
-#if defined(RTEMS_MULTIPROCESSING)
- ,
- Objects_Thread_queue_Extract_callout extract
-#endif
-);
-
/**
- * @brief Constant for the object information string name length to indicate
- * that this object class has no string names.
- */
-#define OBJECTS_NO_STRING_NAME 0
-
-/**
- * @brief Initialize object Information
- *
- * This function initializes an object class information record.
- * SUPPORTS_GLOBAL is true if the object class supports global
- * objects, and false otherwise. Maximum indicates the number
- * of objects required in this class and size indicates the size
- * in bytes of each control block for this object class. The
- * name length and string designator are also set. In addition,
- * the class may be a task, therefore this information is also included.
+ * @brief Initializes the specified objects information.
*
- * @param[in] information points to an object class information block.
- * @param[in] the_api indicates the API associated with this information block.
- * @param[in] the_class indicates the class of object being managed
- * by this information block. It is specific to @a the_api.
- * @param[in] maximum is the maximum number of instances of this object
- * class which may be concurrently active.
- * @param[in] object_size is the size of the data structure for this class.
- * @param[in] is_string is true if this object uses string style names.
- * @param[in] maximum_name_length is the maximum length of object names.
+ * The objects information must be statically pre-initialized with the
+ * OBJECTS_INFORMATION_DEFINE() macro before this function is called.
*/
-#if defined(RTEMS_MULTIPROCESSING)
- #define _Objects_Initialize_information( \
- information, \
- the_api, \
- the_class, \
- maximum, \
- object_size, \
- maximum_name_length, \
- extract \
- ) \
- _Objects_Do_initialize_information( \
- information, \
- the_api, \
- the_class, \
- maximum, \
- object_size, \
- maximum_name_length, \
- extract \
- )
-#else
- #define _Objects_Initialize_information( \
- information, \
- the_api, \
- the_class, \
- maximum, \
- object_size, \
- maximum_name_length, \
- extract \
- ) \
- _Objects_Do_initialize_information( \
- information, \
- the_api, \
- the_class, \
- maximum, \
- object_size, \
- maximum_name_length \
- )
-#endif
+void _Objects_Initialize_information( Objects_Information *information );
/**
* @brief Object API Maximum Class
diff --git a/cpukit/include/rtems/score/thread.h b/cpukit/include/rtems/score/thread.h
index 7e24af43c9..9bf920d5fb 100644
--- a/cpukit/include/rtems/score/thread.h
+++ b/cpukit/include/rtems/score/thread.h
@@ -26,6 +26,7 @@
#if defined(RTEMS_MULTIPROCESSING)
#include <rtems/score/mppkt.h>
#endif
+#include <rtems/score/freechain.h>
#include <rtems/score/isrlock.h>
#include <rtems/score/objectdata.h>
#include <rtems/score/priority.h>
@@ -909,7 +910,7 @@ typedef struct {
*
* This array is provided via <rtems/confdefs.h>.
*
- * @see _Thread_Control_add_on_count and _Thread_Control_size.
+ * @see _Thread_Control_add_on_count.
*/
extern const Thread_Control_add_on _Thread_Control_add_ons[];
@@ -923,13 +924,11 @@ extern const Thread_Control_add_on _Thread_Control_add_ons[];
extern const size_t _Thread_Control_add_on_count;
/**
- * @brief Size of the thread control block of a particular application.
+ * @brief Count of configured threads.
*
* This value is provided via <rtems/confdefs.h>.
- *
- * @see _Thread_Control_add_ons.
*/
-extern const size_t _Thread_Control_size;
+extern const size_t _Thread_Initial_thread_count;
/**
* @brief Maximum size of a thread name in characters (including the
@@ -939,6 +938,115 @@ extern const size_t _Thread_Control_size;
*/
extern const size_t _Thread_Maximum_name_size;
+/**
+ * @brief The configured thread control block.
+ *
+ * This type is defined in <rtems/confdefs.h> and depends on the application
+ * configuration.
+ */
+typedef struct Thread_Configured_control Thread_Configured_control;
+
+/**
+ * @brief The configured thread queue heads.
+ *
+ * In SMP configurations, this type is defined in <rtems/confdefs.h> and depends
+ * on the application configuration.
+ */
+#if defined(RTEMS_SMP)
+typedef struct Thread_queue_Configured_heads Thread_queue_Configured_heads;
+#else
+typedef Thread_queue_Heads Thread_queue_Configured_heads;
+#endif
+
+/**
+ * @brief Size of the thread queue heads of a particular application.
+ *
+ * In SMP configurations, this value is provided via <rtems/confdefs.h>.
+ */
+#if defined(RTEMS_SMP)
+extern const size_t _Thread_queue_Heads_size;
+#else
+#define _Thread_queue_Heads_size sizeof(Thread_queue_Heads)
+#endif
+
+/**
+ * @brief The thread object information.
+ */
+typedef struct {
+ /**
+ * @brief The object information.
+ */
+ Objects_Information Objects;
+
+ /**
+ * @brief Thread queue heads maintenance.
+ */
+ union {
+ /**
+ * @brief Contains the initial set of thread queue heads.
+ *
+ * This is set by <rtems/confdefs.h> via THREAD_INFORMATION_DEFINE().
+ */
+ Thread_queue_Configured_heads *initial;
+
+ /**
+ * @brief The free thread queue heads.
+ *
+ * This member is initialized by _Thread_Initialize_information().
+ */
+ Freechain_Control Free;
+ } Thread_queue_heads;
+} Thread_Information;
+
+/**
+ * @brief The internal thread objects information.
+ */
+extern Thread_Information _Thread_Information;
+
+#define THREAD_INFORMATION_DEFINE_ZERO( name, api, cls ) \
+Thread_Information name##_Information = { \
+ { \
+ _Objects_Build_id( api, cls, 1, 0 ), \
+ NULL, \
+ 0, \
+ 0, \
+ 0, \
+ 0, \
+ CHAIN_INITIALIZER_EMPTY( name##_Information.Objects.Inactive ), \
+ NULL, \
+ NULL, \
+ NULL \
+ OBJECTS_INFORMATION_MP( name##_Information.Objects, NULL ), \
+ }, { \
+ NULL \
+ } \
+}
+
+#define THREAD_INFORMATION_DEFINE( name, api, cls, max ) \
+static Objects_Control * \
+name##_Local_table[ _Objects_Maximum_per_allocation( max ) ]; \
+static Thread_Configured_control \
+name##_Objects[ _Objects_Maximum_per_allocation( max ) ]; \
+static Thread_queue_Configured_heads \
+name##_Heads[ _Objects_Maximum_per_allocation( max ) ]; \
+Thread_Information name##_Information = { \
+ { \
+ _Objects_Build_id( api, cls, 1, _Objects_Maximum_per_allocation( max ) ), \
+ name##_Local_table, \
+ 0, \
+ _Objects_Is_unlimited( max ) ? _Objects_Maximum_per_allocation( max ) : 0, \
+ sizeof( Thread_Configured_control ), \
+ OBJECTS_NO_STRING_NAME, \
+ CHAIN_INITIALIZER_EMPTY( name##_Information.Objects.Inactive ), \
+ NULL, \
+ NULL, \
+ &name##_Objects[ 0 ].Control.Object \
+ OBJECTS_INFORMATION_MP( name##_Information.Objects, NULL ) \
+ }, { \
+ &name##_Heads[ 0 ] \
+ } \
+}
+
/**@}*/
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/score/threadimpl.h b/cpukit/include/rtems/score/threadimpl.h
index 0e93cb501d..d3e69ed91c 100644
--- a/cpukit/include/rtems/score/threadimpl.h
+++ b/cpukit/include/rtems/score/threadimpl.h
@@ -34,7 +34,6 @@
#include <rtems/score/timestampimpl.h>
#include <rtems/score/threadqimpl.h>
#include <rtems/score/todimpl.h>
-#include <rtems/score/freechain.h>
#include <rtems/score/watchdogimpl.h>
#include <rtems/config.h>
@@ -58,18 +57,6 @@ extern "C" {
*/
extern void *rtems_ada_self;
-typedef struct {
- Objects_Information Objects;
-
- Freechain_Control Free_thread_queue_heads;
-} Thread_Information;
-
-/**
- * The following defines the information control block used to
- * manage this class of objects.
- */
-extern Thread_Information _Thread_Internal_information;
-
/**
* @brief Object identifier of the global constructor thread.
*
@@ -100,12 +87,7 @@ void _Thread_Iterate(
void *arg
);
-void _Thread_Initialize_information(
- Thread_Information *information,
- Objects_APIs the_api,
- uint16_t the_class,
- uint32_t maximum
-);
+void _Thread_Initialize_information( Thread_Information *information );
/**
* @brief Initialize thread handler.
@@ -828,7 +810,7 @@ RTEMS_INLINE_ROUTINE uint32_t _Thread_Get_maximum_internal_threads(void)
RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Internal_allocate( void )
{
return (Thread_Control *)
- _Objects_Allocate_unprotected( &_Thread_Internal_information.Objects );
+ _Objects_Allocate_unprotected( &_Thread_Information.Objects );
}
/**
diff --git a/cpukit/include/rtems/score/threadq.h b/cpukit/include/rtems/score/threadq.h
index 5ddc2a10bb..c0a11770fb 100644
--- a/cpukit/include/rtems/score/threadq.h
+++ b/cpukit/include/rtems/score/threadq.h
@@ -394,15 +394,6 @@ typedef struct _Thread_queue_Heads {
#endif
} Thread_queue_Heads;
-#if defined(RTEMS_SMP)
- #define THREAD_QUEUE_HEADS_SIZE( scheduler_count ) \
- ( sizeof( Thread_queue_Heads ) \
- + ( scheduler_count ) * sizeof( Thread_queue_Priority_queue ) )
-#else
- #define THREAD_QUEUE_HEADS_SIZE( scheduler_count ) \
- sizeof( Thread_queue_Heads )
-#endif
-
struct Thread_queue_Queue {
/**
* @brief Lock to protect this thread queue.
diff --git a/cpukit/posix/src/key.c b/cpukit/posix/src/key.c
index a39e8d6479..0309a26da5 100644
--- a/cpukit/posix/src/key.c
+++ b/cpukit/posix/src/key.c
@@ -1,158 +1,47 @@
/**
* @file
*
- * @brief POSIX Keys Manager Initialization
- * @ingroup POSIX_KEY Key
+ * @ingroup POSIX_KEY
+ *
+ * @brief POSIX Keys Information with Zero Objects
*/
/*
- * Copyright (c) 2012 Zhongwei Yao.
- * COPYRIGHT (c) 1989-2014.
- * On-Line Applications Research Corporation (OAR).
- * Copyright (c) 2016 embedded brains GmbH.
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018 embedded brains GmbH
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
-#include <limits.h>
-
-#include <rtems/config.h>
-#include <rtems/sysinit.h>
-
-#include <rtems/posix/keyimpl.h>
-#include <rtems/score/userextimpl.h>
-#include <rtems/score/wkspace.h>
-
-Objects_Information _POSIX_Keys_Information;
-
-Freechain_Control _POSIX_Keys_Keypool;
-
-static uint32_t _POSIX_Keys_Get_keypool_bump_count( void )
-{
- uint32_t max = Configuration.maximum_key_value_pairs;
-
- return _Objects_Is_unlimited( max ) ?
- _Objects_Maximum_per_allocation( max ) : 0;
-}
-
-static uint32_t _POSIX_Keys_Get_initial_keypool_size( void )
-{
- uint32_t max = Configuration.maximum_key_value_pairs;
-
- return _Objects_Maximum_per_allocation( max );
-}
-
-static void _POSIX_Keys_Initialize_keypool( void )
-{
- _Freechain_Initialize(
- &_POSIX_Keys_Keypool,
- _Workspace_Allocate_or_fatal_error,
- _POSIX_Keys_Get_initial_keypool_size(),
- sizeof( POSIX_Keys_Key_value_pair )
- );
-}
-
-POSIX_Keys_Key_value_pair * _POSIX_Keys_Key_value_allocate( void )
-{
- return (POSIX_Keys_Key_value_pair *) _Freechain_Get(
- &_POSIX_Keys_Keypool,
- _Workspace_Allocate,
- _POSIX_Keys_Get_keypool_bump_count(),
- sizeof( POSIX_Keys_Key_value_pair )
- );
-}
-
-static void _POSIX_Keys_Run_destructors( Thread_Control *the_thread )
-{
- while ( true ) {
- ISR_lock_Context lock_context;
- RBTree_Node *node;
-
- _Objects_Allocator_lock();
- _POSIX_Keys_Key_value_acquire( the_thread, &lock_context );
-
- node = _RBTree_Root( &the_thread->Keys.Key_value_pairs );
- if ( node != NULL ) {
- POSIX_Keys_Key_value_pair *key_value_pair;
- pthread_key_t key;
- void *value;
- POSIX_Keys_Control *the_key;
- void ( *destructor )( void * );
-
- key_value_pair = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( node );
- key = key_value_pair->key;
- value = key_value_pair->value;
- _RBTree_Extract(
- &the_thread->Keys.Key_value_pairs,
- &key_value_pair->Lookup_node
- );
-
- _POSIX_Keys_Key_value_release( the_thread, &lock_context );
- _POSIX_Keys_Key_value_free( key_value_pair );
-
- the_key = _POSIX_Keys_Get( key );
- _Assert( the_key != NULL );
- destructor = the_key->destructor;
-
- _Objects_Allocator_unlock();
-
- if ( destructor != NULL && value != NULL ) {
- ( *destructor )( value );
- }
- } else {
- _POSIX_Keys_Key_value_release( the_thread, &lock_context );
- _Objects_Allocator_unlock();
- break;
- }
- }
-}
-
-static void _POSIX_Keys_Restart_run_destructors(
- Thread_Control *executing,
- Thread_Control *the_thread
-)
-{
- (void) executing;
- _POSIX_Keys_Run_destructors( the_thread );
-}
-
-static User_extensions_Control _POSIX_Keys_Extensions = {
- .Callouts = {
- .thread_restart = _POSIX_Keys_Restart_run_destructors,
- .thread_terminate = _POSIX_Keys_Run_destructors
- }
-};
-
-/**
- * @brief This routine performs the initialization necessary for this manager.
- */
-static void _POSIX_Keys_Manager_initialization(void)
-{
- _Objects_Initialize_information(
- &_POSIX_Keys_Information, /* object information table */
- OBJECTS_POSIX_API, /* object API */
- OBJECTS_POSIX_KEYS, /* object class */
- Configuration.maximum_keys,
- /* maximum objects of this class */
- sizeof( POSIX_Keys_Control ),
- /* size of this object's control block */
- OBJECTS_NO_STRING_NAME, /* maximum length of each object's name */
- NULL /* Proxy extraction support callout */
- );
-
- _POSIX_Keys_Initialize_keypool();
-
- _User_extensions_Add_API_set( &_POSIX_Keys_Extensions );
-}
+#include <rtems/posix/key.h>
-RTEMS_SYSINIT_ITEM(
- _POSIX_Keys_Manager_initialization,
- RTEMS_SYSINIT_POSIX_KEYS,
- RTEMS_SYSINIT_ORDER_MIDDLE
+OBJECTS_INFORMATION_DEFINE_ZERO(
+ _POSIX_Keys,
+ OBJECTS_POSIX_API,
+ OBJECTS_POSIX_KEYS,
+ OBJECTS_NO_STRING_NAME
);
diff --git a/cpukit/posix/src/keycreate.c b/cpukit/posix/src/keycreate.c
index 432bfd86b6..b4f1c87335 100644
--- a/cpukit/posix/src/keycreate.c
+++ b/cpukit/posix/src/keycreate.c
@@ -20,6 +20,9 @@
#endif
#include <rtems/posix/keyimpl.h>
+#include <rtems/score/userextimpl.h>
+#include <rtems/score/wkspace.h>
+#include <rtems/sysinit.h>
#include <errno.h>
@@ -47,3 +50,119 @@ int pthread_key_create(
_Objects_Allocator_unlock();
return 0;
}
+
+Freechain_Control _POSIX_Keys_Keypool;
+
+static uint32_t _POSIX_Keys_Get_keypool_bump_count( void )
+{
+ uint32_t max;
+
+ max = _POSIX_Keys_Key_value_pair_maximum;
+ return _Objects_Is_unlimited( max ) ?
+ _Objects_Maximum_per_allocation( max ) : 0;
+}
+
+static uint32_t _POSIX_Keys_Get_initial_keypool_size( void )
+{
+ uint32_t max;
+
+ max = _POSIX_Keys_Key_value_pair_maximum;
+ return _Objects_Maximum_per_allocation( max );
+}
+
+static void _POSIX_Keys_Initialize_keypool( void )
+{
+ _Freechain_Initialize(
+ &_POSIX_Keys_Keypool,
+ _POSIX_Keys_Key_value_pairs,
+ _POSIX_Keys_Get_initial_keypool_size(),
+ sizeof( _POSIX_Keys_Key_value_pairs[ 0 ] )
+ );
+}
+
+POSIX_Keys_Key_value_pair * _POSIX_Keys_Key_value_allocate( void )
+{
+ return (POSIX_Keys_Key_value_pair *) _Freechain_Get(
+ &_POSIX_Keys_Keypool,
+ _Workspace_Allocate,
+ _POSIX_Keys_Get_keypool_bump_count(),
+ sizeof( POSIX_Keys_Key_value_pair )
+ );
+}
+
+static void _POSIX_Keys_Run_destructors( Thread_Control *the_thread )
+{
+ while ( true ) {
+ ISR_lock_Context lock_context;
+ RBTree_Node *node;
+
+ _Objects_Allocator_lock();
+ _POSIX_Keys_Key_value_acquire( the_thread, &lock_context );
+
+ node = _RBTree_Root( &the_thread->Keys.Key_value_pairs );
+ if ( node != NULL ) {
+ POSIX_Keys_Key_value_pair *key_value_pair;
+ pthread_key_t key;
+ void *value;
+ POSIX_Keys_Control *the_key;
+ void ( *destructor )( void * );
+
+ key_value_pair = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( node );
+ key = key_value_pair->key;
+ value = key_value_pair->value;
+ _RBTree_Extract(
+ &the_thread->Keys.Key_value_pairs,
+ &key_value_pair->Lookup_node
+ );
+
+ _POSIX_Keys_Key_value_release( the_thread, &lock_context );
+ _POSIX_Keys_Key_value_free( key_value_pair );
+
+ the_key = _POSIX_Keys_Get( key );
+ _Assert( the_key != NULL );
+ destructor = the_key->destructor;
+
+ _Objects_Allocator_unlock();
+
+ if ( destructor != NULL && value != NULL ) {
+ ( *destructor )( value );
+ }
+ } else {
+ _POSIX_Keys_Key_value_release( the_thread, &lock_context );
+ _Objects_Allocator_unlock();
+ break;
+ }
+ }
+}
+
+static void _POSIX_Keys_Restart_run_destructors(
+ Thread_Control *executing,
+ Thread_Control *the_thread
+)
+{
+ (void) executing;
+ _POSIX_Keys_Run_destructors( the_thread );
+}
+
+static User_extensions_Control _POSIX_Keys_Extensions = {
+ .Callouts = {
+ .thread_restart = _POSIX_Keys_Restart_run_destructors,
+ .thread_terminate = _POSIX_Keys_Run_destructors
+ }
+};
+
+/**
+ * @brief This routine performs the initialization necessary for this manager.
+ */
+static void _POSIX_Keys_Manager_initialization(void)
+{
+ _Objects_Initialize_information( &_POSIX_Keys_Information );
+ _POSIX_Keys_Initialize_keypool();
+ _User_extensions_Add_API_set( &_POSIX_Keys_Extensions );
+}
+
+RTEMS_SYSINIT_ITEM(
+ _POSIX_Keys_Manager_initialization,
+ RTEMS_SYSINIT_POSIX_KEYS,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/posix/src/keyzerokvp.c b/cpukit/posix/src/keyzerokvp.c
new file mode 100644
index 0000000000..0419678821
--- /dev/null
+++ b/cpukit/posix/src/keyzerokvp.c
@@ -0,0 +1,36 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018 embedded brains GmbH
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/posix/key.h>
+
+POSIX_Keys_Key_value_pair _POSIX_Keys_Key_value_pairs[ 0 ];
+
+const uint32_t _POSIX_Keys_Key_value_pair_maximum;
diff --git a/cpukit/posix/src/mqueue.c b/cpukit/posix/src/mqueue.c
index 192d853c35..21c5feb8be 100644
--- a/cpukit/posix/src/mqueue.c
+++ b/cpukit/posix/src/mqueue.c
@@ -1,66 +1,49 @@
/**
* @file
*
- * @brief Initializes message_queue Manager Related Data Structures
- * @ingroup POSIX_MQUEUE_P Message Queues Private Support Information
+ * @ingroup POSIX_MQUEUE_P
+ *
+ * @brief POSIX Message Queue Information with Zero Objects
*/
/*
- * COPYRIGHT (c) 1989-2008.
- * On-Line Applications Research Corporation (OAR).
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018 embedded brains GmbH
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
-#include <stdarg.h>
-
-#include <pthread.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <mqueue.h>
-#include <limits.h>
-
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/sysinit.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
-Objects_Information _POSIX_Message_queue_Information;
-
-/*
- * _POSIX_Message_queue_Manager_initialization
- *
- * This routine initializes all message_queue manager related data structures.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-static void _POSIX_Message_queue_Manager_initialization(void)
-{
- _Objects_Initialize_information(
- &_POSIX_Message_queue_Information, /* object information table */
- OBJECTS_POSIX_API, /* object API */
- OBJECTS_POSIX_MESSAGE_QUEUES, /* object class */
- _Configuration_POSIX_Maximum_message_queues,
- sizeof( POSIX_Message_queue_Control ),
- /* size of this object's control block */
- _POSIX_PATH_MAX, /* maximum length of each object's name */
- NULL /* Proxy extraction support callout */
- );
-}
+#include <limits.h>
-RTEMS_SYSINIT_ITEM(
- _POSIX_Message_queue_Manager_initialization,
- RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE,
- RTEMS_SYSINIT_ORDER_MIDDLE
+OBJECTS_INFORMATION_DEFINE_ZERO(
+ _POSIX_Message_queue,
+ OBJECTS_POSIX_API,
+ OBJECTS_POSIX_MESSAGE_QUEUES,
+ _POSIX_PATH_MAX
);
diff --git a/cpukit/posix/src/mqueueopen.c b/cpukit/posix/src/mqueueopen.c
index fe63d4ea6e..4bb8025e65 100644
--- a/cpukit/posix/src/mqueueopen.c
+++ b/cpukit/posix/src/mqueueopen.c
@@ -32,6 +32,7 @@
#include <rtems/posix/mqueueimpl.h>
#include <rtems/score/wkspace.h>
+#include <rtems/sysinit.h>
#include <stdarg.h>
#include <fcntl.h>
@@ -191,3 +192,14 @@ mqd_t mq_open(
_Objects_Allocator_unlock();
return status;
}
+
+static void _POSIX_Message_queue_Manager_initialization( void )
+{
+ _Objects_Initialize_information( &_POSIX_Message_queue_Information );
+}
+
+RTEMS_SYSINIT_ITEM(
+ _POSIX_Message_queue_Manager_initialization,
+ RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/posix/src/psxsemaphore.c b/cpukit/posix/src/psxsemaphore.c
index a26ba7563e..952587a19f 100644
--- a/cpukit/posix/src/psxsemaphore.c
+++ b/cpukit/posix/src/psxsemaphore.c
@@ -1,57 +1,49 @@
/**
* @file
*
- * @brief POSIX Function Initializes Semaphore Manager
- * @ingroup POSIXAPI
+ * @ingroup POSIXSemaphorePrivate
+ *
+ * @brief POSIX Semaphore Information with Zero Objects
*/
/*
- * COPYRIGHT (c) 1989-2008.
- * On-Line Applications Research Corporation (OAR).
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018 embedded brains GmbH
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/posix/semaphoreimpl.h>
-#include <rtems/config.h>
-#include <rtems/sysinit.h>
+#include <rtems/posix/semaphore.h>
#include <limits.h>
-Objects_Information _POSIX_Semaphore_Information;
-
-/*
- * _POSIX_Semaphore_Manager_initialization
- *
- * This routine initializes all semaphore manager related data structures.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-static void _POSIX_Semaphore_Manager_initialization(void)
-{
- _Objects_Initialize_information(
- &_POSIX_Semaphore_Information, /* object information table */
- OBJECTS_POSIX_API, /* object API */
- OBJECTS_POSIX_SEMAPHORES, /* object class */
- _Configuration_POSIX_Maximum_named_semaphores,
- sizeof( POSIX_Semaphore_Control ),
- /* size of this object's control block */
- _POSIX_PATH_MAX, /* maximum length of each object's name */
- NULL /* Proxy extraction support callout */
- );
-}
-
-RTEMS_SYSINIT_ITEM(
- _POSIX_Semaphore_Manager_initialization,
- RTEMS_SYSINIT_POSIX_SEMAPHORE,
- RTEMS_SYSINIT_ORDER_MIDDLE
+OBJECTS_INFORMATION_DEFINE_ZERO(
+ _POSIX_Semaphore,
+ OBJECTS_POSIX_API,
+ OBJECTS_POSIX_SEMAPHORES,
+ _POSIX_PATH_MAX
);
diff --git a/cpukit/posix/src/psxtimercreate.c b/cpukit/posix/src/psxtimercreate.c
index 5123071d99..ba5d066194 100644
--- a/cpukit/posix/src/psxtimercreate.c
+++ b/cpukit/posix/src/psxtimercreate.c
@@ -24,12 +24,12 @@
#include <errno.h>
#include <signal.h>
-#include <rtems/system.h>
-#include <rtems/seterr.h>
-#include <rtems/score/thread.h>
#include <rtems/posix/sigset.h>
#include <rtems/posix/timerimpl.h>
+#include <rtems/score/thread.h>
#include <rtems/score/watchdogimpl.h>
+#include <rtems/seterr.h>
+#include <rtems/sysinit.h>
int timer_create(
clockid_t clock_id,
@@ -99,3 +99,14 @@ int timer_create(
_Objects_Allocator_unlock();
return 0;
}
+
+static void _POSIX_Timer_Manager_initialization( void )
+{
+ _Objects_Initialize_information( &_POSIX_Timer_Information );
+}
+
+RTEMS_SYSINIT_ITEM(
+ _POSIX_Timer_Manager_initialization,
+ RTEMS_SYSINIT_POSIX_TIMER,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
index 0a790f9371..18c8635497 100644
--- a/cpukit/posix/src/pthread.c
+++ b/cpukit/posix/src/pthread.c
@@ -17,192 +17,11 @@
#if HAVE_CONFIG_H
#include "config.h"
#endif
-#include <stdio.h>
-#include <errno.h>
-#include <pthread.h>
-#include <limits.h>
-#include <assert.h>
+#include <rtems/posix/pthread.h>
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/sysinit.h>
-#include <rtems/score/stack.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/threadqimpl.h>
-#include <rtems/score/userextimpl.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/posix/pthreadimpl.h>
-#include <rtems/posix/priorityimpl.h>
-#if defined(RTEMS_POSIX_API)
-#include <rtems/posix/psignalimpl.h>
-#endif
-#include <rtems/posix/config.h>
-#include <rtems/posix/keyimpl.h>
-#include <rtems/score/assert.h>
-#include <rtems/score/schedulerimpl.h>
-
-Thread_Information _POSIX_Threads_Information;
-
-#if defined(RTEMS_POSIX_API)
-void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog )
-{
- POSIX_API_Control *api;
- Thread_Control *the_thread;
- Thread_queue_Context queue_context;
-
- api = RTEMS_CONTAINER_OF( watchdog, POSIX_API_Control, Sporadic.Timer );
- the_thread = api->Sporadic.thread;
-
- _Thread_queue_Context_initialize( &queue_context );
- _Thread_queue_Context_clear_priority_updates( &queue_context );
- _Thread_Wait_acquire( the_thread, &queue_context );
-
- if ( _Priority_Node_is_active( &api->Sporadic.Low_priority ) ) {
- _Thread_Priority_add(
- the_thread,
- &the_thread->Real_priority,
- &queue_context
- );
- _Thread_Priority_remove(
- the_thread,
- &api->Sporadic.Low_priority,
- &queue_context
- );
- _Priority_Node_set_inactive( &api->Sporadic.Low_priority );
- }
-
- _Watchdog_Per_CPU_remove_ticks( &api->Sporadic.Timer );
- _POSIX_Threads_Sporadic_timer_insert( the_thread, api );
-
- _Thread_Wait_release( the_thread, &queue_context );
- _Thread_Priority_update( &queue_context );
-}
-
-void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread )
-{
- POSIX_API_Control *api;
- Thread_queue_Context queue_context;
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- _Thread_queue_Context_initialize( &queue_context );
- _Thread_queue_Context_clear_priority_updates( &queue_context );
- _Thread_Wait_acquire( the_thread, &queue_context );
-
- /*
- * This will prevent the thread from consuming its entire "budget"
- * while at low priority.
- */
- the_thread->cpu_time_budget = UINT32_MAX;
-
- if ( !_Priority_Node_is_active( &api->Sporadic.Low_priority ) ) {
- _Thread_Priority_add(
- the_thread,
- &api->Sporadic.Low_priority,
- &queue_context
- );
- _Thread_Priority_remove(
- the_thread,
- &the_thread->Real_priority,
- &queue_context
- );
- }
-
- _Thread_Wait_release( the_thread, &queue_context );
- _Thread_Priority_update( &queue_context );
-}
-
-/*
- * _POSIX_Threads_Create_extension
- *
- * This method is invoked for each thread created.
- */
-
-static bool _POSIX_Threads_Create_extension(
- Thread_Control *executing RTEMS_UNUSED,
- Thread_Control *created
-)
-{
- POSIX_API_Control *api;
-
- api = created->API_Extensions[ THREAD_API_POSIX ];
-
- api->Sporadic.thread = created;
- _Watchdog_Preinitialize( &api->Sporadic.Timer, _Per_CPU_Get_by_index( 0 ) );
- _Watchdog_Initialize( &api->Sporadic.Timer, _POSIX_Threads_Sporadic_timer );
- _Priority_Node_set_inactive( &api->Sporadic.Low_priority );
-
- return true;
-}
-
-static void _POSIX_Threads_Terminate_extension( Thread_Control *executing )
-{
- POSIX_API_Control *api;
- ISR_lock_Context lock_context;
-
- api = executing->API_Extensions[ THREAD_API_POSIX ];
-
- _Thread_State_acquire( executing, &lock_context );
- _Watchdog_Per_CPU_remove_ticks( &api->Sporadic.Timer );
- _Thread_State_release( executing, &lock_context );
-}
-#endif
-
-/*
- * _POSIX_Threads_Exitted_extension
- *
- * This method is invoked each time a thread exits.
- */
-static void _POSIX_Threads_Exitted_extension(
- Thread_Control *executing
-)
-{
- /*
- * If the executing thread was not created with the POSIX API, then this
- * API do not get to define its exit behavior.
- */
- if ( _Objects_Get_API( executing->Object.id ) == OBJECTS_POSIX_API )
- pthread_exit( executing->Wait.return_argument );
-}
-
-User_extensions_Control _POSIX_Threads_User_extensions = {
- .Callouts = {
-#if defined(RTEMS_POSIX_API)
- .thread_create = _POSIX_Threads_Create_extension,
- .thread_terminate = _POSIX_Threads_Terminate_extension,
-#endif
- .thread_exitted = _POSIX_Threads_Exitted_extension
- }
-};
-
-/*
- * _POSIX_Threads_Manager_initialization
- *
- * This routine initializes all threads manager related data structures.
- */
-static void _POSIX_Threads_Manager_initialization(void)
-{
- _Thread_Initialize_information(
- &_POSIX_Threads_Information, /* object information table */
- OBJECTS_POSIX_API, /* object API */
- OBJECTS_POSIX_THREADS, /* object class */
- _Configuration_POSIX_Maximum_threads
- );
-
- /*
- * Add all the extensions for this API
- */
- _User_extensions_Add_API_set( &_POSIX_Threads_User_extensions );
-
- /*
- * If we supported MP, then here we would ...
- * Register the MP Process Packet routine.
- */
-}
-
-RTEMS_SYSINIT_ITEM(
- _POSIX_Threads_Manager_initialization,
- RTEMS_SYSINIT_POSIX_THREADS,
- RTEMS_SYSINIT_ORDER_MIDDLE
+THREAD_INFORMATION_DEFINE_ZERO(
+ _POSIX_Threads,
+ OBJECTS_POSIX_API,
+ OBJECTS_POSIX_THREADS
);
diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c
index 39a241350f..b70be00217 100644
--- a/cpukit/posix/src/pthreadcreate.c
+++ b/cpukit/posix/src/pthreadcreate.c
@@ -26,6 +26,9 @@
#include <errno.h>
#include <rtems/posix/priorityimpl.h>
+#if defined(RTEMS_POSIX_API)
+#include <rtems/posix/psignalimpl.h>
+#endif
#include <rtems/posix/pthreadimpl.h>
#include <rtems/posix/pthreadattrimpl.h>
#include <rtems/score/assert.h>
@@ -33,6 +36,8 @@
#include <rtems/score/apimutex.h>
#include <rtems/score/stackimpl.h>
#include <rtems/score/schedulerimpl.h>
+#include <rtems/score/userextimpl.h>
+#include <rtems/sysinit.h>
static inline size_t _POSIX_Threads_Ensure_minimum_stack (
size_t size
@@ -299,3 +304,136 @@ int pthread_create(
_Objects_Allocator_unlock();
return 0;
}
+
+#if defined(RTEMS_POSIX_API)
+void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog )
+{
+ POSIX_API_Control *api;
+ Thread_Control *the_thread;
+ Thread_queue_Context queue_context;
+
+ api = RTEMS_CONTAINER_OF( watchdog, POSIX_API_Control, Sporadic.Timer );
+ the_thread = api->Sporadic.thread;
+
+ _Thread_queue_Context_initialize( &queue_context );
+ _Thread_queue_Context_clear_priority_updates( &queue_context );
+ _Thread_Wait_acquire( the_thread, &queue_context );
+
+ if ( _Priority_Node_is_active( &api->Sporadic.Low_priority ) ) {
+ _Thread_Priority_add(
+ the_thread,
+ &the_thread->Real_priority,
+ &queue_context
+ );
+ _Thread_Priority_remove(
+ the_thread,
+ &api->Sporadic.Low_priority,
+ &queue_context
+ );
+ _Priority_Node_set_inactive( &api->Sporadic.Low_priority );
+ }
+
+ _Watchdog_Per_CPU_remove_ticks( &api->Sporadic.Timer );
+ _POSIX_Threads_Sporadic_timer_insert( the_thread, api );
+
+ _Thread_Wait_release( the_thread, &queue_context );
+ _Thread_Priority_update( &queue_context );
+}
+
+void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread )
+{
+ POSIX_API_Control *api;
+ Thread_queue_Context queue_context;
+
+ api = the_thread->API_Extensions[ THREAD_API_POSIX ];
+
+ _Thread_queue_Context_initialize( &queue_context );
+ _Thread_queue_Context_clear_priority_updates( &queue_context );
+ _Thread_Wait_acquire( the_thread, &queue_context );
+
+ /*
+ * This will prevent the thread from consuming its entire "budget"
+ * while at low priority.
+ */
+ the_thread->cpu_time_budget = UINT32_MAX;
+
+ if ( !_Priority_Node_is_active( &api->Sporadic.Low_priority ) ) {
+ _Thread_Priority_add(
+ the_thread,
+ &api->Sporadic.Low_priority,
+ &queue_context
+ );
+ _Thread_Priority_remove(
+ the_thread,
+ &the_thread->Real_priority,
+ &queue_context
+ );
+ }
+
+ _Thread_Wait_release( the_thread, &queue_context );
+ _Thread_Priority_update( &queue_context );
+}
+
+static bool _POSIX_Threads_Create_extension(
+ Thread_Control *executing RTEMS_UNUSED,
+ Thread_Control *created
+)
+{
+ POSIX_API_Control *api;
+
+ api = created->API_Extensions[ THREAD_API_POSIX ];
+
+ api->Sporadic.thread = created;
+ _Watchdog_Preinitialize( &api->Sporadic.Timer, _Per_CPU_Get_by_index( 0 ) );
+ _Watchdog_Initialize( &api->Sporadic.Timer, _POSIX_Threads_Sporadic_timer );
+ _Priority_Node_set_inactive( &api->Sporadic.Low_priority );
+
+ return true;
+}
+
+static void _POSIX_Threads_Terminate_extension( Thread_Control *executing )
+{
+ POSIX_API_Control *api;
+ ISR_lock_Context lock_context;
+
+ api = executing->API_Extensions[ THREAD_API_POSIX ];
+
+ _Thread_State_acquire( executing, &lock_context );
+ _Watchdog_Per_CPU_remove_ticks( &api->Sporadic.Timer );
+ _Thread_State_release( executing, &lock_context );
+}
+#endif
+
+static void _POSIX_Threads_Exitted_extension(
+ Thread_Control *executing
+)
+{
+ /*
+ * If the executing thread was not created with the POSIX API, then this
+ * API do not get to define its exit behavior.
+ */
+ if ( _Objects_Get_API( executing->Object.id ) == OBJECTS_POSIX_API )
+ pthread_exit( executing->Wait.return_argument );
+}
+
+static User_extensions_Control _POSIX_Threads_User_extensions = {
+ .Callouts = {
+#if defined(RTEMS_POSIX_API)
+ .thread_create = _POSIX_Threads_Create_extension,
+ .thread_terminate = _POSIX_Threads_Terminate_extension,
+#endif
+ .thread_exitted = _POSIX_Threads_Exitted_extension
+ }
+};
+
+static void _POSIX_Threads_Manager_initialization( void )
+{
+ _Thread_Initialize_information( &_POSIX_Threads_Information );
+ _User_extensions_Add_API_set( &_POSIX_Threads_User_extensions );
+}
+
+RTEMS_SYSINIT_ITEM(
+ _POSIX_Threads_Manager_initialization,
+ RTEMS_SYSINIT_POSIX_THREADS,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/posix/src/ptimer.c b/cpukit/posix/src/ptimer.c
index f3af1710b8..311bc0b909 100644
--- a/cpukit/posix/src/ptimer.c
+++ b/cpukit/posix/src/ptimer.c
@@ -1,77 +1,47 @@
/**
* @file
*
- * @brief Process Timer
- * @ingroup POSIXAPI
+ * @ingroup POSIX_INTERNAL_TIMERS
+ *
+ * @brief POSIX Timer Information with Zero Objects
*/
/*
- * COPYRIGHT (c) 1989-2008.
- * On-Line Applications Research Corporation (OAR).
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018 embedded brains GmbH
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
-#include <time.h>
-#include <errno.h>
-#include <limits.h> /* _POSIX_PATH_MAX */
-
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-
-
-/************************************/
-/* These includes are now necessary */
-/************************************/
-
-#include <unistd.h>
-#include <rtems/sysinit.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/timer.h>
-#include <rtems/rtems/clock.h>
-#include <rtems/score/wkspace.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <signal.h>
-
-#include <rtems/posix/timerimpl.h>
-
-Objects_Information _POSIX_Timer_Information;
-
-/*
- * _POSIX_Timer_Manager_initialization
- *
- * Description:
- *
- * Initialize the internal structure in which the data of all
- * the timers are stored
- */
-
-static void _POSIX_Timer_Manager_initialization(void)
-{
- _Objects_Initialize_information(
- &_POSIX_Timer_Information, /* object information table */
- OBJECTS_POSIX_API, /* object API */
- OBJECTS_POSIX_TIMERS, /* object class */
- _Configuration_POSIX_Maximum_timers,
- sizeof( POSIX_Timer_Control ),
- /* size of this object's control block */
- OBJECTS_NO_STRING_NAME, /* maximum length of an object name */
- NULL /* Proxy extraction support callout */
- );
-}
+#include <rtems/posix/timer.h>
-RTEMS_SYSINIT_ITEM(
- _POSIX_Timer_Manager_initialization,
- RTEMS_SYSINIT_POSIX_TIMER,
- RTEMS_SYSINIT_ORDER_MIDDLE
+OBJECTS_INFORMATION_DEFINE_ZERO(
+ _POSIX_Timer,
+ OBJECTS_POSIX_API,
+ OBJECTS_POSIX_TIMERS,
+ OBJECTS_NO_STRING_NAME
);
diff --git a/cpukit/posix/src/semopen.c b/cpukit/posix/src/semopen.c
index 63915fca57..86bd6a615e 100644
--- a/cpukit/posix/src/semopen.c
+++ b/cpukit/posix/src/semopen.c
@@ -20,6 +20,7 @@
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/score/wkspace.h>
+#include <rtems/sysinit.h>
#include <stdarg.h>
#include <fcntl.h>
@@ -172,3 +173,14 @@ sem_t *sem_open(
_Objects_Allocator_unlock();
return sem;
}
+
+static void _POSIX_Semaphore_Manager_initialization( void )
+{
+ _Objects_Initialize_information( &_POSIX_Semaphore_Information );
+}
+
+RTEMS_SYSINIT_ITEM(
+ _POSIX_Semaphore_Manager_initialization,
+ RTEMS_SYSINIT_POSIX_SEMAPHORE,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/posix/src/shm.c b/cpukit/posix/src/shm.c
index 5030a9376e..8ab14f4e0f 100644
--- a/cpukit/posix/src/shm.c
+++ b/cpukit/posix/src/shm.c
@@ -1,47 +1,49 @@
/**
* @file
+ *
+ * @ingroup POSIXShmPrivate
+ *
+ * @brief POSIX Shared Memory Information with Zero Objects
*/
/*
- * Copyright (c) 2016 Gedare Bloom.
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018 embedded brains GmbH
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <limits.h>
-
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/libio.h>
-#include <rtems/sysinit.h>
-#include <rtems/posix/shmimpl.h>
+#include <rtems/posix/shm.h>
-Objects_Information _POSIX_Shm_Information;
-
-static void _POSIX_Shm_Manager_initialization( void )
-{
- _Objects_Initialize_information(
- &_POSIX_Shm_Information, /* object information table */
- OBJECTS_POSIX_API, /* object API */
- OBJECTS_POSIX_SHMS, /* object class */
- _Configuration_POSIX_Maximum_shms,
- sizeof( POSIX_Shm_Control ),
- /* size of this object's control block */
- _POSIX_PATH_MAX, /* maximum length of each object's name */
- NULL /* Proxy extraction support callout */
- );
-}
+#include <limits.h>
-RTEMS_SYSINIT_ITEM(
- _POSIX_Shm_Manager_initialization,
- RTEMS_SYSINIT_POSIX_SHM,
- RTEMS_SYSINIT_ORDER_MIDDLE
+OBJECTS_INFORMATION_DEFINE_ZERO(
+ _POSIX_Shm,
+ OBJECTS_POSIX_API,
+ OBJECTS_POSIX_SHMS,
+ _POSIX_PATH_MAX
);
diff --git a/cpukit/posix/src/shmopen.c b/cpukit/posix/src/shmopen.c
index 8913e19c15..ca8da00140 100644
--- a/cpukit/posix/src/shmopen.c
+++ b/cpukit/posix/src/shmopen.c
@@ -25,6 +25,7 @@
#include <rtems/posix/shmimpl.h>
#include <rtems/score/wkspace.h>
+#include <rtems/sysinit.h>
static const rtems_filesystem_file_handlers_r shm_handlers;
@@ -314,3 +315,14 @@ static const rtems_filesystem_file_handlers_r shm_handlers = {
.readv_h = rtems_filesystem_default_readv,
.writev_h = rtems_filesystem_default_writev
};
+
+static void _POSIX_Shm_Manager_initialization( void )
+{
+ _Objects_Initialize_information( &_POSIX_Shm_Information );
+}
+
+RTEMS_SYSINIT_ITEM(
+ _POSIX_Shm_Manager_initialization,
+ RTEMS_SYSINIT_POSIX_SHM,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/rtems/src/barrier.c b/cpukit/rtems/src/barrier.c
index 59b0a5d142..c0d167b0db 100644
--- a/cpukit/rtems/src/barrier.c
+++ b/cpukit/rtems/src/barrier.c
@@ -1,51 +1,47 @@
/**
* @file
*
- * @brief RTEMS Barrier Manager Initialization
- * @ingroup ClassicBarrier Barriers
+ * @ingroup ClassicBarrier
+ *
+ * @brief Classic Barrier Information with Zero Objects
*/
/*
- * COPYRIGHT (c) 1989-2015.
- * On-Line Applications Research Corporation (OAR).
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018 embedded brains GmbH
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/sysinit.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/barrierimpl.h>
-
-Objects_Information _Barrier_Information;
-
-/**
- * @brief _Barrier_Manager_initialization
- */
-static void _Barrier_Manager_initialization(void)
-{
- _Objects_Initialize_information(
- &_Barrier_Information, /* object information table */
- OBJECTS_CLASSIC_API, /* object API */
- OBJECTS_RTEMS_BARRIERS, /* object class */
- Configuration_RTEMS_API.maximum_barriers,
- /* maximum objects of this class */
- sizeof( Barrier_Control ), /* size of this object's control block */
- OBJECTS_NO_STRING_NAME, /* maximum length of an object name */
- NULL /* Proxy extraction support callout */
- );
-}
+#include <rtems/rtems/barrierdata.h>
-RTEMS_SYSINIT_ITEM(
- _Barrier_Manager_initialization,
- RTEMS_SYSINIT_CLASSIC_BARRIER,
- RTEMS_SYSINIT_ORDER_MIDDLE
+OBJECTS_INFORMATION_DEFINE_ZERO(
+ _Barrier,
+ OBJECTS_CLASSIC_API,
+ OBJECTS_RTEMS_BARRIERS,
+ OBJECTS_NO_STRING_NAME
);
diff --git a/cpukit/rtems/src/barriercreate.c b/cpukit/rtems/src/barriercreate.c
index 12a917fe60..5e0f883106 100644
--- a/cpukit/rtems/src/barriercreate.c
+++ b/cpukit/rtems/src/barriercreate.c
@@ -18,30 +18,12 @@
#include "config.h"
#endif
-#include <rtems/system.h>
+#include <rtems/rtems/barrierimpl.h>
#include <rtems/rtems/status.h>
#include <rtems/rtems/support.h>
#include <rtems/rtems/attrimpl.h>
#include <rtems/score/isr.h>
-#include <rtems/rtems/barrierimpl.h>
-
-/*
- * rtems_barrier_create
- *
- * This directive creates a barrier. A barrier id is returned.
- *
- * Input parameters:
- * name - user defined barrier name
- * attribute_set - barrier attributes
- * maximum_waiters - number of threads before automatic release
- * priority_ceiling - barrier's ceiling priority
- * id - pointer to barrier id
- *
- * Output parameters:
- * id - barrier id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
+#include <rtems/sysinit.h>
rtems_status_code rtems_barrier_create(
rtems_name name,
@@ -90,3 +72,14 @@ rtems_status_code rtems_barrier_create(
_Objects_Allocator_unlock();
return RTEMS_SUCCESSFUL;
}
+
+static void _Barrier_Manager_initialization( void )
+{
+ _Objects_Initialize_information( &_Barrier_Information );
+}
+
+RTEMS_SYSINIT_ITEM(
+ _Barrier_Manager_initialization,
+ RTEMS_SYSINIT_CLASSIC_BARRIER,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/rtems/src/dpmem.c b/cpukit/rtems/src/dpmem.c
index ccecdfd6cc..79f0fb2e69 100644
--- a/cpukit/rtems/src/dpmem.c
+++ b/cpukit/rtems/src/dpmem.c
@@ -1,49 +1,47 @@
/**
- * @file
+ * @file
*
- * @brief Dual Ported Memory Manager Initialization
- * @ingroup ClassicDPMEM
+ * @ingroup ClassicDPMEM
+ *
+ * @brief Classic Dual Ported Memory Information with Zero Objects
*/
/*
- * COPYRIGHT (c) 1989-2008.
- * On-Line Applications Research Corporation (OAR).
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018 embedded brains GmbH
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/sysinit.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/dpmemimpl.h>
-
-Objects_Information _Dual_ported_memory_Information;
-
-static void _Dual_ported_memory_Manager_initialization(void)
-{
- _Objects_Initialize_information(
- &_Dual_ported_memory_Information, /* object information table */
- OBJECTS_CLASSIC_API, /* object API */
- OBJECTS_RTEMS_PORTS, /* object class */
- Configuration_RTEMS_API.maximum_ports,
- /* maximum objects of this class */
- sizeof( Dual_ported_memory_Control ),
- /* size of this object's control block */
- OBJECTS_NO_STRING_NAME, /* maximum length of an object name */
- NULL /* Proxy extraction support callout */
- );
-}
+#include <rtems/rtems/dpmemdata.h>
-RTEMS_SYSINIT_ITEM(
- _Dual_ported_memory_Manager_initialization,
- RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY,
- RTEMS_SYSINIT_ORDER_MIDDLE
+OBJECTS_INFORMATION_DEFINE_ZERO(
+ _Dual_ported_memory,
+ OBJECTS_CLASSIC_API,
+ OBJECTS_RTEMS_PORTS,
+ OBJECTS_NO_STRING_NAME
);
diff --git a/cpukit/rtems/src/dpmemcreate.c b/cpukit/rtems/src/dpmemcreate.c
index 206a199c00..1dc096d084 100644
--- a/cpukit/rtems/src/dpmemcreate.c
+++ b/cpukit/rtems/src/dpmemcreate.c
@@ -18,12 +18,12 @@
#include "config.h"
#endif
-#include <rtems/system.h>
+#include <rtems/rtems/dpmemimpl.h>
#include <rtems/rtems/status.h>
#include <rtems/rtems/support.h>
#include <rtems/score/address.h>
-#include <rtems/rtems/dpmemimpl.h>
#include <rtems/score/thread.h>
+#include <rtems/sysinit.h>
rtems_status_code rtems_port_create(
rtems_name name,
@@ -66,3 +66,14 @@ rtems_status_code rtems_port_create(
_Objects_Allocator_unlock();
return RTEMS_SUCCESSFUL;
}
+
+static void _Dual_ported_memory_Manager_initialization( void )
+{
+ _Objects_Initialize_information( &_Dual_ported_memory_Information );
+}
+
+RTEMS_SYSINIT_ITEM(
+ _Dual_ported_memory_Manager_initialization,
+ RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/rtems/src/msg.c b/cpukit/rtems/src/msg.c
index 8060735beb..1156db4485 100644
--- a/cpukit/rtems/src/msg.c
+++ b/cpukit/rtems/src/msg.c
@@ -1,64 +1,47 @@
/**
- * @file
+ * @file
*
- * @brief Message Queue Manager Initialization
- * @ingroup ClassicMessageQueue
+ * @ingroup ClassicMessageQueue
+ *
+ * @brief Classic Message Queue Information with Zero Objects
*/
/*
- * COPYRIGHT (c) 1989-2008.
- * On-Line Applications Research Corporation (OAR).
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018 embedded brains GmbH
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/sysinit.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/attrimpl.h>
-#include <rtems/rtems/messageimpl.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/support.h>
-
-Objects_Information _Message_queue_Information;
-
-static void _Message_queue_Manager_initialization(void)
-{
- _Objects_Initialize_information(
- &_Message_queue_Information, /* object information table */
- OBJECTS_CLASSIC_API, /* object API */
- OBJECTS_RTEMS_MESSAGE_QUEUES, /* object class */
- Configuration_RTEMS_API.maximum_message_queues,
- /* maximum objects of this class */
- sizeof( Message_queue_Control ),
- /* size of this object's control block */
- OBJECTS_NO_STRING_NAME, /* maximum length of an object name */
- _Message_queue_MP_Send_extract_proxy
- /* Proxy extraction support callout */
- );
-
- /*
- * Register the MP Process Packet routine.
- */
-
-#if defined(RTEMS_MULTIPROCESSING)
- _MPCI_Register_packet_processor(
- MP_PACKET_MESSAGE_QUEUE,
- _Message_queue_MP_Process_packet
- );
-#endif
-
-}
+#include <rtems/rtems/messagedata.h>
-RTEMS_SYSINIT_ITEM(
- _Message_queue_Manager_initialization,
- RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE,
- RTEMS_SYSINIT_ORDER_MIDDLE
+OBJECTS_INFORMATION_DEFINE_ZERO(
+ _Message_queue,
+ OBJECTS_CLASSIC_API,
+ OBJECTS_RTEMS_MESSAGE_QUEUES,
+ OBJECTS_NO_STRING_NAME
);
diff --git a/cpukit/rtems/src/msgqcreate.c b/cpukit/rtems/src/msgqcreate.c
index 8a16819f80..2925d244a7 100644
--- a/cpukit/rtems/src/msgqcreate.c
+++ b/cpukit/rtems/src/msgqcreate.c
@@ -18,18 +18,18 @@
#include "config.h"
#endif
-#include <rtems/system.h>
+#include <rtems/rtems/messageimpl.h>
+#include <rtems/rtems/status.h>
+#include <rtems/rtems/attrimpl.h>
+#include <rtems/rtems/options.h>
+#include <rtems/rtems/support.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/chain.h>
#include <rtems/score/isr.h>
#include <rtems/score/coremsgimpl.h>
#include <rtems/score/thread.h>
#include <rtems/score/wkspace.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/attrimpl.h>
-#include <rtems/rtems/messageimpl.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/support.h>
+#include <rtems/sysinit.h>
rtems_status_code rtems_message_queue_create(
rtems_name name,
@@ -143,3 +143,26 @@ rtems_status_code rtems_message_queue_create(
_Objects_Allocator_unlock();
return RTEMS_SUCCESSFUL;
}
+
+static void _Message_queue_Manager_initialization(void)
+{
+ _Objects_Initialize_information( &_Message_queue_Information);
+
+ /*
+ * Register the MP Process Packet routine.
+ */
+
+#if defined(RTEMS_MULTIPROCESSING)
+ _MPCI_Register_packet_processor(
+ MP_PACKET_MESSAGE_QUEUE,
+ _Message_queue_MP_Process_packet
+ );
+#endif
+
+}
+
+RTEMS_SYSINIT_ITEM(
+ _Message_queue_Manager_initialization,
+ RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/rtems/src/part.c b/cpukit/rtems/src/part.c
index d395f34342..cb47921556 100644
--- a/cpukit/rtems/src/part.c
+++ b/cpukit/rtems/src/part.c
@@ -1,60 +1,47 @@
/**
- * @file
+ * @file
*
- * @brief Partition Manager Initialization
- * @ingroup ClassicPart
+ * @ingroup ClassicPart
+ *
+ * @brief Classic Partition Information with Zero Objects
*/
/*
- * COPYRIGHT (c) 1989-2008.
- * On-Line Applications Research Corporation (OAR).
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018 embedded brains GmbH
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/sysinit.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/partimpl.h>
-
-Objects_Information _Partition_Information;
-
-static void _Partition_Manager_initialization(void)
-{
- _Objects_Initialize_information(
- &_Partition_Information, /* object information table */
- OBJECTS_CLASSIC_API, /* object API */
- OBJECTS_RTEMS_PARTITIONS, /* object class */
- Configuration_RTEMS_API.maximum_partitions,
- /* maximum objects of this class */
- sizeof( Partition_Control ), /* size of this object's control block */
- OBJECTS_NO_STRING_NAME, /* maximum length of an object name */
- _Partition_MP_Send_extract_proxy /* Proxy extraction support callout */
- );
-
- /*
- * Register the MP Process Packet routine.
- */
-
-#if defined(RTEMS_MULTIPROCESSING)
- _MPCI_Register_packet_processor(
- MP_PACKET_PARTITION,
- _Partition_MP_Process_packet
- );
-#endif
-
-}
+#include <rtems/rtems/partdata.h>
-RTEMS_SYSINIT_ITEM(
- _Partition_Manager_initialization,
- RTEMS_SYSINIT_CLASSIC_PARTITION,
- RTEMS_SYSINIT_ORDER_MIDDLE
+OBJECTS_INFORMATION_DEFINE_ZERO(
+ _Partition,
+ OBJECTS_CLASSIC_API,
+ OBJECTS_RTEMS_PARTITIONS,
+ OBJECTS_NO_STRING_NAME
);
diff --git a/cpukit/rtems/src/partcreate.c b/cpukit/rtems/src/partcreate.c
index 1a7304efa3..99d0d59b37 100644
--- a/cpukit/rtems/src/partcreate.c
+++ b/cpukit/rtems/src/partcreate.c
@@ -23,26 +23,8 @@
#include <rtems/rtems/support.h>
#include <rtems/score/threaddispatch.h>
#include <rtems/score/sysstate.h>
+#include <rtems/sysinit.h>
-/*
- * rtems_partition_create
- *
- * This directive creates a partiton of fixed sized buffers from the
- * given contiguous memory area.
- *
- * Input parameters:
- * name - user defined partition name
- * starting_address - physical start address of partition
- * length - physical length in bytes
- * buffer_size - size of buffers in bytes
- * attribute_set - partition attributes
- * id - pointer to partition id
- *
- * Output parameters:
- * id - partition id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
rtems_status_code rtems_partition_create(
rtems_name name,
@@ -133,3 +115,26 @@ rtems_status_code rtems_partition_create(
_Objects_Allocator_unlock();
return RTEMS_SUCCESSFUL;
}
+
+static void _Partition_Manager_initialization(void)
+{
+ _Objects_Initialize_information( &_Partition_Information );
+
+ /*
+ * Register the MP Process Packet routine.
+ */
+
+#if defined(RTEMS_MULTIPROCESSING)
+ _MPCI_Register_packet_processor(
+ MP_PACKET_PARTITION,
+ _Partition_MP_Process_packet
+ );
+#endif
+
+}
+
+RTEMS_SYSINIT_ITEM(
+ _Partition_Manager_initialization,
+ RTEMS_SYSINIT_CLASSIC_PARTITION,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/rtems/src/ratemon.c b/cpukit/rtems/src/ratemon.c
index a8681dda44..dc54169a96 100644
--- a/cpukit/rtems/src/ratemon.c
+++ b/cpukit/rtems/src/ratemon.c
@@ -1,48 +1,47 @@
/**
- * @file
+ * @file
*
- * @brief Rate Monotonic Manager Initialization
- * @ingroup ClassicRateMon
+ * @ingroup ClassicRateMon
+ *
+ * @brief Classic Rate Monotonic Information with Zero Objects
*/
/*
- * COPYRIGHT (c) 1989-2008.
- * On-Line Applications Research Corporation (OAR).
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018 embedded brains GmbH
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/sysinit.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/ratemonimpl.h>
-
-Objects_Information _Rate_monotonic_Information;
-
-static void _Rate_monotonic_Manager_initialization(void)
-{
- _Objects_Initialize_information(
- &_Rate_monotonic_Information, /* object information table */
- OBJECTS_CLASSIC_API, /* object API */
- OBJECTS_RTEMS_PERIODS, /* object class */
- Configuration_RTEMS_API.maximum_periods,
- /* maximum objects of this class */
- sizeof( Rate_monotonic_Control ),/* size of this object's control block */
- OBJECTS_NO_STRING_NAME, /* maximum length of an object name */
- NULL /* Proxy extraction support callout */
- );
-}
+#include <rtems/rtems/ratemondata.h>
-RTEMS_SYSINIT_ITEM(
- _Rate_monotonic_Manager_initialization,
- RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC,
- RTEMS_SYSINIT_ORDER_MIDDLE
+OBJECTS_INFORMATION_DEFINE_ZERO(
+ _Rate_monotonic,
+ OBJECTS_CLASSIC_API,
+ OBJECTS_RTEMS_PERIODS,
+ OBJECTS_NO_STRING_NAME
);
diff --git a/cpukit/rtems/src/ratemoncreate.c b/cpukit/rtems/src/ratemoncreate.c
index 12327295ac..8dd43bb9fc 100644
--- a/cpukit/rtems/src/ratemoncreate.c
+++ b/cpukit/rtems/src/ratemoncreate.c
@@ -18,29 +18,13 @@
#include "config.h"
#endif
-#include <rtems/system.h>
+#include <rtems/rtems/ratemonimpl.h>
#include <rtems/rtems/status.h>
#include <rtems/rtems/support.h>
#include <rtems/score/isr.h>
-#include <rtems/rtems/ratemonimpl.h>
#include <rtems/score/thread.h>
#include <rtems/score/watchdogimpl.h>
-
-/*
- * rtems_rate_monotonic_create
- *
- * This directive creates a rate monotonic timer and performs
- * some initialization.
- *
- * Input parameters:
- * name - name of period
- * id - pointer to rate monotonic id
- *
- * Output parameters:
- * id - rate monotonic id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
+#include <rtems/sysinit.h>
rtems_status_code rtems_rate_monotonic_create(
rtems_name name,
@@ -84,3 +68,14 @@ rtems_status_code rtems_rate_monotonic_create(
_Objects_Allocator_unlock();
return RTEMS_SUCCESSFUL;
}
+
+static void _Rate_monotonic_Manager_initialization( void )
+{
+ _Objects_Initialize_information( &_Rate_monotonic_Information );
+}
+
+RTEMS_SYSINIT_ITEM(
+ _Rate_monotonic_Manager_initialization,
+ RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/rtems/src/region.c b/cpukit/rtems/src/region.c
index 4fbce63160..f7ed857832 100644
--- a/cpukit/rtems/src/region.c
+++ b/cpukit/rtems/src/region.c
@@ -1,59 +1,47 @@
/**
* @file
*
- * @brief _Region_Manager_initialization
- * @ingroup ClassicRegion Regions
+ * @ingroup ClassicRegion
+ *
+ * @brief Classic Region Information with Zero Objects
*/
/*
- * COPYRIGHT (c) 1989-2013.
- * On-Line Applications Research Corporation (OAR).
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018 embedded brains GmbH
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/sysinit.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/regionimpl.h>
-
-Objects_Information _Region_Information;
-
-/*
- * _Region_Manager_initialization
- *
- * This routine initializes all region manager related data structures.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-static void _Region_Manager_initialization(void)
-{
- _Objects_Initialize_information(
- &_Region_Information, /* object information table */
- OBJECTS_CLASSIC_API, /* object API */
- OBJECTS_RTEMS_REGIONS, /* object class */
- Configuration_RTEMS_API.maximum_regions,
- /* maximum objects of this class */
- sizeof( Region_Control ), /* size of this object's control block */
- OBJECTS_NO_STRING_NAME, /* maximum length of an object name */
- NULL /* Proxy extraction support callout */
- );
-}
+#include <rtems/rtems/regiondata.h>
-RTEMS_SYSINIT_ITEM(
- _Region_Manager_initialization,
- RTEMS_SYSINIT_CLASSIC_REGION,
- RTEMS_SYSINIT_ORDER_MIDDLE
+OBJECTS_INFORMATION_DEFINE_ZERO(
+ _Region,
+ OBJECTS_CLASSIC_API,
+ OBJECTS_RTEMS_REGIONS,
+ OBJECTS_NO_STRING_NAME
);
diff --git a/cpukit/rtems/src/regioncreate.c b/cpukit/rtems/src/regioncreate.c
index 05df1dec5a..3d6215cdb1 100644
--- a/cpukit/rtems/src/regioncreate.c
+++ b/cpukit/rtems/src/regioncreate.c
@@ -23,26 +23,7 @@
#include <rtems/rtems/support.h>
#include <rtems/score/apimutex.h>
#include <rtems/score/threadqimpl.h>
-
-/*
- * rtems_region_create
- *
- * This directive creates a region of physical contiguous memory area
- * from which variable sized segments can be allocated.
- *
- * Input parameters:
- * name - user defined region name
- * starting_address - physical start address of region
- * length - physical length in bytes
- * page_size - page size in bytes
- * attribute_set - region attributes
- * id - address of region id to set
- *
- * Output parameters:
- * id - region id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
+#include <rtems/sysinit.h>
rtems_status_code rtems_region_create(
rtems_name name,
@@ -104,3 +85,14 @@ rtems_status_code rtems_region_create(
return return_status;
}
+
+static void _Region_Manager_initialization( void )
+{
+ _Objects_Initialize_information( &_Region_Information );
+}
+
+RTEMS_SYSINIT_ITEM(
+ _Region_Manager_initialization,
+ RTEMS_SYSINIT_CLASSIC_REGION,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/rtems/src/rtemstimer.c b/cpukit/rtems/src/rtemstimer.c
index f0a8c672fa..be6592216f 100644
--- a/cpukit/rtems/src/rtemstimer.c
+++ b/cpukit/rtems/src/rtemstimer.c
@@ -1,50 +1,47 @@
/**
- * @file
+ * @file
*
- * @brief Timer Manager Initialization
- * @ingroup ClassicTimer
+ * @ingroup ClassicTimer
+ *
+ * @brief Classic Timer Information with Zero Objects
*/
/*
- * COPYRIGHT (c) 1989-2008.
- * On-Line Applications Research Corporation (OAR).
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018 embedded brains GmbH
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/sysinit.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/timerimpl.h>
-
-Timer_server_Control *volatile _Timer_server;
-
-Objects_Information _Timer_Information;
-
-static void _Timer_Manager_initialization(void)
-{
- _Objects_Initialize_information(
- &_Timer_Information, /* object information table */
- OBJECTS_CLASSIC_API, /* object API */
- OBJECTS_RTEMS_TIMERS, /* object class */
- Configuration_RTEMS_API.maximum_timers ,
- /* maximum objects of this class */
- sizeof( Timer_Control ), /* size of this object's control block */
- OBJECTS_NO_STRING_NAME, /* maximum length of an object name */
- NULL /* Proxy extraction support callout */
- );
-}
+#include <rtems/rtems/timerdata.h>
-RTEMS_SYSINIT_ITEM(
- _Timer_Manager_initialization,
- RTEMS_SYSINIT_CLASSIC_TIMER,
- RTEMS_SYSINIT_ORDER_MIDDLE
+OBJECTS_INFORMATION_DEFINE_ZERO(
+ _Timer,
+ OBJECTS_CLASSIC_API,
+ OBJECTS_RTEMS_TIMERS,
+ OBJECTS_NO_STRING_NAME
);
diff --git a/cpukit/rtems/src/sem.c b/cpukit/rtems/src/sem.c
index e91e2d14bf..51733b4997 100644
--- a/cpukit/rtems/src/sem.c
+++ b/cpukit/rtems/src/sem.c
@@ -1,57 +1,47 @@
/**
- * @file
+ * @file
*
- * @brief Semaphore Manager Initialization
- * @ingroup ClassicSem
+ * @ingroup ClassicSem
+ *
+ * @brief Classic Semaphore Information with Zero Objects
*/
/*
- * COPYRIGHT (c) 1989-2008.
- * On-Line Applications Research Corporation (OAR).
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018 embedded brains GmbH
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/config.h>
-#include <rtems/sysinit.h>
-#include <rtems/rtems/semimpl.h>
-
-Objects_Information _Semaphore_Information;
-
-static void _Semaphore_Manager_initialization(void)
-{
- _Objects_Initialize_information(
- &_Semaphore_Information, /* object information table */
- OBJECTS_CLASSIC_API, /* object API */
- OBJECTS_RTEMS_SEMAPHORES, /* object class */
- Configuration_RTEMS_API.maximum_semaphores,
- /* maximum objects of this class */
- sizeof( Semaphore_Control ), /* size of this object's control block */
- OBJECTS_NO_STRING_NAME, /* maximum length of an object name */
- _Semaphore_MP_Send_extract_proxy /* Proxy extraction support callout */
- );
-
- /*
- * Register the MP Process Packet routine.
- */
-
-#if defined(RTEMS_MULTIPROCESSING)
- _MPCI_Register_packet_processor(
- MP_PACKET_SEMAPHORE,
- _Semaphore_MP_Process_packet
- );
-#endif
-
-}
+#include <rtems/rtems/semdata.h>
-RTEMS_SYSINIT_ITEM(
- _Semaphore_Manager_initialization,
- RTEMS_SYSINIT_CLASSIC_SEMAPHORE,
- RTEMS_SYSINIT_ORDER_MIDDLE
+OBJECTS_INFORMATION_DEFINE_ZERO(
+ _Semaphore,
+ OBJECTS_CLASSIC_API,
+ OBJECTS_RTEMS_SEMAPHORES,
+ OBJECTS_NO_STRING_NAME
);
diff --git a/cpukit/rtems/src/semcreate.c b/cpukit/rtems/src/semcreate.c
index fd266f8cd5..dc4e02cd97 100644
--- a/cpukit/rtems/src/semcreate.c
+++ b/cpukit/rtems/src/semcreate.c
@@ -25,6 +25,7 @@
#include <rtems/rtems/tasksimpl.h>
#include <rtems/score/schedulerimpl.h>
#include <rtems/score/sysstate.h>
+#include <rtems/sysinit.h>
#define SEMAPHORE_KIND_MASK ( RTEMS_SEMAPHORE_CLASS | RTEMS_INHERIT_PRIORITY \
| RTEMS_PRIORITY_CEILING | RTEMS_MULTIPROCESSOR_RESOURCE_SHARING )
@@ -254,3 +255,21 @@ rtems_status_code rtems_semaphore_create(
_Objects_Allocator_unlock();
return RTEMS_SUCCESSFUL;
}
+
+static void _Semaphore_Manager_initialization(void)
+{
+ _Objects_Initialize_information( &_Semaphore_Information );
+
+#if defined(RTEMS_MULTIPROCESSING)
+ _MPCI_Register_packet_processor(
+ MP_PACKET_SEMAPHORE,
+ _Semaphore_MP_Process_packet
+ );
+#endif
+}
+
+RTEMS_SYSINIT_ITEM(
+ _Semaphore_Manager_initialization,
+ RTEMS_SYSINIT_CLASSIC_SEMAPHORE,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/rtems/src/taskcreate.c b/cpukit/rtems/src/taskcreate.c
index 26953828e9..4055e1eb50 100644
--- a/cpukit/rtems/src/taskcreate.c
+++ b/cpukit/rtems/src/taskcreate.c
@@ -20,12 +20,15 @@
#include <rtems/rtems/tasksimpl.h>
#include <rtems/rtems/attrimpl.h>
+#include <rtems/rtems/eventimpl.h>
#include <rtems/rtems/modesimpl.h>
#include <rtems/rtems/support.h>
#include <rtems/score/apimutex.h>
#include <rtems/score/schedulerimpl.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/threadimpl.h>
+#include <rtems/score/userextimpl.h>
+#include <rtems/sysinit.h>
rtems_status_code rtems_task_create(
rtems_name name,
@@ -198,3 +201,62 @@ rtems_status_code rtems_task_create(
_Objects_Allocator_unlock();
return RTEMS_SUCCESSFUL;
}
+
+static void _RTEMS_tasks_Start_extension(
+ Thread_Control *executing,
+ Thread_Control *started
+)
+{
+ RTEMS_API_Control *api;
+
+ api = started->API_Extensions[ THREAD_API_RTEMS ];
+
+ _Event_Initialize( &api->Event );
+ _Event_Initialize( &api->System_event );
+}
+
+#if defined(RTEMS_MULTIPROCESSING)
+static void _RTEMS_tasks_Terminate_extension( Thread_Control *executing )
+{
+ if ( executing->is_global ) {
+ _Objects_MP_Close(
+ &_RTEMS_tasks_Information.Objects,
+ executing->Object.id
+ );
+ _RTEMS_tasks_MP_Send_process_packet(
+ RTEMS_TASKS_MP_ANNOUNCE_DELETE,
+ executing->Object.id,
+ 0 /* Not used */
+ );
+ }
+}
+#endif
+
+static User_extensions_Control _RTEMS_tasks_User_extensions = {
+ .Callouts = {
+#if defined(RTEMS_MULTIPROCESSING)
+ .thread_terminate = _RTEMS_tasks_Terminate_extension,
+#endif
+ .thread_start = _RTEMS_tasks_Start_extension,
+ .thread_restart = _RTEMS_tasks_Start_extension
+ }
+};
+
+static void _RTEMS_tasks_Manager_initialization(void)
+{
+ _Thread_Initialize_information( &_RTEMS_tasks_Information );
+ _User_extensions_Add_API_set( &_RTEMS_tasks_User_extensions );
+
+#if defined(RTEMS_MULTIPROCESSING)
+ _MPCI_Register_packet_processor(
+ MP_PACKET_TASKS,
+ _RTEMS_tasks_MP_Process_packet
+ );
+#endif
+}
+
+RTEMS_SYSINIT_ITEM(
+ _RTEMS_tasks_Manager_initialization,
+ RTEMS_SYSINIT_CLASSIC_TASKS,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/rtems/src/tasks.c b/cpukit/rtems/src/tasks.c
index 55dd1dc334..f0297b175b 100644
--- a/cpukit/rtems/src/tasks.c
+++ b/cpukit/rtems/src/tasks.c
@@ -18,86 +18,10 @@
#include "config.h"
#endif
-#include <rtems/config.h>
-#include <rtems/sysinit.h>
-#include <rtems/rtems/eventimpl.h>
-#include <rtems/rtems/tasksimpl.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/userextimpl.h>
+#include <rtems/rtems/tasksdata.h>
-Thread_Information _RTEMS_tasks_Information;
-
-static void _RTEMS_tasks_Start_extension(
- Thread_Control *executing,
- Thread_Control *started
-)
-{
- RTEMS_API_Control *api;
-
- api = started->API_Extensions[ THREAD_API_RTEMS ];
-
- _Event_Initialize( &api->Event );
- _Event_Initialize( &api->System_event );
-}
-
-#if defined(RTEMS_MULTIPROCESSING)
-static void _RTEMS_tasks_Terminate_extension( Thread_Control *executing )
-{
- if ( executing->is_global ) {
- _Objects_MP_Close(
- &_RTEMS_tasks_Information.Objects,
- executing->Object.id
- );
- _RTEMS_tasks_MP_Send_process_packet(
- RTEMS_TASKS_MP_ANNOUNCE_DELETE,
- executing->Object.id,
- 0 /* Not used */
- );
- }
-}
-#endif
-
-User_extensions_Control _RTEMS_tasks_User_extensions = {
- .Callouts = {
-#if defined(RTEMS_MULTIPROCESSING)
- .thread_terminate = _RTEMS_tasks_Terminate_extension,
-#endif
- .thread_start = _RTEMS_tasks_Start_extension,
- .thread_restart = _RTEMS_tasks_Start_extension
- }
-};
-
-static void _RTEMS_tasks_Manager_initialization(void)
-{
- _Thread_Initialize_information(
- &_RTEMS_tasks_Information, /* object information table */
- OBJECTS_CLASSIC_API, /* object API */
- OBJECTS_RTEMS_TASKS, /* object class */
- Configuration_RTEMS_API.maximum_tasks
- /* maximum objects of this class */
- );
-
- /*
- * Add all the extensions for this API
- */
-
- _User_extensions_Add_API_set( &_RTEMS_tasks_User_extensions );
-
- /*
- * Register the MP Process Packet routine.
- */
-
-#if defined(RTEMS_MULTIPROCESSING)
- _MPCI_Register_packet_processor(
- MP_PACKET_TASKS,
- _RTEMS_tasks_MP_Process_packet
- );
-#endif
-
-}
-
-RTEMS_SYSINIT_ITEM(
- _RTEMS_tasks_Manager_initialization,
- RTEMS_SYSINIT_CLASSIC_TASKS,
- RTEMS_SYSINIT_ORDER_MIDDLE
+THREAD_INFORMATION_DEFINE_ZERO(
+ _RTEMS_tasks,
+ OBJECTS_CLASSIC_API,
+ OBJECTS_RTEMS_TASKS
);
diff --git a/cpukit/rtems/src/timercreate.c b/cpukit/rtems/src/timercreate.c
index 0fff3d54cf..ad47ce505a 100644
--- a/cpukit/rtems/src/timercreate.c
+++ b/cpukit/rtems/src/timercreate.c
@@ -27,12 +27,15 @@
#include <rtems/score/thread.h>
#include <rtems/score/todimpl.h>
#include <rtems/score/watchdogimpl.h>
+#include <rtems/sysinit.h>
RTEMS_STATIC_ASSERT(
PER_CPU_WATCHDOG_REALTIME == TIMER_CLASS_BIT_TIME_OF_DAY,
TIMER_CLASS_BIT_TIME_OF_DAY
);
+Timer_server_Control *volatile _Timer_server;
+
void _Timer_Routine_adaptor( Watchdog_Control *the_watchdog )
{
Timer_Control *the_timer;
@@ -212,3 +215,14 @@ rtems_status_code rtems_timer_create(
_Objects_Allocator_unlock();
return RTEMS_SUCCESSFUL;
}
+
+static void _Timer_Manager_initialization( void )
+{
+ _Objects_Initialize_information( &_Timer_Information );
+}
+
+RTEMS_SYSINIT_ITEM(
+ _Timer_Manager_initialization,
+ RTEMS_SYSINIT_CLASSIC_TIMER,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/sapi/src/extension.c b/cpukit/sapi/src/extension.c
index 8e73030d29..028dccd4e0 100644
--- a/cpukit/sapi/src/extension.c
+++ b/cpukit/sapi/src/extension.c
@@ -1,47 +1,47 @@
/**
* @file
*
- * @brief Initialize Extension Manager
- *
* @ingroup ClassicUserExtensions
+ *
+ * @brief Extension Manager Information with Zero Objects
*/
/*
- * Extension Manager
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018 embedded brains GmbH
*
- * COPYRIGHT (c) 1989-2008.
- * On-Line Applications Research Corporation (OAR).
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/extensionimpl.h>
-#include <rtems/config.h>
-#include <rtems/sysinit.h>
-
-Objects_Information _Extension_Information;
-
-static void _Extension_Manager_initialization(void)
-{
- _Objects_Initialize_information(
- &_Extension_Information,
- OBJECTS_CLASSIC_API, /* object API */
- OBJECTS_RTEMS_EXTENSIONS,
- Configuration.maximum_extensions,
- sizeof( Extension_Control ),
- OBJECTS_NO_STRING_NAME, /* maximum length of an object name */
- NULL /* Proxy extraction support callout */
- );
-}
+#include <rtems/extensiondata.h>
-RTEMS_SYSINIT_ITEM(
- _Extension_Manager_initialization,
- RTEMS_SYSINIT_USER_EXTENSIONS,
- RTEMS_SYSINIT_ORDER_MIDDLE
+OBJECTS_INFORMATION_DEFINE_ZERO(
+ _Extension,
+ OBJECTS_CLASSIC_API,
+ OBJECTS_RTEMS_EXTENSIONS,
+ OBJECTS_NO_STRING_NAME
);
diff --git a/cpukit/sapi/src/extensioncreate.c b/cpukit/sapi/src/extensioncreate.c
index e3439b6a0e..d3ab0f6983 100644
--- a/cpukit/sapi/src/extensioncreate.c
+++ b/cpukit/sapi/src/extensioncreate.c
@@ -19,11 +19,10 @@
#include "config.h"
#endif
-#include <rtems/system.h>
+#include <rtems/extensionimpl.h>
#include <rtems/rtems/support.h>
-#include <rtems/score/thread.h>
#include <rtems/score/userextimpl.h>
-#include <rtems/extensionimpl.h>
+#include <rtems/sysinit.h>
rtems_status_code rtems_extension_create(
rtems_name name,
@@ -58,3 +57,14 @@ rtems_status_code rtems_extension_create(
_Objects_Allocator_unlock();
return RTEMS_SUCCESSFUL;
}
+
+static void _Extension_Manager_initialization( void )
+{
+ _Objects_Initialize_information( &_Extension_Information);
+}
+
+RTEMS_SYSINIT_ITEM(
+ _Extension_Manager_initialization,
+ RTEMS_SYSINIT_USER_EXTENSIONS,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/score/src/freechain.c b/cpukit/score/src/freechain.c
index 68786b1d7a..57ba293d4b 100644
--- a/cpukit/score/src/freechain.c
+++ b/cpukit/score/src/freechain.c
@@ -20,31 +20,6 @@
#include <rtems/score/freechain.h>
#include <rtems/score/assert.h>
-#include <rtems/score/chainimpl.h>
-
-void _Freechain_Initialize(
- Freechain_Control *freechain,
- Freechain_Allocator allocator,
- size_t number_nodes,
- size_t node_size
-)
-{
- void *starting_address;
-
- if ( number_nodes > 0 ) {
- starting_address = ( *allocator )( number_nodes * node_size );
- number_nodes *= ( starting_address != NULL );
- } else {
- starting_address = NULL;
- }
-
- _Chain_Initialize(
- &freechain->Free,
- starting_address,
- number_nodes,
- node_size
- );
-}
void *_Freechain_Get(
Freechain_Control *freechain,
diff --git a/cpukit/score/src/mpci.c b/cpukit/score/src/mpci.c
index 2d0244d887..9b09caa074 100644
--- a/cpukit/score/src/mpci.c
+++ b/cpukit/score/src/mpci.c
@@ -146,7 +146,7 @@ static void _MPCI_Create_server( void )
name.name_u32 = _Objects_Build_name( 'M', 'P', 'C', 'I' );
_Thread_Initialize(
- &_Thread_Internal_information,
+ &_Thread_Information,
_MPCI_Receive_server_tcb,
&_Scheduler_Table[ 0 ],
NULL, /* allocate the stack */
diff --git a/cpukit/score/src/objectallocate.c b/cpukit/score/src/objectallocate.c
index 9213cf8eb7..ad73884a07 100644
--- a/cpukit/score/src/objectallocate.c
+++ b/cpukit/score/src/objectallocate.c
@@ -68,13 +68,18 @@ Objects_Control *_Objects_Allocate_unprotected(
}
if ( the_object != NULL ) {
+ Objects_Maximum objects_per_block;
Objects_Maximum block;
+ objects_per_block = information->objects_per_block;
block = _Objects_Get_index( the_object->id ) - OBJECTS_INDEX_MINIMUM;
- block /= information->objects_per_block;
- information->inactive_per_block[ block ]--;
- information->inactive--;
+ if ( block > objects_per_block ) {
+ block /= objects_per_block;
+
+ information->inactive_per_block[ block ]--;
+ information->inactive--;
+ }
}
}
diff --git a/cpukit/score/src/objectextendinformation.c b/cpukit/score/src/objectextendinformation.c
index 22b9ec671b..b26f591f6e 100644
--- a/cpukit/score/src/objectextendinformation.c
+++ b/cpukit/score/src/objectextendinformation.c
@@ -61,7 +61,11 @@ void _Objects_Extend_information(
_Objects_Allocator_is_owner()
|| !_System_state_Is_up( _System_state_Get() )
);
+ _Assert( _Objects_Is_auto_extend( information ) );
+ extend_count = _Objects_Extend_size( information );
+ old_maximum = _Objects_Get_maximum_index( information );
+ new_maximum = (uint32_t) old_maximum + extend_count;
api_class_and_node = information->maximum_id & ~OBJECTS_INDEX_MASK;
/*
@@ -69,16 +73,12 @@ void _Objects_Extend_information(
* extend the block table, then we will change do_extend.
*/
do_extend = true;
- index_base = 0;
- block = 0;
+ index_base = extend_count;
+ block = 1;
if ( information->object_blocks == NULL ) {
- extend_count = _Objects_Get_maximum_index( information );
- old_maximum = 0;
- block_count = 0;
+ block_count = 1;
} else {
- extend_count = information->objects_per_block;
- old_maximum = _Objects_Get_maximum_index( information );
block_count = old_maximum / extend_count;
for ( ; block < block_count; block++ ) {
@@ -90,7 +90,6 @@ void _Objects_Extend_information(
}
}
- new_maximum = (uint32_t) old_maximum + extend_count;
index_end = index_base + extend_count;
/*
@@ -107,12 +106,9 @@ void _Objects_Extend_information(
* generate a fatal error depending on auto-extending being active.
*/
object_block_size = extend_count * information->object_size;
- if ( _Objects_Is_auto_extend( information ) ) {
- new_object_block = _Workspace_Allocate( object_block_size );
- if ( !new_object_block )
- return;
- } else {
- new_object_block = _Workspace_Allocate_or_fatal_error( object_block_size );
+ new_object_block = _Workspace_Allocate( object_block_size );
+ if ( new_object_block == NULL ) {
+ return;
}
/*
@@ -158,14 +154,10 @@ void _Objects_Extend_information(
table_size = object_blocks_size
+ local_table_size
+ block_count * sizeof( *inactive_per_block );
- if ( _Objects_Is_auto_extend( information ) ) {
- object_blocks = _Workspace_Allocate( table_size );
- if ( !object_blocks ) {
- _Workspace_Free( new_object_block );
- return;
- }
- } else {
- object_blocks = _Workspace_Allocate_or_fatal_error( table_size );
+ object_blocks = _Workspace_Allocate( table_size );
+ if ( object_blocks == NULL ) {
+ _Workspace_Free( new_object_block );
+ return;
}
/*
@@ -186,7 +178,7 @@ void _Objects_Extend_information(
*/
block_count--;
- if ( old_maximum > 0 ) {
+ if ( old_maximum > extend_count ) {
/*
* Copy each section of the table over. This has to be performed as
* separate parts as size of each block has changed.
@@ -201,13 +193,17 @@ void _Objects_Extend_information(
information->inactive_per_block,
block_count * sizeof( *inactive_per_block )
);
- memcpy(
- local_table,
- information->local_table,
- old_maximum * sizeof( *local_table )
- );
+ } else {
+ object_blocks[ 0 ] = NULL;
+ inactive_per_block[ 0 ] = 0;
}
+ memcpy(
+ local_table,
+ information->local_table,
+ old_maximum * sizeof( *local_table )
+ );
+
/*
* Initialise the new entries in the table.
*/
diff --git a/cpukit/score/src/objectfree.c b/cpukit/score/src/objectfree.c
index 38ae17d739..c9af8ba7cf 100644
--- a/cpukit/score/src/objectfree.c
+++ b/cpukit/score/src/objectfree.c
@@ -38,21 +38,24 @@ void _Objects_Free(
objects_per_block = information->objects_per_block;
block = _Objects_Get_index( the_object->id ) - OBJECTS_INDEX_MINIMUM;
- block /= objects_per_block;
- ++information->inactive_per_block[ block ];
+ if ( block > objects_per_block ) {
+ block /= objects_per_block;
- inactive = information->inactive;
- ++inactive;
- information->inactive = inactive;
+ ++information->inactive_per_block[ block ];
- /*
- * Check if the threshold level has been met of
- * 1.5 x objects_per_block are free.
- */
+ inactive = information->inactive;
+ ++inactive;
+ information->inactive = inactive;
- if ( inactive > ( objects_per_block + ( objects_per_block >> 1 ) ) ) {
- _Objects_Shrink_information( information );
+ /*
+ * Check if the threshold level has been met of
+ * 1.5 x objects_per_block are free.
+ */
+
+ if ( inactive > ( objects_per_block + ( objects_per_block >> 1 ) ) ) {
+ _Objects_Shrink_information( information );
+ }
}
}
}
diff --git a/cpukit/score/src/objectinitializeinformation.c b/cpukit/score/src/objectinitializeinformation.c
index 57e588ad4a..0b2fa2ad0f 100644
--- a/cpukit/score/src/objectinitializeinformation.c
+++ b/cpukit/score/src/objectinitializeinformation.c
@@ -24,83 +24,50 @@
#include <rtems/score/sysstate.h>
#include <rtems/score/wkspace.h>
-void _Objects_Do_initialize_information(
- Objects_Information *information,
- Objects_APIs the_api,
- uint16_t the_class,
- uint32_t maximum,
- uint16_t object_size,
- uint16_t maximum_name_length
-#if defined(RTEMS_MULTIPROCESSING)
- ,
- Objects_Thread_queue_Extract_callout extract
-#endif
+void _Objects_Initialize_information(
+ Objects_Information *information
)
{
- Objects_Maximum maximum_per_allocation;
-
- maximum_per_allocation = _Objects_Maximum_per_allocation( maximum );
- information->maximum_id = _Objects_Build_id(
- the_api,
- the_class,
- _Objects_Local_node,
- maximum_per_allocation
- );
- information->object_size = object_size;
+ Objects_Id maximum_id;
+ Objects_Id api_class_and_node;
+ Objects_Maximum maximum;
+ Objects_Maximum index;
+ Chain_Node *head;
+ Chain_Node *tail;
+ Chain_Node *current;
+ Objects_Control *next;
- /*
- * Register this Object Class in the Object Information Table.
- */
- _Objects_Information_table[ the_api ][ the_class ] = information;
-
- /*
- * Are we operating in limited or unlimited (e.g. auto-extend) mode.
- */
- if ( _Objects_Is_unlimited( maximum ) ) {
- /*
- * Unlimited and maximum of zero is illogical.
- */
- if ( maximum_per_allocation == 0) {
- _Internal_error( INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0 );
- }
+ maximum_id = information->maximum_id;
- /*
- * The allocation unit is the maximum value
- */
- information->objects_per_block = maximum_per_allocation;
- }
+#if defined(RTEMS_MULTIPROCESSING)
+ maximum_id |= _Objects_Local_node << OBJECTS_NODE_START_BIT;
+ information->maximum_id = maximum_id;
+#endif
+ maximum = _Objects_Get_index( maximum_id );
+ api_class_and_node = maximum_id & ~OBJECTS_INDEX_MASK;
/*
- * Calculate the maximum name length
- *
- * NOTE: Either 4 bytes for Classic API names or an arbitrary
- * number for POSIX names which are strings that may be
- * an odd number of bytes.
+ * Register this Object Class in the Object Information Table.
*/
+ _Objects_Information_table[ _Objects_Get_API( maximum_id ) ]
+ [ _Objects_Get_class( maximum_id ) ] = information;
- information->name_length = maximum_name_length;
+ head = _Chain_Head( &information->Inactive );
+ tail = _Chain_Tail( &information->Inactive );
+ current = head;
+ next = information->initial_objects;
- _Chain_Initialize_empty( &information->Inactive );
+ head->previous = NULL;
- /*
- * Initialize objects .. if there are any
- */
- if ( maximum_per_allocation ) {
- /*
- * Always have the maximum size available so the current performance
- * figures are create are met. If the user moves past the maximum
- * number then a performance hit is taken.
- */
- _Objects_Extend_information( information );
+ for ( index = OBJECTS_INDEX_MINIMUM; index <= maximum ; ++index ) {
+ current->next = &next->Node;
+ next->Node.previous = current;
+ current = &next->Node;
+ next->id = api_class_and_node | ( index << OBJECTS_INDEX_START_BIT );
+ next = _Addresses_Add_offset( next, information->object_size );
}
- /*
- * Take care of multiprocessing
- */
- #if defined(RTEMS_MULTIPROCESSING)
- information->extract = extract;
- _RBTree_Initialize_empty( &information->Global_by_id );
- _RBTree_Initialize_empty( &information->Global_by_name );
- #endif
+ current->next = tail;
+ tail->previous = current;
}
diff --git a/cpukit/score/src/objectshrinkinformation.c b/cpukit/score/src/objectshrinkinformation.c
index 5a53be9979..964f3f5ef6 100644
--- a/cpukit/score/src/objectshrinkinformation.c
+++ b/cpukit/score/src/objectshrinkinformation.c
@@ -33,6 +33,7 @@ void _Objects_Shrink_information(
Objects_Maximum index_base;
_Assert( _Objects_Allocator_is_owner() );
+ _Assert( _Objects_Is_auto_extend( information ) );
/*
* Search the list to find block or chunk with all objects inactive.
@@ -40,9 +41,9 @@ void _Objects_Shrink_information(
objects_per_block = information->objects_per_block;
block_count = _Objects_Get_maximum_index( information ) / objects_per_block;
- index_base = 0;
+ index_base = objects_per_block;
- for ( block = 0; block < block_count; block++ ) {
+ for ( block = 1; block < block_count; block++ ) {
if ( information->inactive_per_block[ block ] == objects_per_block ) {
Chain_Node *node;
const Chain_Node *tail;
diff --git a/cpukit/score/src/thread.c b/cpukit/score/src/thread.c
index 5c27ee00ef..822fb7cb37 100644
--- a/cpukit/score/src/thread.c
+++ b/cpukit/score/src/thread.c
@@ -20,6 +20,7 @@
#include <rtems/score/threadimpl.h>
#include <rtems/score/interr.h>
+#include <rtems/score/objectimpl.h>
#include <rtems/score/scheduler.h>
#include <rtems/score/wkspace.h>
@@ -43,30 +44,15 @@ THREAD_OFFSET_ASSERT( Timer );
THREAD_OFFSET_ASSERT( receive_packet );
#endif
-Thread_Information _Thread_Internal_information;
-
-void _Thread_Initialize_information(
- Thread_Information *information,
- Objects_APIs the_api,
- uint16_t the_class,
- uint32_t maximum
-)
+void _Thread_Initialize_information( Thread_Information *information )
{
- _Objects_Initialize_information(
- &information->Objects,
- the_api,
- the_class,
- maximum,
- _Thread_Control_size,
- OBJECTS_NO_STRING_NAME,
- NULL
- );
+ _Objects_Initialize_information( &information->Objects );
_Freechain_Initialize(
- &information->Free_thread_queue_heads,
- _Workspace_Allocate_or_fatal_error,
- _Objects_Maximum_per_allocation( maximum ),
- THREAD_QUEUE_HEADS_SIZE( _Scheduler_Count )
+ &information->Thread_queue_heads.Free,
+ information->Thread_queue_heads.initial,
+ _Objects_Get_maximum_index( &information->Objects ),
+ _Thread_queue_Heads_size
);
}
@@ -95,11 +81,5 @@ void _Thread_Handler_initialization(void)
* per CPU in an SMP system. In addition, if this is a loosely
* coupled multiprocessing system, account for the MPCI Server Thread.
*/
- _Thread_Initialize_information(
- &_Thread_Internal_information,
- OBJECTS_INTERNAL_API,
- OBJECTS_INTERNAL_THREADS,
- _Thread_Get_maximum_internal_threads()
- );
-
+ _Thread_Initialize_information( &_Thread_Information );
}
diff --git a/cpukit/score/src/threadcreateidle.c b/cpukit/score/src/threadcreateidle.c
index d8dd2b4197..cdb2b1eebd 100644
--- a/cpukit/score/src/threadcreateidle.c
+++ b/cpukit/score/src/threadcreateidle.c
@@ -51,7 +51,7 @@ static void _Thread_Create_idle_for_CPU( Per_CPU_Control *cpu )
_Assert( idle != NULL );
_Thread_Initialize(
- &_Thread_Internal_information,
+ &_Thread_Information,
idle,
scheduler,
NULL, /* allocate the stack */
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c
index df526e9a8e..c15731f99c 100644
--- a/cpukit/score/src/threadinitialize.c
+++ b/cpukit/score/src/threadinitialize.c
@@ -145,10 +145,10 @@ bool _Thread_Initialize(
* Get thread queue heads
*/
the_thread->Wait.spare_heads = _Freechain_Get(
- &information->Free_thread_queue_heads,
+ &information->Thread_queue_heads.Free,
_Workspace_Allocate,
_Objects_Extend_size( &information->Objects ),
- THREAD_QUEUE_HEADS_SIZE( _Scheduler_Count )
+ _Thread_queue_Heads_size
);
if ( the_thread->Wait.spare_heads == NULL ) {
goto failed;
@@ -308,7 +308,7 @@ failed:
_Workspace_Free( the_thread->Start.tls_area );
_Freechain_Put(
- &information->Free_thread_queue_heads,
+ &information->Thread_queue_heads.Free,
the_thread->Wait.spare_heads
);
diff --git a/cpukit/score/src/threadmp.c b/cpukit/score/src/threadmp.c
index 4868e8fe4e..006d0f5bcf 100644
--- a/cpukit/score/src/threadmp.c
+++ b/cpukit/score/src/threadmp.c
@@ -54,8 +54,7 @@ void _Thread_MP_Handler_initialization (
return;
}
- proxy_size = sizeof( Thread_Proxy_control )
- + THREAD_QUEUE_HEADS_SIZE( _Scheduler_Count );
+ proxy_size = sizeof( Thread_Proxy_control ) + _Thread_queue_Heads_size;
alloc_size = maximum_proxies * proxy_size;
proxies = _Workspace_Allocate_or_fatal_error( alloc_size );
memset( proxies, 0, alloc_size );
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c
index 66cf4df845..bcd900aa69 100644
--- a/cpukit/score/src/threadrestart.c
+++ b/cpukit/score/src/threadrestart.c
@@ -176,7 +176,7 @@ static void _Thread_Free( Thread_Control *the_thread )
#endif
_Freechain_Put(
- &information->Free_thread_queue_heads,
+ &information->Thread_queue_heads.Free,
the_thread->Wait.spare_heads
);
diff --git a/cpukit/score/src/wkspace.c b/cpukit/score/src/wkspace.c
index c9df793526..95c4127056 100644
--- a/cpukit/score/src/wkspace.c
+++ b/cpukit/score/src/wkspace.c
@@ -42,24 +42,6 @@ RTEMS_LINKER_RWSET(
Heap_Control _Workspace_Area;
-static uint32_t _Workspace_Get_maximum_thread_count( void )
-{
- uint32_t thread_count;
-
- thread_count = 0;
- thread_count += _Thread_Get_maximum_internal_threads();
-
- thread_count += rtems_resource_maximum_per_allocation(
- Configuration_RTEMS_API.maximum_tasks
- );
-
- thread_count += rtems_resource_maximum_per_allocation(
- _Configuration_POSIX_Maximum_threads
- );
-
- return thread_count;
-}
-
static uintptr_t _Workspace_Space_for_TLS( uintptr_t page_size )
{
uintptr_t tls_size;
@@ -86,7 +68,7 @@ static uintptr_t _Workspace_Space_for_TLS( uintptr_t page_size )
*/
space = _Heap_Min_block_size( page_size );
- space += _Workspace_Get_maximum_thread_count()
+ space += _Thread_Initial_thread_count
* _Heap_Size_with_overhead( page_size, tls_alloc, tls_align );
} else {
space = 0;
diff --git a/testsuites/psxtests/psxobj01/init.c b/testsuites/psxtests/psxobj01/init.c
index 52cad3462d..ba1e327ea5 100644
--- a/testsuites/psxtests/psxobj01/init.c
+++ b/testsuites/psxtests/psxobj01/init.c
@@ -22,15 +22,18 @@
const char rtems_test_name[] = "PSXOBJ 1";
-/* forward declarations to avoid warnings */
-rtems_task Init(rtems_task_argument ignored);
+typedef struct {
+ Objects_Control Object;
+} Test_Control;
-rtems_task Init(
+/* very fake object class to test with */
+OBJECTS_INFORMATION_DEFINE( Test, 1, 4, Test_Control, 0, 10, NULL );
+
+static rtems_task Init(
rtems_task_argument ignored
)
{
Objects_Get_by_name_error error;
- Objects_Information TestClass;
Objects_Control *the_object;
char name[64];
size_t name_len;
@@ -38,21 +41,9 @@ rtems_task Init(
TEST_BEGIN();
- /* very fake object class to test with */
- _Objects_Initialize_information(
- &TestClass,
- 1, /* the_api */
- 4, /* the_class */
- 0, /* maximum */
- 4, /* size */
- 10, /* maximum_name_length */
- NULL /* Objects_Thread_queue_Extract_callout extract */
- );
-
-
puts( "INIT - _Objects_Get_by_name - NULL name" );
_Objects_Allocator_lock();
- the_object = _Objects_Get_by_name( &TestClass, NULL, NULL, &error );
+ the_object = _Objects_Get_by_name( &Test_Information, NULL, NULL, &error );
_Objects_Allocator_unlock();
rtems_test_assert( the_object == NULL );
rtems_test_assert( error == OBJECTS_GET_BY_NAME_INVALID_NAME );
@@ -60,7 +51,7 @@ rtems_task Init(
puts( "INIT - _Objects_Get_by_name - name too long" );
strcpy( name, "TOOOOOOOOOOOOOOOOOO LONG" );
_Objects_Allocator_lock();
- the_object = _Objects_Get_by_name( &TestClass, name, NULL, &error );
+ the_object = _Objects_Get_by_name( &Test_Information, name, NULL, &error );
_Objects_Allocator_unlock();
rtems_test_assert( the_object == NULL );
rtems_test_assert( error == OBJECTS_GET_BY_NAME_NAME_TOO_LONG );
@@ -69,7 +60,7 @@ rtems_task Init(
strcpy( name, "NOT FOUND" );
name_len = 123;
_Objects_Allocator_lock();
- the_object = _Objects_Get_by_name( &TestClass, name, &name_len, &error );
+ the_object = _Objects_Get_by_name( &Test_Information, name, &name_len, &error );
_Objects_Allocator_unlock();
rtems_test_assert( the_object == NULL );
rtems_test_assert( error == OBJECTS_GET_BY_NAME_NO_OBJECT );
@@ -79,7 +70,11 @@ rtems_task Init(
puts( "INIT - _Objects_Set_name fails - out of memory" );
rtems_workspace_greedy_allocate( NULL, 0 );
- bc = _Objects_Set_name( &TestClass, &_Thread_Get_executing()->Object, name );
+ bc = _Objects_Set_name(
+ &Test_Information,
+ &_Thread_Get_executing()->Object,
+ name
+ );
rtems_test_assert( bc == false );
TEST_END();
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 80680dfe83..8f92873d2b 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -985,16 +985,6 @@ spfatal12_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal12) \
$(support_includes) -I$(top_srcdir)/spfatal12
endif
-if TEST_spfatal13
-sp_tests += spfatal13
-sp_screens += spfatal13/spfatal13.scn
-sp_docs += spfatal13/spfatal13.doc
-spfatal13_SOURCES = spfatal_support/init.c spfatal_support/system.h \
- spfatal13/testcase.h
-spfatal13_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal13) \
- $(support_includes) -I$(top_srcdir)/spfatal13
-endif
-
if TEST_spfatal14
sp_tests += spfatal14
sp_screens += spfatal14/spfatal14.scn
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index e725b39067..d25d9e9e32 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -146,7 +146,6 @@ RTEMS_TEST_CHECK([spfatal09])
RTEMS_TEST_CHECK([spfatal10])
RTEMS_TEST_CHECK([spfatal11])
RTEMS_TEST_CHECK([spfatal12])
-RTEMS_TEST_CHECK([spfatal13])
RTEMS_TEST_CHECK([spfatal14])
RTEMS_TEST_CHECK([spfatal15])
RTEMS_TEST_CHECK([spfatal16])
diff --git a/testsuites/sptests/spfatal13/spfatal13.doc b/testsuites/sptests/spfatal13/spfatal13.doc
deleted file mode 100644
index e47ee27d12..0000000000
--- a/testsuites/sptests/spfatal13/spfatal13.doc
+++ /dev/null
@@ -1,19 +0,0 @@
-# COPYRIGHT (c) 1989-2009.
-# On-Line Applications Research Corporation (OAR).
-#
-# The license and distribution terms for this file may be
-# found in the file LICENSE in this distribution or at
-# http://www.rtems.org/license/LICENSE.
-#
-
-This file describes the directives and concepts tested by this test set.
-
-test set name: fatal 13
-
-directives:
- initialization focued on _Objects_Initialize
-
-concepts:
-
- a. Verify that the combination of maximum of 0 and unlimited is
- detected.
diff --git a/testsuites/sptests/spfatal13/spfatal13.scn b/testsuites/sptests/spfatal13/spfatal13.scn
deleted file mode 100644
index 27c0dba42e..0000000000
--- a/testsuites/sptests/spfatal13/spfatal13.scn
+++ /dev/null
@@ -1,3 +0,0 @@
-*** TEST FATAL 13 ***
-Fatal error (Configuration of unlimited and maximum of 0) hit
-*** END OF TEST FATAL 13 ***
diff --git a/testsuites/sptests/spfatal13/testcase.h b/testsuites/sptests/spfatal13/testcase.h
deleted file mode 100644
index 6f82689958..0000000000
--- a/testsuites/sptests/spfatal13/testcase.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Test __assert_func with NULL function name
- *
- * COPYRIGHT (c) 1989-2010.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#define FATAL_ERROR_TEST_NAME "13"
-#define FATAL_ERROR_DESCRIPTION \
- "Configuration of unlimited and maximum of 0"
-#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
-#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0
-
-/*
- * Actual object does not matter. Important thing is zero and unlimited.
- */
-#define CONFIGURE_MAXIMUM_PARTITIONS rtems_resource_unlimited(0)
-
-void force_error()
-{
- /* we should not run this far */
- rtems_partition_create(0, NULL, 0, 0, 0, NULL);
-}
diff --git a/testsuites/sptests/spfreechain01/init.c b/testsuites/sptests/spfreechain01/init.c
index 60388101ea..22730793a4 100644
--- a/testsuites/sptests/spfreechain01/init.c
+++ b/testsuites/sptests/spfreechain01/init.c
@@ -25,13 +25,16 @@ static rtems_task Init(rtems_task_argument ignored)
{
Freechain_Control fc;
test_node *node;
+ test_node node2;
TEST_BEGIN();
- _Freechain_Initialize(&fc, NULL, 0, sizeof(test_node));
- rtems_test_assert(_Chain_Is_empty(&fc.Free));
+ _Freechain_Initialize(&fc, &node2, 1, sizeof(node2));
+ rtems_test_assert(_Chain_Node_count_unprotected(&fc.Free) == 1);
+ rtems_test_assert(_Chain_First(&fc.Free) == &node2.Node);
+ rtems_test_assert(_Chain_Last(&fc.Free) == &node2.Node);
- _Freechain_Initialize(&fc, malloc, 1, SIZE_MAX);
+ _Freechain_Initialize(&fc, NULL, 0, sizeof(test_node));
rtems_test_assert(_Chain_Is_empty(&fc.Free));
rtems_test_assert(_Freechain_Get(&fc, NULL, 0, sizeof(test_node)) == NULL);
diff --git a/testsuites/sptests/spsimplesched02/init.c b/testsuites/sptests/spsimplesched02/init.c
index f683a7dd90..b7b1a21919 100644
--- a/testsuites/sptests/spsimplesched02/init.c
+++ b/testsuites/sptests/spsimplesched02/init.c
@@ -81,7 +81,7 @@ rtems_task Init(
TEST_BEGIN();
status = _Objects_Name_to_id_u32(
- &_Thread_Internal_information.Objects,
+ &_Thread_Information.Objects,
rtems_build_name( 'I', 'D', 'L', 'E' ),
RTEMS_SEARCH_LOCAL_NODE,
&Idle_id
diff --git a/testsuites/sptests/spsize/size.c b/testsuites/sptests/spsize/size.c
index 951cdd7414..671ecd7197 100644
--- a/testsuites/sptests/spsize/size.c
+++ b/testsuites/sptests/spsize/size.c
@@ -368,7 +368,7 @@ uninitialized =
#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1)
(sizeof _Thread_Allocated_fp) +
#endif
- (sizeof _Thread_Internal_information) +
+ (sizeof _Thread_Information) +
/*threadq.h*/
diff --git a/testsuites/sptests/spsysinit01/init.c b/testsuites/sptests/spsysinit01/init.c
index 6d0c431a85..7e187c423e 100644
--- a/testsuites/sptests/spsysinit01/init.c
+++ b/testsuites/sptests/spsysinit01/init.c
@@ -19,12 +19,18 @@
#include "tmacros.h"
#include <sys/types.h>
+#include <sys/mman.h>
#include <sys/stat.h>
#include <assert.h>
+#include <fcntl.h>
+#include <mqueue.h>
#include <pthread.h>
-#include <string.h>
+#include <semaphore.h>
+#include <signal.h>
#include <stdlib.h>
+#include <string.h>
+#include <time.h>
#include <unistd.h>
#include <rtems.h>
@@ -188,6 +194,16 @@ static void next_step(init_step expected)
step = expected + 1;
}
+static bool info_not_init(const Objects_Information *info)
+{
+ return _Chain_Is_empty(&info->Inactive);
+}
+
+static bool info_is_init(const Objects_Information *info, size_t count)
+{
+ return _Chain_Node_count_unprotected(&info->Inactive) == count;
+}
+
FIRST(RTEMS_SYSINIT_BSP_WORK_AREAS)
{
assert(_Workspace_Area.area_begin == 0);
@@ -248,53 +264,49 @@ LAST(RTEMS_SYSINIT_INITIAL_EXTENSIONS)
FIRST(RTEMS_SYSINIT_DATA_STRUCTURES)
{
- assert(
- _Objects_Get_maximum_index(&_Thread_Internal_information.Objects) == 0
- );
+ assert(info_not_init(&_Thread_Information.Objects));
next_step(DATA_STRUCTURES_PRE);
}
LAST(RTEMS_SYSINIT_DATA_STRUCTURES)
{
- assert(
- _Objects_Get_maximum_index(&_Thread_Internal_information.Objects) != 0
- );
+ assert(info_is_init(&_Thread_Information.Objects, 1));
next_step(DATA_STRUCTURES_POST);
}
FIRST(RTEMS_SYSINIT_USER_EXTENSIONS)
{
- assert(_Objects_Get_maximum_index(&_Extension_Information) == 0);
+ assert(info_not_init(&_Extension_Information));
next_step(USER_EXTENSIONS_PRE);
}
LAST(RTEMS_SYSINIT_USER_EXTENSIONS)
{
- assert(_Objects_Get_maximum_index(&_Extension_Information) != 0);
+ assert(info_is_init(&_Extension_Information, 1));
next_step(USER_EXTENSIONS_POST);
}
FIRST(RTEMS_SYSINIT_CLASSIC_TASKS)
{
- assert(_Objects_Get_maximum_index(&_RTEMS_tasks_Information.Objects) == 0);
+ assert(info_not_init(&_RTEMS_tasks_Information.Objects));
next_step(CLASSIC_TASKS_PRE);
}
LAST(RTEMS_SYSINIT_CLASSIC_TASKS)
{
- assert(_Objects_Get_maximum_index(&_RTEMS_tasks_Information.Objects) != 0);
+ assert(info_is_init(&_RTEMS_tasks_Information.Objects, 2));
next_step(CLASSIC_TASKS_POST);
}
FIRST(RTEMS_SYSINIT_CLASSIC_TIMER)
{
- assert(_Objects_Get_maximum_index(&_Timer_Information) == 0);
+ assert(info_not_init(&_Timer_Information));
next_step(CLASSIC_TIMER_PRE);
}
LAST(RTEMS_SYSINIT_CLASSIC_TIMER)
{
- assert(_Objects_Get_maximum_index(&_Timer_Information) != 0);
+ assert(info_is_init(&_Timer_Information, 1));
next_step(CLASSIC_TIMER_POST);
}
@@ -322,85 +334,85 @@ LAST(RTEMS_SYSINIT_CLASSIC_EVENT)
FIRST(RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE)
{
- assert(_Objects_Get_maximum_index(&_Message_queue_Information) == 0);
+ assert(info_not_init(&_Message_queue_Information));
next_step(CLASSIC_MESSAGE_QUEUE_PRE);
}
LAST(RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE)
{
- assert(_Objects_Get_maximum_index(&_Message_queue_Information) != 0);
+ assert(info_is_init(&_Message_queue_Information, 1));
next_step(CLASSIC_MESSAGE_QUEUE_POST);
}
FIRST(RTEMS_SYSINIT_CLASSIC_SEMAPHORE)
{
- assert(_Objects_Get_maximum_index(&_Semaphore_Information) == 0);
+ assert(_Semaphore_Information.initial_objects[0].id == 0);
next_step(CLASSIC_SEMAPHORE_PRE);
}
LAST(RTEMS_SYSINIT_CLASSIC_SEMAPHORE)
{
- assert(_Objects_Get_maximum_index(&_Semaphore_Information) != 0);
+ assert(_Semaphore_Information.initial_objects[0].id != 0);
next_step(CLASSIC_SEMAPHORE_POST);
}
FIRST(RTEMS_SYSINIT_CLASSIC_PARTITION)
{
- assert(_Objects_Get_maximum_index(&_Partition_Information) == 0);
+ assert(info_not_init(&_Partition_Information));
next_step(CLASSIC_PARTITION_PRE);
}
LAST(RTEMS_SYSINIT_CLASSIC_PARTITION)
{
- assert(_Objects_Get_maximum_index(&_Partition_Information) != 0);
+ assert(info_is_init(&_Partition_Information, 1));
next_step(CLASSIC_PARTITION_POST);
}
FIRST(RTEMS_SYSINIT_CLASSIC_REGION)
{
- assert(_Objects_Get_maximum_index(&_Region_Information) == 0);
+ assert(info_not_init(&_Region_Information));
next_step(CLASSIC_REGION_PRE);
}
LAST(RTEMS_SYSINIT_CLASSIC_REGION)
{
- assert(_Objects_Get_maximum_index(&_Region_Information) != 0);
+ assert(info_is_init(&_Region_Information, 1));
next_step(CLASSIC_REGION_POST);
}
FIRST(RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY)
{
- assert(_Objects_Get_maximum_index(&_Dual_ported_memory_Information) == 0);
+ assert(info_not_init(&_Dual_ported_memory_Information));
next_step(CLASSIC_DUAL_PORTED_MEMORY_PRE);
}
LAST(RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY)
{
- assert(_Objects_Get_maximum_index(&_Dual_ported_memory_Information) != 0);
+ assert(info_is_init(&_Dual_ported_memory_Information, 1));
next_step(CLASSIC_DUAL_PORTED_MEMORY_POST);
}
FIRST(RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC)
{
- assert(_Objects_Get_maximum_index(&_Rate_monotonic_Information) == 0);
+ assert(info_not_init(&_Rate_monotonic_Information));
next_step(CLASSIC_RATE_MONOTONIC_PRE);
}
LAST(RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC)
{
- assert(_Objects_Get_maximum_index(&_Rate_monotonic_Information) != 0);
+ assert(info_is_init(&_Rate_monotonic_Information, 1));
next_step(CLASSIC_RATE_MONOTONIC_POST);
}
FIRST(RTEMS_SYSINIT_CLASSIC_BARRIER)
{
- assert(_Objects_Get_maximum_index(&_Barrier_Information) == 0);
+ assert(info_not_init(&_Barrier_Information));
next_step(CLASSIC_BARRIER_PRE);
}
LAST(RTEMS_SYSINIT_CLASSIC_BARRIER)
{
- assert(_Objects_Get_maximum_index(&_Barrier_Information) != 0);
+ assert(info_is_init(&_Barrier_Information, 1));
next_step(CLASSIC_BARRIER_POST);
}
@@ -432,63 +444,63 @@ LAST(RTEMS_SYSINIT_POSIX_SIGNALS)
FIRST(RTEMS_SYSINIT_POSIX_THREADS)
{
- assert(_Objects_Get_maximum_index(&_POSIX_Threads_Information.Objects) == 0);
+ assert(info_not_init(&_POSIX_Threads_Information.Objects));
next_step(POSIX_THREADS_PRE);
}
LAST(RTEMS_SYSINIT_POSIX_THREADS)
{
- assert(_Objects_Get_maximum_index(&_POSIX_Threads_Information.Objects) != 0);
+ assert(info_is_init(&_POSIX_Threads_Information.Objects, 1));
next_step(POSIX_THREADS_POST);
}
FIRST(RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE)
{
- assert(_Objects_Get_maximum_index(&_POSIX_Message_queue_Information) == 0);
+ assert(info_not_init(&_POSIX_Message_queue_Information));
next_step(POSIX_MESSAGE_QUEUE_PRE);
}
LAST(RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE)
{
- assert(_Objects_Get_maximum_index(&_POSIX_Message_queue_Information) != 0);
+ assert(info_is_init(&_POSIX_Message_queue_Information, 1));
next_step(POSIX_MESSAGE_QUEUE_POST);
}
FIRST(RTEMS_SYSINIT_POSIX_SEMAPHORE)
{
- assert(_Objects_Get_maximum_index(&_POSIX_Semaphore_Information) == 0);
+ assert(info_not_init(&_POSIX_Semaphore_Information));
next_step(POSIX_SEMAPHORE_PRE);
}
LAST(RTEMS_SYSINIT_POSIX_SEMAPHORE)
{
- assert(_Objects_Get_maximum_index(&_POSIX_Semaphore_Information) != 0);
+ assert(info_is_init(&_POSIX_Semaphore_Information, 1));
next_step(POSIX_SEMAPHORE_POST);
}
#ifdef RTEMS_POSIX_API
FIRST(RTEMS_SYSINIT_POSIX_TIMER)
{
- assert(_Objects_Get_maximum_index(&_POSIX_Timer_Information) == 0);
+ assert(info_not_init(&_POSIX_Timer_Information));
next_step(POSIX_TIMER_PRE);
}
LAST(RTEMS_SYSINIT_POSIX_TIMER)
{
- assert(_Objects_Get_maximum_index(&_POSIX_Timer_Information) != 0);
+ assert(info_is_init(&_POSIX_Timer_Information, 1));
next_step(POSIX_TIMER_POST);
}
#endif /* RTEMS_POSIX_API */
FIRST(RTEMS_SYSINIT_POSIX_SHM)
{
- assert(_Objects_Get_maximum_index(&_POSIX_Shm_Information) == 0);
+ assert(info_not_init(&_POSIX_Shm_Information));
next_step(POSIX_SHM_PRE);
}
LAST(RTEMS_SYSINIT_POSIX_SHM)
{
- assert(_Objects_Get_maximum_index(&_POSIX_Shm_Information) != 0);
+ assert(info_is_init(&_POSIX_Shm_Information, 1));
next_step(POSIX_SHM_POST);
}
@@ -512,13 +524,13 @@ LAST(RTEMS_SYSINIT_POSIX_CLEANUP)
FIRST(RTEMS_SYSINIT_POSIX_KEYS)
{
- assert(_Objects_Get_maximum_index(&_POSIX_Keys_Information) == 0);
+ assert(info_not_init(&_POSIX_Keys_Information));
next_step(POSIX_KEYS_PRE);
}
LAST(RTEMS_SYSINIT_POSIX_KEYS)
{
- assert(_Objects_Get_maximum_index(&_POSIX_Keys_Information) != 0);
+ assert(info_is_init(&_POSIX_Keys_Information, 2));
next_step(POSIX_KEYS_POST);
}
@@ -657,11 +669,268 @@ LAST_STEP(TENTH);
LAST_STEP(MIDDLE);
LAST_STEP(LAST);
-static void Init(rtems_task_argument arg)
+static void do_barrier_create(void)
+{
+ rtems_status_code sc;
+ rtems_id id;
+
+ sc = rtems_barrier_create(
+ rtems_build_name('T', 'E', 'S', 'T'),
+ RTEMS_DEFAULT_ATTRIBUTES,
+ 1,
+ &id
+ );
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+ sc = rtems_barrier_delete(id);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+}
+
+static void do_extensions_create(void)
+{
+ rtems_status_code sc;
+ rtems_id id;
+ rtems_extensions_table table;
+
+ memset(&table, 0, sizeof(table));
+ sc = rtems_extension_create(
+ rtems_build_name('T', 'E', 'S', 'T'),
+ &table,
+ &id
+ );
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+ sc = rtems_extension_delete(id);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+}
+
+static void do_message_queue_create(void)
+{
+ rtems_status_code sc;
+ rtems_id id;
+
+ sc = rtems_message_queue_create(
+ rtems_build_name('T', 'E', 'S', 'T'),
+ 1,
+ 1,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+ sc = rtems_message_queue_delete(id);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+}
+
+static void do_partition_create(void)
+{
+ rtems_status_code sc;
+ rtems_id id;
+ long buf[32];
+
+ sc = rtems_partition_create(
+ rtems_build_name('T', 'E', 'S', 'T'),
+ buf,
+ sizeof(buf),
+ sizeof(buf),
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+ sc = rtems_partition_delete(id);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+}
+
+static void do_period_create(void)
+{
+ rtems_status_code sc;
+ rtems_id id;
+
+ sc = rtems_rate_monotonic_create(
+ rtems_build_name('T', 'E', 'S', 'T'),
+ &id
+ );
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+ sc = rtems_rate_monotonic_delete(id);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+}
+
+static void do_port_create(void)
+{
+ rtems_status_code sc;
+ rtems_id id;
+
+ sc = rtems_port_create(
+ rtems_build_name('T', 'E', 'S', 'T'),
+ NULL,
+ NULL,
+ 1,
+ &id
+ );
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+ sc = rtems_port_delete(id);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+}
+
+static void do_region_create(void)
+{
+ rtems_status_code sc;
+ rtems_id id;
+ long buf[32];
+
+ sc = rtems_region_create(
+ rtems_build_name('T', 'E', 'S', 'T'),
+ buf,
+ sizeof(buf),
+ 1,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+ sc = rtems_region_delete(id);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+}
+
+static void do_semaphore_create(void)
+{
+ rtems_status_code sc;
+ rtems_id id;
+
+ sc = rtems_semaphore_create(
+ rtems_build_name('T', 'E', 'S', 'T'),
+ 0,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ 0,
+ &id
+ );
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+ sc = rtems_semaphore_delete(id);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+}
+
+static void do_task_create(void)
+{
+ rtems_status_code sc;
+ rtems_id id;
+
+ sc = rtems_task_create(
+ rtems_build_name('T', 'E', 'S', 'T'),
+ 1,
+ RTEMS_MINIMUM_STACK_SIZE,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+ sc = rtems_task_delete(id);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+}
+
+static void do_timer_create(void)
+{
+ rtems_status_code sc;
+ rtems_id id;
+
+ sc = rtems_timer_create(rtems_build_name('T', 'E', 'S', 'T'), &id);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+ sc = rtems_timer_delete(id);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+}
+
+static void do_cleanup_push_pop(void)
{
pthread_cleanup_push(NULL, NULL);
pthread_cleanup_pop(0);
+}
+
+static void do_posix_mq_open(void)
+{
+ struct mq_attr attr;
+ mqd_t mq;
+ int rv;
+
+ memset(&attr, 0, sizeof(attr));
+ attr.mq_maxmsg = 1;
+ attr.mq_msgsize = 1;
+ mq = mq_open("mq", O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO, &attr);
+ rtems_test_assert(mq != (mqd_t) -1);
+
+ rv = mq_close(mq);
+ rtems_test_assert(rv == 0);
+
+ rv = mq_unlink("mq");
+ rtems_test_assert(rv == 0);
+}
+
+static void do_posix_sem_open(void)
+{
+ sem_t *sem;
+ int rv;
+
+ sem = sem_open("sem", O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO);
+ rtems_test_assert(sem != SEM_FAILED);
+
+ rv = sem_close(sem);
+ rtems_test_assert(rv == 0);
+
+ rv = sem_unlink("sem");
+ rtems_test_assert(rv == 0);
+}
+
+static void do_posix_shm_open(void)
+{
+ int fd;
+ int rv;
+
+ fd = shm_open("/shm", O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO);
+ rtems_test_assert(fd >= 0);
+
+ rv = close(fd);
+ rtems_test_assert(rv == 0);
+
+ rv = shm_unlink("/shm");
+ rtems_test_assert(rv == 0);
+}
+
+static void do_posix_timer_create(void)
+{
+#ifdef RTEMS_POSIX_API
+ int rv;
+ timer_t timer;
+
+ rv = timer_create(CLOCK_REALTIME, NULL, &timer);
+ rtems_test_assert(rv == 0);
+
+ rv = timer_delete(timer);
+ rtems_test_assert(rv == 0);
+#endif /* RTEMS_POSIX_API */
+}
+
+static void Init(rtems_task_argument arg)
+{
next_step(INIT_TASK);
+ do_barrier_create();
+ do_extensions_create();
+ do_message_queue_create();
+ do_partition_create();
+ do_period_create();
+ do_port_create();
+ do_region_create();
+ do_semaphore_create();
+ do_task_create();
+ do_timer_create();
+ do_cleanup_push_pop();
+ do_posix_mq_open();
+ do_posix_sem_open();
+ do_posix_shm_open();
+ do_posix_timer_create();
TEST_END();
exit(0);
}
@@ -672,8 +941,11 @@ static void *POSIX_Init(void *arg)
}
#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
+
#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1
#define CONFIGURE_MAXIMUM_BARRIERS 1
@@ -690,7 +962,7 @@ static void *POSIX_Init(void *arg)
#define CONFIGURE_MAXIMUM_SEMAPHORES 1
-#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_MAXIMUM_TIMERS 1
@@ -710,6 +982,9 @@ static void *POSIX_Init(void *arg)
#define CONFIGURE_MAXIMUM_POSIX_KEYS 1
+#define CONFIGURE_MESSAGE_BUFFER_MEMORY \
+ CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(1, 1)
+
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_STACK_CHECKER_ENABLED