summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/confdefs.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-02-19 14:14:46 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-02-25 07:18:37 +0100
commit591e973662d6abf027c054bc5ed4eb16c964c92c (patch)
tree509110e24841ae708f39c81e5d5052831f7537d5 /cpukit/include/rtems/confdefs.h
parentconfig: Add <rtems/confdefs/libio.h> (diff)
downloadrtems-591e973662d6abf027c054bc5ed4eb16c964c92c.tar.bz2
config: Add <rtems/confdefs/scheduler.h>
Remove all comments and copyrightable content from the moved content. Use BSD-2-Clause license for new file. Update #3053. Update #3875.
Diffstat (limited to 'cpukit/include/rtems/confdefs.h')
-rw-r--r--cpukit/include/rtems/confdefs.h453
1 files changed, 1 insertions, 452 deletions
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index a51693834b..ba37f0abe7 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -53,6 +53,7 @@
#include <rtems/confdefs/libio.h>
#include <rtems/confdefs/libpci.h>
#include <rtems/confdefs/percpu.h>
+#include <rtems/confdefs/scheduler.h>
#include <limits.h>
@@ -102,441 +103,6 @@ extern "C" {
#endif
/**
- * @brief Maximum priority configuration.
- *
- * This configures the maximum priority value that
- * a task may have.
- *
- * The following applies to the data space requirements
- * of the Priority Scheduler.
- *
- * By reducing the number of priorities in a system,
- * the amount of RAM required by RTEMS can be significantly
- * reduced. RTEMS allocates a Chain_Control structure per
- * priority and this structure contains 3 pointers. So
- * the default is (256 * 12) = 3K on 32-bit architectures.
- *
- * This must be one less than a power of 2 between
- * 4 and 256. Valid values along with the application
- * priority levels and memory saved when pointers are
- * 32-bits in size are:
- *
- * + 3, 2 application priorities, 3024 bytes saved
- * + 7, 5 application priorities, 2976 bytes saved
- * + 15, 13 application priorities, 2880 bytes saved
- * + 31, 29 application priorities, 2688 bytes saved
- * + 63, 61 application priorities, 2304 bytes saved
- * + 127, 125 application priorities, 1536 bytes saved
- * + 255, 253 application priorities, 0 bytes saved
- *
- * It is specified in terms of Classic API priority values.
- */
-#ifndef CONFIGURE_MAXIMUM_PRIORITY
- #define CONFIGURE_MAXIMUM_PRIORITY PRIORITY_DEFAULT_MAXIMUM
-#endif
-
-/**
- * @defgroup ConfigScheduler Scheduler configuration
- *
- * @ingroup Configuration
- *
- * The scheduler configuration allows an application to select the
- * scheduling policy to use. The supported configurations are:
- *
- * - CONFIGURE_SCHEDULER_PRIORITY - Deterministic Priority Scheduler
- * - CONFIGURE_SCHEDULER_PRIORITY_SMP - Deterministic Priority SMP Scheduler
- * - CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP - Deterministic
- * Priority SMP Affinity Scheduler
- * - CONFIGURE_SCHEDULER_STRONG_APA - Strong APA Scheduler
- * - CONFIGURE_SCHEDULER_SIMPLE - Light-weight Priority Scheduler
- * - CONFIGURE_SCHEDULER_SIMPLE_SMP - Simple SMP Priority Scheduler
- * - CONFIGURE_SCHEDULER_EDF - EDF Scheduler
- * - CONFIGURE_SCHEDULER_EDF_SMP - EDF SMP Scheduler
- * - CONFIGURE_SCHEDULER_CBS - CBS Scheduler
- * - CONFIGURE_SCHEDULER_USER - user provided scheduler
- *
- * If no configuration is specified by the application in a uniprocessor
- * configuration, then CONFIGURE_SCHEDULER_PRIORITY is the default.
- *
- * If no configuration is specified by the application in SMP
- * configuration, then CONFIGURE_SCHEDULER_PRIORITY_SMP is the default.
- *
- * An application can define its own scheduling policy by defining
- * CONFIGURE_SCHEDULER_USER and the following:
- *
- * - CONFIGURE_SCHEDULER
- * - CONFIGURE_SCHEDULER_TABLE_ENTRIES
- * - CONFIGURE_SCHEDULER_USER_PER_THREAD
- */
-
-#if !defined(CONFIGURE_SCHEDULER_USER) && \
- !defined(CONFIGURE_SCHEDULER_PRIORITY) && \
- !defined(CONFIGURE_SCHEDULER_PRIORITY_SMP) && \
- !defined(CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP) && \
- !defined(CONFIGURE_SCHEDULER_STRONG_APA) && \
- !defined(CONFIGURE_SCHEDULER_SIMPLE) && \
- !defined(CONFIGURE_SCHEDULER_SIMPLE_SMP) && \
- !defined(CONFIGURE_SCHEDULER_EDF) && \
- !defined(CONFIGURE_SCHEDULER_EDF_SMP) && \
- !defined(CONFIGURE_SCHEDULER_CBS)
- #if defined(RTEMS_SMP) && _CONFIGURE_MAXIMUM_PROCESSORS > 1
- /**
- * If no scheduler is specified in an SMP configuration, the
- * EDF scheduler is default.
- */
- #define CONFIGURE_SCHEDULER_EDF_SMP
- #else
- /**
- * If no scheduler is specified in a uniprocessor configuration, the
- * priority scheduler is default.
- */
- #define CONFIGURE_SCHEDULER_PRIORITY
- #endif
-#endif
-
-#include <rtems/scheduler.h>
-
-/*
- * If the Priority Scheduler is selected, then configure for it.
- */
-#if defined(CONFIGURE_SCHEDULER_PRIORITY)
- #if !defined(CONFIGURE_SCHEDULER_NAME)
- /** Configure the name of the scheduler instance */
- #define CONFIGURE_SCHEDULER_NAME rtems_build_name('U', 'P', 'D', ' ')
- #endif
-
- #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
- /** Configure the context needed by the scheduler instance */
- #define CONFIGURE_SCHEDULER \
- RTEMS_SCHEDULER_PRIORITY( \
- dflt, \
- CONFIGURE_MAXIMUM_PRIORITY + 1 \
- )
-
- /** Configure the controls for this scheduler instance */
- #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
- RTEMS_SCHEDULER_TABLE_PRIORITY(dflt, CONFIGURE_SCHEDULER_NAME)
- #endif
-#endif
-
-/*
- * If the Deterministic Priority SMP Scheduler is selected, then configure for
- * it.
- */
-#if defined(CONFIGURE_SCHEDULER_PRIORITY_SMP)
- #if !defined(CONFIGURE_SCHEDULER_NAME)
- /** Configure the name of the scheduler instance */
- #define CONFIGURE_SCHEDULER_NAME rtems_build_name('M', 'P', 'D', ' ')
- #endif
-
- #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
- /** Configure the context needed by the scheduler instance */
- #define CONFIGURE_SCHEDULER \
- RTEMS_SCHEDULER_PRIORITY_SMP( \
- dflt, \
- CONFIGURE_MAXIMUM_PRIORITY + 1 \
- )
-
- /** Configure the controls for this scheduler instance */
- #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
- RTEMS_SCHEDULER_TABLE_PRIORITY_SMP(dflt, CONFIGURE_SCHEDULER_NAME)
- #endif
-#endif
-
-/*
- * If the Deterministic Priority Affinity SMP Scheduler is selected, then configure for
- * it.
- */
-#if defined(CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP)
- #if !defined(CONFIGURE_SCHEDULER_NAME)
- /** Configure the name of the scheduler instance */
- #define CONFIGURE_SCHEDULER_NAME rtems_build_name('M', 'P', 'A', ' ')
- #endif
-
- #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
- /** Configure the context needed by the scheduler instance */
- #define CONFIGURE_SCHEDULER \
- RTEMS_SCHEDULER_PRIORITY_AFFINITY_SMP( \
- dflt, \
- CONFIGURE_MAXIMUM_PRIORITY + 1 \
- )
-
- /** Configure the controls for this scheduler instance */
- #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
- RTEMS_SCHEDULER_TABLE_PRIORITY_AFFINITY_SMP( \
- dflt, \
- CONFIGURE_SCHEDULER_NAME \
- )
- #endif
-#endif
-
-/*
- * If the Strong APA Scheduler is selected, then configure for
- * it.
- */
-#if defined(CONFIGURE_SCHEDULER_STRONG_APA)
- #if !defined(CONFIGURE_SCHEDULER_NAME)
- /** Configure the name of the scheduler instance */
- #define CONFIGURE_SCHEDULER_NAME rtems_build_name('M', 'A', 'P', 'A')
- #endif
-
- #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
- /** Configure the context needed by the scheduler instance */
- #define CONFIGURE_SCHEDULER \
- RTEMS_SCHEDULER_STRONG_APA( \
- dflt, \
- CONFIGURE_MAXIMUM_PRIORITY + 1 \
- )
-
- /** Configure the controls for this scheduler instance */
- #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
- RTEMS_SCHEDULER_TABLE_STRONG_APA(dflt, CONFIGURE_SCHEDULER_NAME)
- #endif
-#endif
-
-/*
- * If the Simple Priority Scheduler is selected, then configure for it.
- */
-#if defined(CONFIGURE_SCHEDULER_SIMPLE)
- #if !defined(CONFIGURE_SCHEDULER_NAME)
- /** Configure the name of the scheduler instance */
- #define CONFIGURE_SCHEDULER_NAME rtems_build_name('U', 'P', 'S', ' ')
- #endif
-
- #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
- /** Configure the context needed by the scheduler instance */
- #define CONFIGURE_SCHEDULER RTEMS_SCHEDULER_SIMPLE(dflt)
-
- /** Configure the controls for this scheduler instance */
- #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
- RTEMS_SCHEDULER_TABLE_SIMPLE(dflt, CONFIGURE_SCHEDULER_NAME)
- #endif
-#endif
-
-/*
- * If the Simple SMP Priority Scheduler is selected, then configure for it.
- */
-#if defined(CONFIGURE_SCHEDULER_SIMPLE_SMP)
- #if !defined(CONFIGURE_SCHEDULER_NAME)
- /** Configure the name of the scheduler instance */
- #define CONFIGURE_SCHEDULER_NAME rtems_build_name('M', 'P', 'S', ' ')
- #endif
-
- #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
- /** Configure the context needed by the scheduler instance */
- #define CONFIGURE_SCHEDULER \
- RTEMS_SCHEDULER_SIMPLE_SMP(dflt)
-
- /** Configure the controls for this scheduler instance */
- #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
- RTEMS_SCHEDULER_TABLE_SIMPLE_SMP(dflt, CONFIGURE_SCHEDULER_NAME)
- #endif
-#endif
-
-/*
- * If the EDF Scheduler is selected, then configure for it.
- */
-#if defined(CONFIGURE_SCHEDULER_EDF)
- #if !defined(CONFIGURE_SCHEDULER_NAME)
- /** Configure the name of the scheduler instance */
- #define CONFIGURE_SCHEDULER_NAME rtems_build_name('U', 'E', 'D', 'F')
- #endif
-
- #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
- /** Configure the context needed by the scheduler instance */
- #define CONFIGURE_SCHEDULER RTEMS_SCHEDULER_EDF(dflt)
-
- /** Configure the controls for this scheduler instance */
- #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
- RTEMS_SCHEDULER_TABLE_EDF(dflt, CONFIGURE_SCHEDULER_NAME)
- #endif
-#endif
-
-/*
- * If the EDF SMP Scheduler is selected, then configure for it.
- */
-#if defined(CONFIGURE_SCHEDULER_EDF_SMP)
- #if !defined(CONFIGURE_SCHEDULER_NAME)
- /** Configure the name of the scheduler instance */
- #define CONFIGURE_SCHEDULER_NAME rtems_build_name('M', 'E', 'D', 'F')
- #endif
-
- #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
- /** Configure the context needed by the scheduler instance */
- #define CONFIGURE_SCHEDULER RTEMS_SCHEDULER_EDF_SMP(dflt)
-
- /** Configure the controls for this scheduler instance */
- #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
- RTEMS_SCHEDULER_TABLE_EDF_SMP(dflt, CONFIGURE_SCHEDULER_NAME)
- #endif
-#endif
-
-/*
- * If the CBS Scheduler is selected, then configure for it.
- */
-#if defined(CONFIGURE_SCHEDULER_CBS)
- #if !defined(CONFIGURE_SCHEDULER_NAME)
- /** Configure the name of the scheduler instance */
- #define CONFIGURE_SCHEDULER_NAME rtems_build_name('U', 'C', 'B', 'S')
- #endif
-
- #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
- /** Configure the context needed by the scheduler instance */
- #define CONFIGURE_SCHEDULER RTEMS_SCHEDULER_CBS(dflt)
-
- /** Configure the controls for this scheduler instance */
- #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
- RTEMS_SCHEDULER_TABLE_CBS(dflt, CONFIGURE_SCHEDULER_NAME)
- #endif
-
- #ifndef CONFIGURE_CBS_MAXIMUM_SERVERS
- #define CONFIGURE_CBS_MAXIMUM_SERVERS CONFIGURE_MAXIMUM_TASKS
- #endif
-
- #ifdef CONFIGURE_INIT
- const uint32_t _Scheduler_CBS_Maximum_servers =
- CONFIGURE_CBS_MAXIMUM_SERVERS;
-
- Scheduler_CBS_Server
- _Scheduler_CBS_Server_list[ CONFIGURE_CBS_MAXIMUM_SERVERS ];
- #endif
-#endif
-
-/*
- * Set up the scheduler entry points table. The scheduling code uses
- * this code to know which scheduler is configured by the user.
- */
-#ifdef CONFIGURE_INIT
- #if defined(CONFIGURE_SCHEDULER)
- CONFIGURE_SCHEDULER;
- #endif
-
- const Scheduler_Control _Scheduler_Table[] = {
- CONFIGURE_SCHEDULER_TABLE_ENTRIES
- };
-
- #define _CONFIGURE_SCHEDULER_COUNT RTEMS_ARRAY_SIZE( _Scheduler_Table )
-
- #if defined(RTEMS_SMP)
- const size_t _Scheduler_Count = _CONFIGURE_SCHEDULER_COUNT;
-
- const Scheduler_Assignment _Scheduler_Initial_assignments[] = {
- #if defined(CONFIGURE_SCHEDULER_ASSIGNMENTS)
- CONFIGURE_SCHEDULER_ASSIGNMENTS
- #else
- #define _CONFIGURE_SCHEDULER_ASSIGN \
- RTEMS_SCHEDULER_ASSIGN( \
- 0, \
- RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL \
- )
- _CONFIGURE_SCHEDULER_ASSIGN
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 2
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 3
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 4
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 5
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 6
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 7
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 8
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 9
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 10
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 11
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 12
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 13
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 14
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 15
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 16
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 17
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 18
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 19
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 20
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 21
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 22
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 23
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 24
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 25
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 26
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 27
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 28
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 29
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 30
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 31
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #if _CONFIGURE_MAXIMUM_PROCESSORS >= 32
- , _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- #undef _CONFIGURE_SCHEDULER_ASSIGN
- #endif
- };
-
- RTEMS_STATIC_ASSERT(
- _CONFIGURE_MAXIMUM_PROCESSORS
- == RTEMS_ARRAY_SIZE( _Scheduler_Initial_assignments ),
- _Scheduler_Initial_assignments
- );
- #endif
-#endif
-/**@}*/ /* end of Scheduler Configuration */
-
-/**
* @defgroup ConfigurationMalloc RTEMS Malloc configuration
*
* This module contains parameters related to configuration of the RTEMS
@@ -2130,23 +1696,6 @@ struct _reent *__getreent(void)
#endif /* !defined(RTEMS_SCHEDSIM) */
/*
- * Validate the configured maximum priority
- */
-#if ((CONFIGURE_MAXIMUM_PRIORITY != 3) && \
- (CONFIGURE_MAXIMUM_PRIORITY != 7) && \
- (CONFIGURE_MAXIMUM_PRIORITY != 15) && \
- (CONFIGURE_MAXIMUM_PRIORITY != 31) && \
- (CONFIGURE_MAXIMUM_PRIORITY != 63) && \
- (CONFIGURE_MAXIMUM_PRIORITY != 127) && \
- (CONFIGURE_MAXIMUM_PRIORITY != 255))
- #error "Maximum priority is not 1 less than a power of 2 between 4 and 256"
-#endif
-
-#if (CONFIGURE_MAXIMUM_PRIORITY > PRIORITY_DEFAULT_MAXIMUM)
- #error "Maximum priority configured higher than supported by target."
-#endif
-
-/*
* POSIX Key pair shouldn't be less than POSIX Key, which is highly
* likely to be error.
*/