[PATCH 4/6] posix: Split posix_api_configuration_table
Sebastian Huber
sebastian.huber at embedded-brains.de
Mon Oct 15 06:42:20 UTC 2018
Use separate configuration variables to avoid false dependencies.
Update #2514.
---
cpukit/Makefile.am | 6 +++
cpukit/include/rtems/confdefs.h | 95 ++++++++++++++++------------------
cpukit/include/rtems/config.h | 13 +----
cpukit/include/rtems/posix/config.h | 66 ++---------------------
cpukit/include/rtems/posix/mqueue.h | 2 +
cpukit/include/rtems/posix/psignal.h | 2 +
cpukit/include/rtems/posix/pthread.h | 3 +-
cpukit/include/rtems/posix/semaphore.h | 2 +
cpukit/include/rtems/posix/shm.h | 4 ++
cpukit/include/rtems/posix/timer.h | 2 +
cpukit/posix/src/mqueue.c | 3 +-
cpukit/posix/src/mqueueconfig.c | 34 ++++++++++++
cpukit/posix/src/psignal.c | 2 +-
cpukit/posix/src/psignalconfig.c | 34 ++++++++++++
cpukit/posix/src/psxsemaphore.c | 3 +-
cpukit/posix/src/psxsemaphoreconfig.c | 34 ++++++++++++
cpukit/posix/src/psxtimerconfig.c | 34 ++++++++++++
cpukit/posix/src/pthread.c | 3 +-
cpukit/posix/src/pthreadconfig.c | 34 ++++++++++++
cpukit/posix/src/pthreadinitthreads.c | 4 +-
cpukit/posix/src/ptimer.c | 3 +-
cpukit/posix/src/shm.c | 3 +-
cpukit/posix/src/shmconfig.c | 34 ++++++++++++
cpukit/score/src/wkspace.c | 3 +-
24 files changed, 284 insertions(+), 139 deletions(-)
create mode 100644 cpukit/posix/src/mqueueconfig.c
create mode 100644 cpukit/posix/src/psignalconfig.c
create mode 100644 cpukit/posix/src/psxsemaphoreconfig.c
create mode 100644 cpukit/posix/src/psxtimerconfig.c
create mode 100644 cpukit/posix/src/pthreadconfig.c
create mode 100644 cpukit/posix/src/shmconfig.c
diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index e13892d12b..eb6bb515ca 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -484,6 +484,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/mqueueconfig.c
librtemscpu_a_SOURCES += posix/src/mutexattrdestroy.c
librtemscpu_a_SOURCES += posix/src/mutexattrgetprioceiling.c
librtemscpu_a_SOURCES += posix/src/mutexattrgetprotocol.c
@@ -516,11 +517,14 @@ librtemscpu_a_SOURCES += posix/src/prwlocktryrdlock.c
librtemscpu_a_SOURCES += posix/src/prwlocktrywrlock.c
librtemscpu_a_SOURCES += posix/src/prwlockunlock.c
librtemscpu_a_SOURCES += posix/src/prwlockwrlock.c
+librtemscpu_a_SOURCES += posix/src/psignalconfig.c
librtemscpu_a_SOURCES += posix/src/pspindestroy.c
librtemscpu_a_SOURCES += posix/src/pspininit.c
librtemscpu_a_SOURCES += posix/src/pspinlock.c
librtemscpu_a_SOURCES += posix/src/pspinunlock.c
librtemscpu_a_SOURCES += posix/src/psxpriorityisvalid.c
+librtemscpu_a_SOURCES += posix/src/psxsemaphoreconfig.c
+librtemscpu_a_SOURCES += posix/src/psxtimerconfig.c
librtemscpu_a_SOURCES += posix/src/pthreadattrdefault.c
librtemscpu_a_SOURCES += posix/src/pthreadattrdestroy.c
librtemscpu_a_SOURCES += posix/src/pthreadattrgetaffinitynp.c
@@ -544,6 +548,7 @@ librtemscpu_a_SOURCES += posix/src/pthreadattrsetscope.c
librtemscpu_a_SOURCES += posix/src/pthreadattrsetstackaddr.c
librtemscpu_a_SOURCES += posix/src/pthreadattrsetstack.c
librtemscpu_a_SOURCES += posix/src/pthreadattrsetstacksize.c
+librtemscpu_a_SOURCES += posix/src/pthreadconfig.c
librtemscpu_a_SOURCES += posix/src/pthreadgetaffinitynp.c
librtemscpu_a_SOURCES += posix/src/pthreadgetnamenp.c
librtemscpu_a_SOURCES += posix/src/pthreadonce.c
@@ -570,6 +575,7 @@ librtemscpu_a_SOURCES += posix/src/semtrywait.c
librtemscpu_a_SOURCES += posix/src/semwait.c
librtemscpu_a_SOURCES += posix/src/setcancelstate.c
librtemscpu_a_SOURCES += posix/src/setcanceltype.c
+librtemscpu_a_SOURCES += posix/src/shmconfig.c
librtemscpu_a_SOURCES += posix/src/sigaddset.c
librtemscpu_a_SOURCES += posix/src/sigdelset.c
librtemscpu_a_SOURCES += posix/src/sigemptyset.c
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 2e183c78d9..56cce9643b 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -96,13 +96,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
extern rtems_multiprocessing_table Multiprocessing_configuration;
#endif
-#ifdef RTEMS_POSIX_API
- /**
- * This it the POSIX API configuration table.
- */
- extern posix_api_configuration_table Configuration_POSIX_API;
-#endif
-
/**
* This macro determines whether the RTEMS reentrancy support for
* the Newlib C Library is enabled.
@@ -2426,18 +2419,8 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
#define _CONFIGURE_MEMORY_FOR_POSIX_SHMS(_shms) \
_Configure_POSIX_Named_Object_RAM(_shms, sizeof(POSIX_Shm_Control) )
-
#ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
-
- #ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
-
- /*
- * The user is defining their own table information and setting the
- * appropriate variables for the POSIX Initialization Thread Table.
- */
-
- #else
-
+ #ifndef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
#ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
#define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT POSIX_Init
#endif
@@ -2449,35 +2432,28 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
#ifdef CONFIGURE_INIT
posix_initialization_threads_table POSIX_Initialization_threads[] = {
- { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT, \
- CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE }
+ { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT,
+ CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE }
};
#endif
#define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME \
- POSIX_Initialization_threads
+ POSIX_Initialization_threads
#define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \
- RTEMS_ARRAY_SIZE(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME)
-
- #endif /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */
-
- #else /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
-
+ RTEMS_ARRAY_SIZE(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME)
+ #endif /* !CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */
+ #else /* !CONFIGURE_POSIX_INIT_THREAD_TABLE */
#define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL
#define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0
-
- #endif
-
+ #endif /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
#else
-
/**
* This configuration parameter specifies the maximum number of
* POSIX API threads.
*/
#define CONFIGURE_MAXIMUM_POSIX_THREADS 0
-
-#endif /* RTEMS_POSIX_API */
+#endif /* RTEMS_POSIX_API */
/**
* This configuration parameter specifies the stack size of the
@@ -3006,25 +2982,46 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
CONFIGURE_INIT_TASK_TABLE
};
- #ifdef RTEMS_POSIX_API
- /**
- * This is the POSIX API Configuration Table.
- */
- posix_api_configuration_table Configuration_POSIX_API = {
- _CONFIGURE_POSIX_THREADS,
- CONFIGURE_MAXIMUM_POSIX_TIMERS,
- CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS,
- CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES,
- CONFIGURE_MAXIMUM_POSIX_SEMAPHORES,
- CONFIGURE_MAXIMUM_POSIX_SHMS,
- CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE,
- CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME
- };
+ #if CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES > 0
+ const uint32_t _Configuration_POSIX_Maximum_message_queues =
+ CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES;
+ #endif
+
+ #if CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS > 0
+ const uint32_t _Configuration_POSIX_Maximum_queued_signals =
+ CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS;
+ #endif
- const size_t _Configuration_POSIX_Minimum_stack_size =
- CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE;
+ #if CONFIGURE_MAXIMUM_POSIX_SEMAPHORES > 0
+ const uint32_t _Configuration_POSIX_Maximum_named_semaphores =
+ CONFIGURE_MAXIMUM_POSIX_SEMAPHORES;
#endif
+ #if CONFIGURE_MAXIMUM_POSIX_SHMS > 0
+ const uint32_t _Configuration_POSIX_Maximum_shms =
+ CONFIGURE_MAXIMUM_POSIX_SHMS;
+ #endif
+
+ #if CONFIGURE_MAXIMUM_POSIX_TIMERS > 0
+ const uint32_t _Configuration_POSIX_Maximum_timers =
+ CONFIGURE_MAXIMUM_POSIX_TIMERS;
+ #endif
+
+ #if _CONFIGURE_POSIX_THREADS > 0
+ const uint32_t _Configuration_POSIX_Maximum_threads =
+ _CONFIGURE_POSIX_THREADS;
+ #endif
+
+ posix_initialization_threads_table * const
+ _Configuration_POSIX_Initialization_threads =
+ CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME;
+
+ const size_t _Configuration_POSIX_Initialization_thread_count =
+ CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE;
+
+ const size_t _Configuration_POSIX_Minimum_stack_size =
+ CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE;
+
/**
* This variable specifies the minimum stack size for tasks in an RTEMS
* application.
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index 248ace0721..6fed38477a 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -44,19 +44,8 @@ extern "C" {
_Objects_Maximum_per_allocation(resource)
#include <rtems/score/watchdog.h>
-
-/*
- * This is kind of kludgy but it allows targets to totally ignore the
- * optional APIs like POSIX safely.
- */
-
-#ifdef RTEMS_POSIX_API
-#include <rtems/posix/config.h>
-#else
-typedef void *posix_api_configuration_table;
-#endif
-
#include <rtems/rtems/config.h>
+#include <rtems/posix/config.h>
#include <rtems/extension.h>
#if defined(RTEMS_MULTIPROCESSING)
diff --git a/cpukit/include/rtems/posix/config.h b/cpukit/include/rtems/posix/config.h
index e90dc27011..e6b5870ac7 100644
--- a/cpukit/include/rtems/posix/config.h
+++ b/cpukit/include/rtems/posix/config.h
@@ -46,70 +46,10 @@ typedef struct {
int stack_size;
} posix_initialization_threads_table;
-/**
- * The following records define the POSIX Configuration Table.
- * The information contained in this table is required in all
- * RTEMS systems which include POSIX threads support, whether
- * single or multiprocessor. This table primarily defines the
- * following:
- *
- * + required number of each object type
- */
-typedef struct {
- /**
- * This field contains the maximum number of POSIX API
- * threads which are configured for this application.
- */
- uint32_t maximum_threads;
-
- /**
- * This field contains the maximum number of POSIX API
- * timers which are configured for this application.
- */
- uint32_t maximum_timers;
-
- /**
- * This field contains the maximum number of POSIX API
- * queued signals which are configured for this application.
- */
- uint32_t maximum_queued_signals;
-
- /**
- * This field contains the maximum number of POSIX API
- * message queues which are configured for this application.
- */
- uint32_t maximum_message_queues;
+extern posix_initialization_threads_table * const
+ _Configuration_POSIX_Initialization_threads;
- /**
- * This field contains the maximum number of POSIX API
- * semaphores which are configured for this application.
- */
- uint32_t maximum_semaphores;
-
- /**
- * Maximum configured number of POSIX Shared memory objects.
- */
- uint32_t maximum_shms;
-
- /**
- * This field contains the number of POSIX API Initialization
- * threads listed in @a User_initialization_thread_table.
- */
- uint32_t number_of_initialization_threads;
-
- /**
- * This field contains the list of POSIX API Initialization threads.
- */
- posix_initialization_threads_table *User_initialization_threads_table;
-} posix_api_configuration_table;
-
-/**
- * @brief POSIX API configuration table.
- *
- * This is the POSIX API Configuration Table expected to be generated
- * by confdefs.h.
- */
-extern posix_api_configuration_table Configuration_POSIX_API;
+extern const size_t _Configuration_POSIX_Initialization_thread_count;
/**@}*/
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/posix/mqueue.h b/cpukit/include/rtems/posix/mqueue.h
index cdf94514af..6211c68783 100644
--- a/cpukit/include/rtems/posix/mqueue.h
+++ b/cpukit/include/rtems/posix/mqueue.h
@@ -61,6 +61,8 @@ typedef struct {
int oflag;
} POSIX_Message_queue_Control;
+extern const uint32_t _Configuration_POSIX_Maximum_message_queues;
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/posix/psignal.h b/cpukit/include/rtems/posix/psignal.h
index ed98442e32..52a9ec6caf 100644
--- a/cpukit/include/rtems/posix/psignal.h
+++ b/cpukit/include/rtems/posix/psignal.h
@@ -31,5 +31,7 @@ typedef struct {
siginfo_t Info;
} POSIX_signals_Siginfo_node;
+extern const uint32_t _Configuration_POSIX_Maximum_queued_signals;
+
#endif
/* end of file */
diff --git a/cpukit/include/rtems/posix/pthread.h b/cpukit/include/rtems/posix/pthread.h
index bf46253776..25bf40ef27 100644
--- a/cpukit/include/rtems/posix/pthread.h
+++ b/cpukit/include/rtems/posix/pthread.h
@@ -19,7 +19,6 @@
#ifndef _RTEMS_POSIX_PTHREAD_H
#define _RTEMS_POSIX_PTHREAD_H
-#include <rtems/posix/config.h>
#include <rtems/posix/threadsup.h>
#include <rtems/score/thread.h>
@@ -39,6 +38,8 @@ 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.
*
diff --git a/cpukit/include/rtems/posix/semaphore.h b/cpukit/include/rtems/posix/semaphore.h
index 9133db22be..734d8bb84b 100644
--- a/cpukit/include/rtems/posix/semaphore.h
+++ b/cpukit/include/rtems/posix/semaphore.h
@@ -46,6 +46,8 @@ typedef struct {
uint32_t open_count;
} POSIX_Semaphore_Control;
+extern const uint32_t _Configuration_POSIX_Maximum_named_semaphores;
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/posix/shm.h b/cpukit/include/rtems/posix/shm.h
index d2b6036493..310af6692b 100644
--- a/cpukit/include/rtems/posix/shm.h
+++ b/cpukit/include/rtems/posix/shm.h
@@ -18,6 +18,8 @@
#include <rtems/score/object.h>
#include <rtems/score/threadq.h>
+#include <sys/types.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -124,6 +126,8 @@ typedef struct {
time_t ctime;
} POSIX_Shm_Control;
+extern const uint32_t _Configuration_POSIX_Maximum_shms;
+
/**
* @brief object_create operation for shm objects stored in RTEMS Workspace.
*/
diff --git a/cpukit/include/rtems/posix/timer.h b/cpukit/include/rtems/posix/timer.h
index 79fe093219..52732af991 100644
--- a/cpukit/include/rtems/posix/timer.h
+++ b/cpukit/include/rtems/posix/timer.h
@@ -50,6 +50,8 @@ typedef struct {
struct timespec time; /* Time at which the timer was started */
} POSIX_Timer_Control;
+extern const uint32_t _Configuration_POSIX_Maximum_timers;
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/posix/src/mqueue.c b/cpukit/posix/src/mqueue.c
index 2ad90c1e79..e2c9b5f2b2 100644
--- a/cpukit/posix/src/mqueue.c
+++ b/cpukit/posix/src/mqueue.c
@@ -51,8 +51,7 @@ static void _POSIX_Message_queue_Manager_initialization(void)
&_POSIX_Message_queue_Information, /* object information table */
OBJECTS_POSIX_API, /* object API */
OBJECTS_POSIX_MESSAGE_QUEUES, /* object class */
- Configuration_POSIX_API.maximum_message_queues,
- /* maximum objects of this class */
+ _Configuration_POSIX_Maximum_message_queues,
sizeof( POSIX_Message_queue_Control ),
/* size of this object's control block */
true, /* true if names for this object are strings */
diff --git a/cpukit/posix/src/mqueueconfig.c b/cpukit/posix/src/mqueueconfig.c
new file mode 100644
index 0000000000..921fb73772
--- /dev/null
+++ b/cpukit/posix/src/mqueueconfig.c
@@ -0,0 +1,34 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright 2018, embedded brains GmbH <rtems at embedded-brains.de>
+ *
+ * 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 AUTHOR 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 AUTHOR 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/mqueue.h>
+
+const uint32_t _Configuration_POSIX_Maximum_message_queues;
diff --git a/cpukit/posix/src/psignal.c b/cpukit/posix/src/psignal.c
index 3e887a8ed0..0d61a1d737 100644
--- a/cpukit/posix/src/psignal.c
+++ b/cpukit/posix/src/psignal.c
@@ -103,7 +103,7 @@ static void _POSIX_signals_Manager_Initialization(void)
uint32_t signo;
uint32_t maximum_queued_signals;
- maximum_queued_signals = Configuration_POSIX_API.maximum_queued_signals;
+ maximum_queued_signals = _Configuration_POSIX_Maximum_queued_signals;
memcpy(
_POSIX_signals_Vectors,
diff --git a/cpukit/posix/src/psignalconfig.c b/cpukit/posix/src/psignalconfig.c
new file mode 100644
index 0000000000..0840d94b16
--- /dev/null
+++ b/cpukit/posix/src/psignalconfig.c
@@ -0,0 +1,34 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright 2018, embedded brains GmbH <rtems at embedded-brains.de>
+ *
+ * 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 AUTHOR 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 AUTHOR 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/psignal.h>
+
+const uint32_t _Configuration_POSIX_Maximum_queued_signals;
diff --git a/cpukit/posix/src/psxsemaphore.c b/cpukit/posix/src/psxsemaphore.c
index a82ad17966..9e259b8ea3 100644
--- a/cpukit/posix/src/psxsemaphore.c
+++ b/cpukit/posix/src/psxsemaphore.c
@@ -42,8 +42,7 @@ static void _POSIX_Semaphore_Manager_initialization(void)
&_POSIX_Semaphore_Information, /* object information table */
OBJECTS_POSIX_API, /* object API */
OBJECTS_POSIX_SEMAPHORES, /* object class */
- Configuration_POSIX_API.maximum_semaphores,
- /* maximum objects of this class */
+ _Configuration_POSIX_Maximum_named_semaphores,
sizeof( POSIX_Semaphore_Control ),
/* size of this object's control block */
true, /* true if names for this object are strings */
diff --git a/cpukit/posix/src/psxsemaphoreconfig.c b/cpukit/posix/src/psxsemaphoreconfig.c
new file mode 100644
index 0000000000..7e29742537
--- /dev/null
+++ b/cpukit/posix/src/psxsemaphoreconfig.c
@@ -0,0 +1,34 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright 2018, embedded brains GmbH <rtems at embedded-brains.de>
+ *
+ * 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 AUTHOR 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 AUTHOR 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/semaphore.h>
+
+const uint32_t _Configuration_POSIX_Maximum_named_semaphores;
diff --git a/cpukit/posix/src/psxtimerconfig.c b/cpukit/posix/src/psxtimerconfig.c
new file mode 100644
index 0000000000..2781a8cec5
--- /dev/null
+++ b/cpukit/posix/src/psxtimerconfig.c
@@ -0,0 +1,34 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright 2018, embedded brains GmbH <rtems at embedded-brains.de>
+ *
+ * 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 AUTHOR 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 AUTHOR 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/timer.h>
+
+const uint32_t _Configuration_POSIX_Maximum_timers;
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
index e05d4f3d19..9cfc65f578 100644
--- a/cpukit/posix/src/pthread.c
+++ b/cpukit/posix/src/pthread.c
@@ -181,8 +181,7 @@ static void _POSIX_Threads_Manager_initialization(void)
&_POSIX_Threads_Information, /* object information table */
OBJECTS_POSIX_API, /* object API */
OBJECTS_POSIX_THREADS, /* object class */
- Configuration_POSIX_API.maximum_threads,
- /* maximum objects of this class */
+ _Configuration_POSIX_Maximum_threads,
true, /* true if names for this object are strings */
_POSIX_PATH_MAX /* maximum length of each object's name */
);
diff --git a/cpukit/posix/src/pthreadconfig.c b/cpukit/posix/src/pthreadconfig.c
new file mode 100644
index 0000000000..75683c3c6e
--- /dev/null
+++ b/cpukit/posix/src/pthreadconfig.c
@@ -0,0 +1,34 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright 2018, embedded brains GmbH <rtems at embedded-brains.de>
+ *
+ * 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 AUTHOR 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 AUTHOR 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/pthread.h>
+
+const uint32_t _Configuration_POSIX_Maximum_threads;
diff --git a/cpukit/posix/src/pthreadinitthreads.c b/cpukit/posix/src/pthreadinitthreads.c
index 15c6b9fbf9..97ae5df70a 100644
--- a/cpukit/posix/src/pthreadinitthreads.c
+++ b/cpukit/posix/src/pthreadinitthreads.c
@@ -41,8 +41,8 @@ void _POSIX_Threads_Initialize_user_threads_body(void)
pthread_t thread_id;
pthread_attr_t attr;
- user_threads = Configuration_POSIX_API.User_initialization_threads_table;
- maximum = Configuration_POSIX_API.number_of_initialization_threads;
+ user_threads = _Configuration_POSIX_Initialization_threads;
+ maximum = _Configuration_POSIX_Initialization_thread_count;
if ( !user_threads )
return;
diff --git a/cpukit/posix/src/ptimer.c b/cpukit/posix/src/ptimer.c
index de3645cc14..73517abbfe 100644
--- a/cpukit/posix/src/ptimer.c
+++ b/cpukit/posix/src/ptimer.c
@@ -62,8 +62,7 @@ static void _POSIX_Timer_Manager_initialization(void)
&_POSIX_Timer_Information, /* object information table */
OBJECTS_POSIX_API, /* object API */
OBJECTS_POSIX_TIMERS, /* object class */
- Configuration_POSIX_API.maximum_timers,
- /* maximum objects of this class */
+ _Configuration_POSIX_Maximum_timers,
sizeof( POSIX_Timer_Control ),
/* size of this object's control block */
true, /* true if names for this object are strings */
diff --git a/cpukit/posix/src/shm.c b/cpukit/posix/src/shm.c
index d76b5b8569..131aa1384b 100644
--- a/cpukit/posix/src/shm.c
+++ b/cpukit/posix/src/shm.c
@@ -32,8 +32,7 @@ static void _POSIX_Shm_Manager_initialization( void )
&_POSIX_Shm_Information, /* object information table */
OBJECTS_POSIX_API, /* object API */
OBJECTS_POSIX_SHMS, /* object class */
- Configuration_POSIX_API.maximum_shms,
- /* maximum objects of this class */
+ _Configuration_POSIX_Maximum_shms,
sizeof( POSIX_Shm_Control ),
/* size of this object's control block */
true, /* true if names for this object are strings */
diff --git a/cpukit/posix/src/shmconfig.c b/cpukit/posix/src/shmconfig.c
new file mode 100644
index 0000000000..e03f4e8be5
--- /dev/null
+++ b/cpukit/posix/src/shmconfig.c
@@ -0,0 +1,34 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright 2018, embedded brains GmbH <rtems at embedded-brains.de>
+ *
+ * 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 AUTHOR 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 AUTHOR 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/shm.h>
+
+const uint32_t _Configuration_POSIX_Maximum_shms;
diff --git a/cpukit/score/src/wkspace.c b/cpukit/score/src/wkspace.c
index ea2ab84849..2657ba0dda 100644
--- a/cpukit/score/src/wkspace.c
+++ b/cpukit/score/src/wkspace.c
@@ -25,6 +25,7 @@
#include <rtems/score/percpudata.h>
#include <rtems/score/threadimpl.h>
#include <rtems/score/tls.h>
+#include <rtems/posix/pthread.h>
#include <rtems/config.h>
#include <string.h>
@@ -54,7 +55,7 @@ static uint32_t _Workspace_Get_maximum_thread_count( void )
#if defined(RTEMS_POSIX_API)
thread_count += rtems_resource_maximum_per_allocation(
- Configuration_POSIX_API.maximum_threads
+ _Configuration_POSIX_Maximum_threads
);
#endif
--
2.16.4
More information about the devel
mailing list