Re: SPDX License Identifier Only and Full Copy?

2020-02-21 Thread Thomas Doerfler
Hello,

I think the GPL and the BSD licenses had a different approach from the
start:
- GPL always came with a separate "COPYING" file (and the GPL sources
pointed to it)
- BSD always/most of the times was included in the headers

Lokking at how the linux kernel team handles this therefore only has a
limited weight. So I tend to keep the BSD license text in the source
code files.

Keep in mind: We want to make sure the license topic is properly handled
and clear. What is the harm to be conservative here and spend some extra
lines of header in the files?

Kind regards,
Thomas.

Am 21.02.20 um 02:15 schrieb Chris Johns:
> 
> 
> On 21/2/20 12:11 pm, Joel Sherrill wrote:
>>
>>
>> On Thu, Feb 20, 2020, 3:49 PM Chris Johns > > wrote:
>>
>> On 21/2/20 3:20 am, Gedare Bloom wrote:
>> > On Thu, Feb 20, 2020 at 12:58 AM Thomas Doerfler
>> > > > wrote:
>> >>
>> >> Hello,
>> >>
>> >> I just want to speak up here. I talked with Sebastian today and I 
>> really
>> >> tend to keep the license text in each file.
>> >>
>> >> Rational:
>> >>
>> >> - With the BSD license, anyone can pick any file from the RTEMS repo 
>> and
>> >> use/modify it in any project (and this is fine). The original authors
>> >> (and their copyright) are listed in the file, but the only pointer to
>> >> the legal part is the "SPDX identifier". I am not sure whether this 
>> is a
>> >> legally binding "tag" and whether this tag is clear to any user.
>> >>
>> >> - Strictly seen, it is not even forbidden to remove the "SPDX
>> >> identifier", because it is not part of the BSD-2-clause-license, it's
>> >> just a pointer to it. In the end we might result in code drifting 
>> around
>> >> without license information, which we all do not want to see.
>> >>
>> > This is a valid point. I also have no desire to be a lawyer.
>> >
>> > My intuition here is that, even without any licensing information at
>> > all in individual files, one can still apply a single license to an
>> > entire repository, e.g., BSD or GPL. For historical reasons, and
>> > similar arguments as you've made, BSD-style licenses have tended to be
>> > copy-pasted to individual files to make them easier to excerpt. We
>> > don't have license uniformity, so we do need to individually specify
>> > which license(s) apply to each file.
>>
>> This makes sense. The simplified BSD license states ...
>>
>>  1. Redistributions of source code must retain the above copyright
>>     notice, this list of conditions and the following disclaimer.
>>
>> I do not see how we can centralise this and have the "above copyright" 
>> work?
>> Also the SPDX site here ...
>>
>>  https://spdx.org/ids-how
>>
>> ... under the heading "Standard license headers" states ...
>>
>>  When a license defines a recommended notice to attach to files
>>  under that license (sometimes called a "standard header"), the SPDX
>>  project recommends that the standard header be included in the files,
>>  in addition to an SPDX ID.
>>
>> My reading of this means we should include the license in the source.
>>
>> We need to consider compliance and machine auditing of the source. The 
>> SPDX tag
>> is important. Maybe ...
>>
>> /*
>>  * SPDX tag suff
>>  */
>> /*
>>  * Copyright stuff
>>  *
>>  * 2-Clause BSD license
>>  */
>>
>> > Linux follows a similar philosophy as Sebastian suggests. I think we
>> > can also follow Linux in this regards.
>> > https://www.kernel.org/doc/html/latest/process/license-rules.html
>> >
>> > I would suggest we follow their approach to self-document the licenses
>> > centrally. I suspect the risk of someone using code without adhering
>> > to the license is no greater. Probably they have a higher risk
>> > exposure than we do!
>>
>> I agree with the comments in the Linux license rules text about license 
>> text in
>> files making it harder to check for compliance.
>>
>>
>> Following Linux is probably a safe approach. I assume there was significant
>> legal review of their policy.
> 
> Does the Linux kernel rules apply to the 2 clause BSD license we have?
> 
> Chris
> 

-- 

embedded brains GmbH
Thomas Doerfler
Dornierstr. 4
D-82178 Puchheim
Germany
email: thomas.doerf...@embedded-brains.de
Phone: +49-89-18 94 741-12
Fax:   +49-89-18 94 741-09
PGP: Public key available on request.
For our privacy statement, see
https://embedded-brains.de/en/data-privacy-statement/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH] c-user: Clarify filesystem configuration

2020-02-21 Thread Sebastian Huber
Update #3875.
---
 c-user/configuring_a_system.rst | 45 ++---
 1 file changed, 42 insertions(+), 3 deletions(-)

diff --git a/c-user/configuring_a_system.rst b/c-user/configuring_a_system.rst
index 5deabd7..230d6b6 100644
--- a/c-user/configuring_a_system.rst
+++ b/c-user/configuring_a_system.rst
@@ -2124,10 +2124,49 @@ NOTES:
  500, sizeof(other_message_type) \
  )
 
-File System Configuration Parameters
-
+Filesystem Configuration
+
 
-This section defines File System related configuration parameters.
+By default, the In-Memory Filesystem (IMFS) is used as the base filesystem 
(also
+known as root filesystem).  In order to save some memory for your application,
+you can disable the filesystem support with the
+:ref:`CONFIGURE_APPLICATION_DISABLE_FILESYSTEM` configuration option.
+Alternatively, you can strip down the features of the base filesystem with the
+:ref:`CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM` and
+:ref:`CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM` configuration options.  These
+three configuration options are mutually exclusive.  They are intended for an
+advanced application configuration.
+
+Features of the IMFS can be disabled and enabled with the following
+configuration options:
+
+* :ref:`CONFIGURE_IMFS_DISABLE_CHMOD`
+
+* :ref:`CONFIGURE_IMFS_DISABLE_CHOWN`
+
+* :ref:`CONFIGURE_IMFS_DISABLE_LINK`
+
+* :ref:`CONFIGURE_IMFS_DISABLE_MKNOD`
+
+* :ref:`CONFIGURE_IMFS_DISABLE_MKNOD_FILE`
+
+* :ref:`CONFIGURE_IMFS_DISABLE_MOUNT`
+
+* :ref:`CONFIGURE_IMFS_DISABLE_READDIR`
+
+* :ref:`CONFIGURE_IMFS_DISABLE_READLINK`
+
+* :ref:`CONFIGURE_IMFS_DISABLE_RENAME`
+
+* :ref:`CONFIGURE_IMFS_DISABLE_RMNOD`
+
+* :ref:`CONFIGURE_IMFS_DISABLE_SYMLINK`
+
+* :ref:`CONFIGURE_IMFS_DISABLE_UNMOUNT`
+
+* :ref:`CONFIGURE_IMFS_DISABLE_UTIME`
+
+* :ref:`CONFIGURE_IMFS_ENABLE_MKFIFO`
 
 .. index:: CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
 
-- 
2.16.4

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 03/44] rtems: Simplify _RTEMS_tasks_Initialize_user_task()

2020-02-21 Thread Sebastian Huber
Due to the system initialization order, the _Thread_Global_constructor
must be 0 in this function.
---
 cpukit/rtems/src/taskinitusers.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/cpukit/rtems/src/taskinitusers.c b/cpukit/rtems/src/taskinitusers.c
index 0645de324a..3f913b8484 100644
--- a/cpukit/rtems/src/taskinitusers.c
+++ b/cpukit/rtems/src/taskinitusers.c
@@ -56,7 +56,6 @@ void _RTEMS_tasks_Initialize_user_task( void )
   _Assert( rtems_is_status_successful( return_value ) );
   (void) return_value;
 
-  if ( _Thread_Global_constructor == 0 ) {
-_Thread_Global_constructor = id;
-  }
+  _Assert( _Thread_Global_constructor == 0 );
+  _Thread_Global_constructor = id;
 }
-- 
2.16.4

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 00/44] Split up confdefs.h

2020-02-21 Thread Sebastian Huber
This patch set splits up confdefs.h into component based header files.  See
also:

https://devel.rtems.org/ticket/3875

The goal is to make the 3000 LOC header file confdefs.h easier to review.  The
configuration header files are located in .

This patch set removes also the configuration options
CONFIGURE_HAS_OWN_INIT_TASK_TABLE, CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE,
and CONFIGURE_DISABLE_SMP_CONFIGURATION to simplify the configuration.

Please note that staring with the "config: Improve _Configure_From_workspace()"
there are no changes in the test suite.

I changed the license of the contents to BSD-2-Clause (except
) according to the file history and through a removal
of comments and other copyrightable content.

The new configuration header files are self-contained, e.g. the includes in
confdefs.h can be arbitrarily ordered.  They include all dependencies
explicitly.  I entangled the evaluation of the configuration options so that
there are no cyclic dependencies.

Sebastian Huber (44):
  config: Remove CONFIGURE_HAS_OWN_INIT_TASK_TABLE
  config: Simplify initialization task config
  rtems: Simplify _RTEMS_tasks_Initialize_user_task()
  config: Bring back RTEMS 4.11 configuration table
  config: Remove CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
  config: Add _Watchdog_Microseconds_per_tick
  config: Add _Watchdog_Ticks_per_timeslice
  config: Add _Thread_Idle_stack_size
  config: Add _Thread_Idle_body
  config: Add _Workspace_Size
  config: Add _Workspace_Is_unified
  config: Add _SMP_Processor_configure_maximum
  config: Add _SMP_Is_enabled
  libio: Add POSIX user environment to TCB
  score: Add _SMP_Need_inter_processor_interrupts()
  bsps/clock: Use _SMP_Get_processor_maximum()
  config: CONFIGURE_INIT_TASK_INITIAL_MODES
  score: _Scheduler_Is_non_preempt_mode_supported()
  rtems: Change timer server task mode setting
  config: Remove CONFIGURE_DISABLE_SMP_CONFIGURATION
  config: Improve _Configure_From_workspace()
  config: Remove _Configure_Max_Objects()
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 
  config: Add 

 bsps/shared/dev/clock/clockimpl.h  |2 +-
 cpukit/Makefile.am |7 +
 cpukit/header-dirs.am  |2 +
 cpukit/headers.am  |   25 +-
 cpukit/include/rtems/confdefs.h| 3120 +---
 cpukit/include/rtems/confdefs/bdbuf.h  |  161 +
 cpukit/include/rtems/confdefs/bsp.h|   60 +
 cpukit/include/rtems/confdefs/clock.h  |  109 +
 cpukit/include/rtems/confdefs/console.h|   85 +
 cpukit/include/rtems/confdefs/extensions.h |  158 +
 cpukit/include/rtems/confdefs/inittask.h   |  131 +
 cpukit/include/rtems/confdefs/initthread.h |   97 +
 cpukit/include/rtems/confdefs/iodrivers.h  |  166 ++
 cpukit/include/rtems/confdefs/libio.h  |  410 +++
 cpukit/include/rtems/confdefs/libpci.h |   70 +
 cpukit/include/rtems/confdefs/malloc.h |   72 +
 cpukit/include/rtems/confdefs/mpci.h   |  147 +
 cpukit/include/rtems/confdefs/newlib.h |   72 +
 cpukit/include/rtems/confdefs/objectsclassic.h |  127 +
 cpukit/include/rtems/confdefs/objectsposix.h   |  197 ++
 cpukit/include/rtems/confdefs/obsolete.h   |  234 ++
 cpukit/include/rtems/confdefs/percpu.h |  158 +
 cpukit/include/rtems/confdefs/scheduler.h  |  370 +++
 cpukit/include/rtems/confdefs/threads.h|  234 ++
 cpukit/include/rtems/confdefs/unlimited.h  |  143 +
 cpukit/include/rtems/confdefs/wkspace.h|  182 ++
 cpukit/include/rtems/confdefs/wkspacesupport.h |   64 +
 cpukit/include/rtems/config.h  |  111 +-
 cpukit/include/rtems/libio_.h  |4 -
 cpukit/include/rtems/posix/config.h|   60 -
 cpukit/include/rtems/posix/pthread.h   |   25 +-
 cpukit/include/rtems/posix/pthreadimpl.h   |1 -
 cpukit/include/rtems/rtems/config.h|   74 +-
 cpukit/include/rtems/rtems/tasksdata.h |   19 +-
 cpukit/include/rtems/scheduler.h   |   16 +
 cpukit/include/rtems/score/interr.h|2 +-
 cpukit/include/rtems/score/scheduler.h |8 +
 cpukit/include/rtems/score/schedulerimpl.h |   18 +
 cpukit/include/rtems/score/smp.h   |   13 +
 cpukit/include/rtems/score/smpimpl.h   |   15 +
 cpukit/include/rtems/score/thread.h|7 +
 cpukit/include/rtems/score/threadidledata.h|   78 +
 cpukit/include/rtems/score/watchdogticks.h |   21 +
 cpukit/

[PATCH v2 06/44] config: Add _Watchdog_Microseconds_per_tick

2020-02-21 Thread Sebastian Huber
Move the microseconds per tick configuration constant out of the
configuration table.

Add WATCHDOG_MICROSECONDS_PER_TICK_DEFAULT and use it to provide a
default definition of the watchdog ticks constants.

Update #3875.
---
 cpukit/include/rtems/confdefs.h| 17 ++---
 cpukit/include/rtems/config.h  | 10 ++
 cpukit/include/rtems/score/watchdogticks.h |  8 
 3 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 6a8b9ecb7e..1254e3d209 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -1955,7 +1955,16 @@ extern "C" {
   #error "The CONFIGURE_MICROSECONDS_PER_TICK must be positive"
 #endif
 
-#define _CONFIGURE_TICKS_PER_SECOND (100 / CONFIGURE_MICROSECONDS_PER_TICK)
+#ifdef CONFIGURE_INIT
+  const uint32_t _Watchdog_Microseconds_per_tick =
+CONFIGURE_MICROSECONDS_PER_TICK;
+
+  const uint32_t _Watchdog_Nanoseconds_per_tick =
+(uint32_t) 1000 * CONFIGURE_MICROSECONDS_PER_TICK;
+
+  const uint32_t _Watchdog_Ticks_per_second =
+100 / CONFIGURE_MICROSECONDS_PER_TICK;
+#endif
 
 /** The configures the number of clock ticks per timeslice. */
 #ifndef CONFIGURE_TICKS_PER_TIMESLICE
@@ -2452,11 +2461,6 @@ struct _reent *__getreent(void)
   sizeof( Thread_queue_Configured_heads );
   #endif
 
-  const uint32_t _Watchdog_Nanoseconds_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 =
 rtems_resource_maximum_per_allocation( _CONFIGURE_TASKS ) +
 rtems_resource_maximum_per_allocation( CONFIGURE_MAXIMUM_POSIX_THREADS );
@@ -2622,7 +2626,6 @@ struct _reent *__getreent(void)
*/
   const rtems_configuration_table Configuration = {
 CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */
-CONFIGURE_MICROSECONDS_PER_TICK,  /* microseconds per clock tick */
 CONFIGURE_TICKS_PER_TIMESLICE,/* ticks per timeslice quantum */
 CONFIGURE_IDLE_TASK_BODY, /* user's IDLE task */
 CONFIGURE_IDLE_TASK_STACK_SIZE,   /* IDLE task stack size */
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index d9f91db741..84917366f3 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -86,12 +86,6 @@ typedef struct {
*/
   uintptr_t  work_space_size;
 
-  /** 
-   * This field specifies the number of microseconds which elapse
-   * between clock ticks.  This is the basis for RTEMS timing.
-   */
-  uint32_t   microseconds_per_tick;
-
   /** 
* This field specifies the number of ticks in each task's timeslice.
*/
@@ -162,9 +156,9 @@ uintptr_t rtems_configuration_get_stack_space_size( void );
 uint32_t rtems_configuration_get_maximum_extensions( void );
 
 #define rtems_configuration_get_microseconds_per_tick() \
-(Configuration.microseconds_per_tick)
+(_Watchdog_Microseconds_per_tick)
 #define rtems_configuration_get_milliseconds_per_tick() \
-(Configuration.microseconds_per_tick / 1000)
+(_Watchdog_Microseconds_per_tick / 1000)
 #define rtems_configuration_get_nanoseconds_per_tick() \
 (_Watchdog_Nanoseconds_per_tick)
 
diff --git a/cpukit/include/rtems/score/watchdogticks.h 
b/cpukit/include/rtems/score/watchdogticks.h
index e7cf3f3ea3..226de39c24 100644
--- a/cpukit/include/rtems/score/watchdogticks.h
+++ b/cpukit/include/rtems/score/watchdogticks.h
@@ -49,6 +49,14 @@ typedef uint32_t   Watchdog_Interval;
  */
 extern volatile Watchdog_Interval _Watchdog_Ticks_since_boot;
 
+/**
+ * @brief The watchdog microseconds per tick.
+ *
+ * This constant is defined by the application configuration via
+ * .
+ */
+extern const uint32_t _Watchdog_Microseconds_per_tick;
+
 /**
  * @brief The watchdog nanoseconds per tick.
  *
-- 
2.16.4

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 04/44] config: Bring back RTEMS 4.11 configuration table

2020-02-21 Thread Sebastian Huber
This improves API backward compatibility of RTEMS 5.1 to previous
versions.
---
 cpukit/include/rtems/rtems/config.h   | 61 +++
 cpukit/rtems/src/getapiconfig.c   | 18 +++
 testsuites/sptests/spsysinit01/init.c | 21 
 3 files changed, 100 insertions(+)

diff --git a/cpukit/include/rtems/rtems/config.h 
b/cpukit/include/rtems/rtems/config.h
index a5078f6bb6..bd6b38a532 100644
--- a/cpukit/include/rtems/rtems/config.h
+++ b/cpukit/include/rtems/rtems/config.h
@@ -44,6 +44,67 @@ 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_tmaximum_tasks;
+
+  /**
+   * This field indicates whether Classic API notepads are
+   * enabled or disabled.
+   */
+  boolnotepads_enabled;
+
+  /**
+   * This field contains the maximum number of Classic API
+   * Timers which are configured for this application.
+   */
+  uint32_tmaximum_timers;
+
+  /**
+   * This field contains the maximum number of Classic API
+   * Semaphores which are configured for this application.
+   */
+  uint32_tmaximum_semaphores;
+
+  /**
+   * This field contains the maximum number of Classic API
+   * Message Queues which are configured for this application.
+   */
+  uint32_tmaximum_message_queues;
+
+  /**
+   * This field contains the maximum number of Classic API
+   * Partitions which are configured for this application.
+   */
+  uint32_tmaximum_partitions;
+
+  /**
+   * This field contains the maximum number of Classic API
+   * Regions which are configured for this application.
+   */
+  uint32_tmaximum_regions;
+
+  /**
+   * This field contains the maximum number of Classic API
+   * Dual Ported Memory Areas which are configured for this
+   * application.
+   */
+  uint32_tmaximum_ports;
+
+  /**
+   * This field contains the maximum number of Classic API
+   * Rate Monotonic Periods which are configured for this
+   * application.
+   */
+  uint32_tmaximum_periods;
+
+  /**
+   * This field contains the maximum number of Classic API
+   * Barriers which are configured for this application.
+   */
+  uint32_tmaximum_barriers;
 
   /**
* This field contains the number of Classic API Initialization
diff --git a/cpukit/rtems/src/getapiconfig.c b/cpukit/rtems/src/getapiconfig.c
index 77c60cfe1c..088ea5909f 100644
--- a/cpukit/rtems/src/getapiconfig.c
+++ b/cpukit/rtems/src/getapiconfig.c
@@ -37,6 +37,24 @@ static rtems_api_configuration_table config;
 const rtems_api_configuration_table *
 rtems_configuration_get_rtems_api_configuration( void )
 {
+  /*
+   * Always initialize the configuration table and do not bother with
+   * synchronization issues.  This function is not performance critical.  The
+   * configuration values are all constants.
+   */
+
+  config.notepads_enabled = false;
+  config.maximum_tasks = rtems_configuration_get_maximum_tasks();
+  config.maximum_timers = rtems_configuration_get_maximum_timers();
+  config.maximum_semaphores = rtems_configuration_get_maximum_semaphores();
+  config.maximum_message_queues =
+rtems_configuration_get_maximum_message_queues();
+  config.maximum_partitions = rtems_configuration_get_maximum_partitions();
+  config.maximum_regions = rtems_configuration_get_maximum_regions();
+  config.maximum_ports = rtems_configuration_get_maximum_ports();
+  config.maximum_periods = rtems_configuration_get_maximum_periods();
+  config.maximum_barriers = rtems_configuration_get_maximum_barriers();
+
   if ( _RTEMS_tasks_User_task_table.entry_point != NULL ) {
 config.number_of_initialization_tasks = 1;
 config.User_initialization_tasks_table = &_RTEMS_tasks_User_task_table;
diff --git a/testsuites/sptests/spsysinit01/init.c 
b/testsuites/sptests/spsysinit01/init.c
index 49b5a69a60..224eac468f 100644
--- a/testsuites/sptests/spsysinit01/init.c
+++ b/testsuites/sptests/spsysinit01/init.c
@@ -905,6 +905,26 @@ static void do_posix_timer_create(void)
 #endif /* RTEMS_POSIX_API */
 }
 
+static void check_config(void)
+{
+  const rtems_api_configuration_table *config;
+
+  config = rtems_configuration_get_rtems_api_configuration();
+
+  rtems_test_assert(!config->notepads_enabled);
+  rtems_test_assert(config->maximum_tasks == 2);
+  rtems_test_assert(config->maximum_timers == 1);
+  rtems_test_assert(config->maximum_semaphores == 1);
+  rtems_test_assert(config->maximum_message_queues == 1);
+  rtems_test_assert(config->maximum_partitions == 1);
+  rtems_test_assert(config->maximum_regions == 1);
+  rtems_test_assert(config->maximum_ports == 1);
+  rtems_test_assert(config->maximum_periods == 1);
+  rtems_test_assert(config->maximum_barriers == 1);
+  rtems_test_assert(c

[PATCH v2 07/44] config: Add _Watchdog_Ticks_per_timeslice

2020-02-21 Thread Sebastian Huber
Move the ticks per timeslice configuration constant out of the
configuration table.

Add WATCHDOG_TICKS_PER_TIMESLICE_DEFAULT and use it to provide a default
definition of the watchdog ticks per timeslice constant.

Update #3875.
---
 cpukit/Makefile.am  |  1 +
 cpukit/include/rtems/confdefs.h | 11 ++---
 cpukit/include/rtems/config.h   |  7 +-
 cpukit/include/rtems/score/watchdogticks.h  | 13 +++
 cpukit/score/src/watchdogtimeslicedefault.c | 35 +
 5 files changed, 58 insertions(+), 9 deletions(-)
 create mode 100644 cpukit/score/src/watchdogtimeslicedefault.c

diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index 1d3935776b..1adcbb3ae9 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -1002,6 +1002,7 @@ librtemscpu_a_SOURCES += score/src/coretodhookunregister.c
 librtemscpu_a_SOURCES += score/src/watchdogremove.c
 librtemscpu_a_SOURCES += score/src/watchdogtick.c
 librtemscpu_a_SOURCES += score/src/watchdogtickssinceboot.c
+librtemscpu_a_SOURCES += score/src/watchdogtimeslicedefault.c
 librtemscpu_a_SOURCES += score/src/userextaddset.c
 librtemscpu_a_SOURCES += score/src/userext.c
 librtemscpu_a_SOURCES += score/src/userextremoveset.c
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 1254e3d209..b1c3a4a2d2 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -1967,10 +1967,16 @@ extern "C" {
 #endif
 
 /** The configures the number of clock ticks per timeslice. */
-#ifndef CONFIGURE_TICKS_PER_TIMESLICE
-  #define CONFIGURE_TICKS_PER_TIMESLICE50
+#if defined(CONFIGURE_TICKS_PER_TIMESLICE) && \
+  CONFIGURE_TICKS_PER_TIMESLICE != WATCHDOG_TICKS_PER_TIMESLICE_DEFAULT
+
+#ifdef CONFIGURE_INIT
+  const uint32_t _Watchdog_Ticks_per_timeslice =
+CONFIGURE_TICKS_PER_TIMESLICE;
 #endif
 
+#endif /* CONFIGURE_TICKS_PER_TIMESLICE */
+
 /**@}*/ /* end of General Configuration */
 
 /*
@@ -2626,7 +2632,6 @@ struct _reent *__getreent(void)
*/
   const rtems_configuration_table Configuration = {
 CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */
-CONFIGURE_TICKS_PER_TIMESLICE,/* ticks per timeslice quantum */
 CONFIGURE_IDLE_TASK_BODY, /* user's IDLE task */
 CONFIGURE_IDLE_TASK_STACK_SIZE,   /* IDLE task stack size */
 #ifdef CONFIGURE_UNIFIED_WORK_AREAS   /* true for unified work areas */
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index 84917366f3..31a667a1d6 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -86,11 +86,6 @@ typedef struct {
*/
   uintptr_t  work_space_size;
 
-  /** 
-   * This field specifies the number of ticks in each task's timeslice.
-   */
-  uint32_t   ticks_per_timeslice;
-
   /** 
* This element points to the BSP's optional idle task which may override
* the default one provided with RTEMS.
@@ -163,7 +158,7 @@ uint32_t rtems_configuration_get_maximum_extensions( void );
 (_Watchdog_Nanoseconds_per_tick)
 
 #define rtems_configuration_get_ticks_per_timeslice() \
-(Configuration.ticks_per_timeslice)
+(_Watchdog_Ticks_per_timeslice)
 
 #define rtems_configuration_get_idle_task() \
 (Configuration.idle_task)
diff --git a/cpukit/include/rtems/score/watchdogticks.h 
b/cpukit/include/rtems/score/watchdogticks.h
index 226de39c24..ea2651954c 100644
--- a/cpukit/include/rtems/score/watchdogticks.h
+++ b/cpukit/include/rtems/score/watchdogticks.h
@@ -42,6 +42,11 @@ typedef uint32_t   Watchdog_Interval;
  */
 #define WATCHDOG_NO_TIMEOUT 0
 
+/**
+ * @brief Default value for the watchdog ticks per timeslice.
+ */
+#define WATCHDOG_TICKS_PER_TIMESLICE_DEFAULT 50
+
 /**
  * @brief The watchdog ticks counter.
  *
@@ -73,6 +78,14 @@ extern const uint32_t _Watchdog_Nanoseconds_per_tick;
  */
 extern const uint32_t _Watchdog_Ticks_per_second;
 
+/**
+ * @brief The watchdog ticks per timeslice.
+ *
+ * This constant is defined by the application configuration via
+ * .
+ */
+extern const uint32_t _Watchdog_Ticks_per_timeslice;
+
 /** @} */
 
 #ifdef __cplusplus
diff --git a/cpukit/score/src/watchdogtimeslicedefault.c 
b/cpukit/score/src/watchdogtimeslicedefault.c
new file mode 100644
index 00..91be2b51e6
--- /dev/null
+++ b/cpukit/score/src/watchdogtimeslicedefault.c
@@ -0,0 +1,35 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2020 embedded brains GmbH (http://www.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, thi

[PATCH v2 02/44] config: Simplify initialization task config

2020-02-21 Thread Sebastian Huber
With the removal of the CONFIGURE_HAS_OWN_INIT_TASK_TABLE configuration
option at most one Classic API user initialization task can be
configured.

Provide an RTEMS API configuration table for backward compatibility.

Update #3873.
---
 cpukit/Makefile.am |   2 +
 cpukit/include/rtems/confdefs.h|  59 ---
 cpukit/include/rtems/config.h  |   3 -
 cpukit/include/rtems/rtems/config.h|  13 ++---
 cpukit/include/rtems/rtems/tasksdata.h |  19 +++---
 cpukit/libmisc/monitor/mon-config.c|   4 +-
 cpukit/libmisc/monitor/mon-itask.c |   8 ++-
 cpukit/rtems/src/getapiconfig.c|  46 +++
 cpukit/rtems/src/taskinitdefault.c |  34 +++
 cpukit/rtems/src/taskinitusers.c   | 102 +++--
 10 files changed, 148 insertions(+), 142 deletions(-)
 create mode 100644 cpukit/rtems/src/getapiconfig.c
 create mode 100644 cpukit/rtems/src/taskinitdefault.c

diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index 44a0868cd5..1d3935776b 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -697,6 +697,7 @@ librtemscpu_a_SOURCES += rtems/src/eventreceive.c
 librtemscpu_a_SOURCES += rtems/src/eventseize.c
 librtemscpu_a_SOURCES += rtems/src/eventsend.c
 librtemscpu_a_SOURCES += rtems/src/eventsurrender.c
+librtemscpu_a_SOURCES += rtems/src/getapiconfig.c
 librtemscpu_a_SOURCES += rtems/src/getcurrentprocessor.c
 librtemscpu_a_SOURCES += rtems/src/getprocessorcount.c
 librtemscpu_a_SOURCES += rtems/src/intrbody.c
@@ -789,6 +790,7 @@ librtemscpu_a_SOURCES += rtems/src/taskgetaffinity.c
 librtemscpu_a_SOURCES += rtems/src/taskgetpriority.c
 librtemscpu_a_SOURCES += rtems/src/taskgetscheduler.c
 librtemscpu_a_SOURCES += rtems/src/taskident.c
+librtemscpu_a_SOURCES += rtems/src/taskinitdefault.c
 librtemscpu_a_SOURCES += rtems/src/taskinitusers.c
 librtemscpu_a_SOURCES += rtems/src/taskissuspended.c
 librtemscpu_a_SOURCES += rtems/src/taskiterate.c
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index b5f8de4cd1..13ba4466f0 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -103,11 +103,6 @@ extern "C" {
  *used remarkably reliably by most applications.
  */
 
-/**
- * This is the Classic API initialization tasks table.
- */
-extern rtems_initialization_tasks_table Initialization_tasks[];
-
 /**
  * This macro determines whether the RTEMS reentrancy support for
  * the Newlib C Library is enabled.
@@ -1362,42 +1357,8 @@ extern rtems_initialization_tasks_table 
Initialization_tasks[];
   #define CONFIGURE_INIT_TASK_ARGUMENTS 0
 #endif
 
-#ifdef CONFIGURE_INIT
-  rtems_initialization_tasks_table Initialization_tasks[] = {
-{ CONFIGURE_INIT_TASK_NAME,
-  CONFIGURE_INIT_TASK_STACK_SIZE,
-  CONFIGURE_INIT_TASK_PRIORITY,
-  CONFIGURE_INIT_TASK_ATTRIBUTES,
-  CONFIGURE_INIT_TASK_ENTRY_POINT,
-  CONFIGURE_INIT_TASK_INITIAL_MODES,
-  CONFIGURE_INIT_TASK_ARGUMENTS
-}
-  };
-#endif
-
-/**
- * This is the name of the Initialization Tasks Table generated.
- */
-#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
-
-/*
- * This is the size of the Initialization Tasks Table generated.
- */
-#define CONFIGURE_INIT_TASK_TABLE_SIZE \
-  RTEMS_ARRAY_SIZE(CONFIGURE_INIT_TASK_TABLE)
-
 #else /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */
 
-/*
- * This is the name of the Initialization Task when none is configured.
- */
-#define CONFIGURE_INIT_TASK_TABLE  NULL
-
-/*
- * This is the size of the Initialization Task when none is configured.
- */
-#define CONFIGURE_INIT_TASK_TABLE_SIZE 0
-
 /*
  * This is the stack size of the Initialization Task when none is configured.
  */
@@ -2580,14 +2541,6 @@ struct _reent *__getreent(void)
 EXTENSION_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_USER_EXTENSIONS );
   #endif
 
-  /**
-   * This is the Classic API Configuration Table.
-   */
-  rtems_api_configuration_table Configuration_RTEMS_API = {
-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(
@@ -2779,8 +2732,18 @@ struct _reent *__getreent(void)
  */
 #ifdef CONFIGURE_INIT
   #if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE)
+const rtems_initialization_tasks_table _RTEMS_tasks_User_task_table = {
+  CONFIGURE_INIT_TASK_NAME,
+  CONFIGURE_INIT_TASK_STACK_SIZE,
+  CONFIGURE_INIT_TASK_PRIORITY,
+  CONFIGURE_INIT_TASK_ATTRIBUTES,
+  CONFIGURE_INIT_TASK_ENTRY_POINT,
+  CONFIGURE_INIT_TASK_INITIAL_MODES,
+  CONFIGURE_INIT_TASK_ARGUMENTS
+};
+
 RTEMS_SYSINIT_ITEM(
-  _RTEMS_tasks_Initialize_user_tasks_body,
+  _RTEMS_tasks_Initialize_user_task,
   RTEMS_SYSINIT_CLASSIC_USER_TASKS,
   RTEMS_SYSINIT_ORDER_MIDDLE
 );
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index 51e437f48a..

[PATCH v2 08/44] config: Add _Thread_Idle_stack_size

2020-02-21 Thread Sebastian Huber
Move the idle thread stack size configuration constant out of the
configuration table.

Add THREAD_IDLE_STACK_SIZE_DEFAULT and use it to provide a default
definition of the idle thread stack size constant.

Update #3875.
---
 cpukit/headers.am   |  1 +
 cpukit/include/rtems/confdefs.h |  5 ++-
 cpukit/include/rtems/config.h   | 10 +
 cpukit/include/rtems/score/threadidledata.h | 65 +
 cpukit/score/src/threadcreateidle.c |  3 +-
 5 files changed, 74 insertions(+), 10 deletions(-)
 create mode 100644 cpukit/include/rtems/score/threadidledata.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index 244e435c62..351e942cea 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -389,6 +389,7 @@ include_rtems_score_HEADERS += include/rtems/score/status.h
 include_rtems_score_HEADERS += include/rtems/score/sysstate.h
 include_rtems_score_HEADERS += include/rtems/score/thread.h
 include_rtems_score_HEADERS += include/rtems/score/threaddispatch.h
+include_rtems_score_HEADERS += include/rtems/score/threadidledata.h
 include_rtems_score_HEADERS += include/rtems/score/threadimpl.h
 include_rtems_score_HEADERS += include/rtems/score/threadmp.h
 include_rtems_score_HEADERS += include/rtems/score/threadq.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index b1c3a4a2d2..442ee7af92 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -1139,6 +1139,10 @@ extern "C" {
   #error "CONFIGURE_IDLE_TASK_STACK_SIZE less than 
CONFIGURE_MINIMUM_TASK_STACK_SIZE"
 #endif
 
+#ifdef CONFIGURE_INIT
+  const size_t _Thread_Idle_stack_size = CONFIGURE_IDLE_TASK_STACK_SIZE;
+#endif
+
 /*
  * Interrupt stack configuration.
  *
@@ -2633,7 +2637,6 @@ struct _reent *__getreent(void)
   const rtems_configuration_table Configuration = {
 CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */
 CONFIGURE_IDLE_TASK_BODY, /* user's IDLE task */
-CONFIGURE_IDLE_TASK_STACK_SIZE,   /* IDLE task stack size */
 #ifdef CONFIGURE_UNIFIED_WORK_AREAS   /* true for unified work areas */
   true,
 #else
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index 31a667a1d6..62804be41c 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -92,13 +93,6 @@ typedef struct {
*/
   void*(*idle_task)( uintptr_t );
 
-  /** 
-   * This field specifies the size of the IDLE task's stack.  If less than or
-   * equal to the minimum stack size, then the IDLE task will have the minimum
-   * stack size.
-   */
-  uint32_t   idle_task_stack_size;
-
   /**
* @brief Specifies if a unified work area is used or not.
*
@@ -164,7 +158,7 @@ uint32_t rtems_configuration_get_maximum_extensions( void );
 (Configuration.idle_task)
 
 #define rtems_configuration_get_idle_task_stack_size() \
-(Configuration.idle_task_stack_size)
+(_Thread_Idle_stack_size)
 
 #define rtems_configuration_get_interrupt_stack_size() \
 ((size_t) _ISR_Stack_size)
diff --git a/cpukit/include/rtems/score/threadidledata.h 
b/cpukit/include/rtems/score/threadidledata.h
new file mode 100644
index 00..0011776ffa
--- /dev/null
+++ b/cpukit/include/rtems/score/threadidledata.h
@@ -0,0 +1,65 @@
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreThread
+ *
+ * @brief Constants for the idle threads.
+ */
+
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2020 embedded brains GmbH (http://www.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 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 SO

[PATCH v2 01/44] config: Remove CONFIGURE_HAS_OWN_INIT_TASK_TABLE

2020-02-21 Thread Sebastian Huber
The CONFIGURE_HAS_OWN_INIT_TASK_TABLE and
CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE are the last *_HAS_OWN_*
configuration options.  These two options are probably unused, see also:

  * https://lists.rtems.org/pipermail/users/2019-April/033129.html

  * https://lists.rtems.org/pipermail/users/2019-April/033130.html

Removing them simplifies the configuration. If there is a real user need
which shows up after the removal, we can resurrect them on demand.

Using CONFIGURE_HAS_OWN_INIT_TASK_TABLE would have required the use of
the undocumented CONFIGURE_INIT_TASK_TABLE and
CONFIGURE_INIT_TASK_TABLE_SIZE configuration options.

Update #3873.
---
 cpukit/include/rtems/confdefs.h | 23 ++-
 testsuites/sptests/sp54/init.c  | 26 --
 testsuites/sptests/spfatal01/init.c | 33 +
 testsuites/sptests/spfatal02/init.c | 20 +---
 testsuites/sptests/spfatal04/init.c | 20 
 testsuites/sptests/spfatal05/init.c | 20 
 testsuites/sptests/spfatal06/init.c | 24 +---
 7 files changed, 29 insertions(+), 137 deletions(-)

diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index a8fb391496..b5f8de4cd1 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -1290,13 +1290,8 @@ extern rtems_initialization_tasks_table 
Initialization_tasks[];
  *
  * Default User Initialization Task Table.  This table guarantees that
  * one user initialization table is defined.
- *
- *  WHEN CONFIGURE_HAS_OWN_INIT_TASK_TABLE is defined, the user is
- *  responsible for defining their own table information and setting the
- *  appropriate variables.
  */
-#if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) && \
-!defined(CONFIGURE_HAS_OWN_INIT_TASK_TABLE)
+#if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE)
 
 /**
  * When using the default Classic API Initialization Tasks Table, this is
@@ -1392,13 +1387,6 @@ extern rtems_initialization_tasks_table 
Initialization_tasks[];
   RTEMS_ARRAY_SIZE(CONFIGURE_INIT_TASK_TABLE)
 
 #else /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */
-#ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE
-
-/*
- * The user application is responsible for defining everything
- * when CONFIGURE_HAS_OWN_INIT_TABLE is defined.
- */
-#else /* not using standard or providing own Init Task Table */
 
 /*
  * This is the name of the Initialization Task when none is configured.
@@ -1415,8 +1403,6 @@ extern rtems_initialization_tasks_table 
Initialization_tasks[];
  */
 #define CONFIGURE_INIT_TASK_STACK_SIZE 0
 
-#endif/* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */
-
 #endif
 /**@}*/  /* end of Classic API Initialization Tasks Table */
 
@@ -2792,8 +2778,7 @@ struct _reent *__getreent(void)
  *  then we need to install the code that runs that loop.
  */
 #ifdef CONFIGURE_INIT
-  #if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) || \
-  defined(CONFIGURE_HAS_OWN_INIT_TASK_TABLE)
+  #if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE)
 RTEMS_SYSINIT_ITEM(
   _RTEMS_tasks_Initialize_user_tasks_body,
   RTEMS_SYSINIT_CLASSIC_USER_TASKS,
@@ -2986,6 +2971,10 @@ struct _reent *__getreent(void)
   #warning "The CONFIGURE_HAS_OWN_FILESYSTEM_TABLE configuration option is 
obsolete since RTEMS 5.1"
 #endif
 
+#ifdef CONFIGURE_HAS_OWN_INIT_TABLE
+  #warning "The CONFIGURE_HAS_OWN_INIT_TABLE configuration option is obsolete 
since RTEMS 5.1"
+#endif
+
 #ifdef CONFIGURE_HAS_OWN_MOUNT_TABLE
   #warning "The CONFIGURE_HAS_OWN_MOUNT_TABLE configuration option is obsolete 
since RTEMS 5.1"
 #endif
diff --git a/testsuites/sptests/sp54/init.c b/testsuites/sptests/sp54/init.c
index 07001e1e5e..71437fac8e 100644
--- a/testsuites/sptests/sp54/init.c
+++ b/testsuites/sptests/sp54/init.c
@@ -24,9 +24,10 @@ const char rtems_test_name[] = "SP 54";
 
 static void *Init( uintptr_t ignored )
 {
-  rtems_status_codestatus;
-  rtems_task_priority  pri;
-  rtems_id id;
+  rtems_status_codestatus;
+  rtems_task_priority  pri;
+  rtems_id id;
+  const rtems_api_configuration_table *config;
 
   /*
*  It is possible that since this thread prints and there is no idle
@@ -52,6 +53,10 @@ static void *Init( uintptr_t ignored )
 
   rtems_test_assert( rtems_configuration_get_do_zero_of_workspace() );
 
+  config = rtems_configuration_get_rtems_api_configuration();
+  rtems_test_assert( config->number_of_initialization_tasks == 0 );
+  rtems_test_assert( config->User_initialization_tasks_table == NULL );
+
   TEST_END();
   rtems_test_exit(0);
 }
@@ -68,21 +73,6 @@ static void *Init( uintptr_t ignored )
 #define CONFIGURE_IDLE_TASK_BODY Init
 #define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION
 
-/*
- *  Another odd case to hit.  Since we use the Init task is Idle task
- *  configuration, we can dummy up the initialization task configuration
- *  to have a non-NULL pointer and 0 tasks.
- */
-
-#define 

[PATCH v2 15/44] score: Add _SMP_Need_inter_processor_interrupts()

2020-02-21 Thread Sebastian Huber
Test for the proper system condition instead of using the
rtems_configuration_is_smp_enabled() workaround.

Update #3876.
---
 cpukit/include/rtems/score/smpimpl.h | 15 +++
 cpukit/rtems/src/taskmode.c  |  3 ++-
 cpukit/score/src/threaddispatch.c|  2 +-
 cpukit/score/src/threadinitialize.c  |  2 +-
 4 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/cpukit/include/rtems/score/smpimpl.h 
b/cpukit/include/rtems/score/smpimpl.h
index 889ef5be58..dbca09d5cb 100644
--- a/cpukit/include/rtems/score/smpimpl.h
+++ b/cpukit/include/rtems/score/smpimpl.h
@@ -324,6 +324,21 @@ RTEMS_INLINE_ROUTINE const Processor_mask 
*_SMP_Get_online_processors( void )
 #endif
 }
 
+/**
+ * @brief Indicate if inter-processor interrupts are needed.
+ *
+ * @return True if inter-processor interrupts are needed for the correct system
+ * operation, otherwise false.
+ */
+RTEMS_INLINE_ROUTINE const bool _SMP_Need_inter_processor_interrupts( void )
+{
+  /*
+   * Use the configured processor maximum instead of the actual to allow
+   * testing on uni-processor systems.
+   */
+  return _SMP_Processor_configured_maximum > 1;
+}
+
 /** @} */
 
 #ifdef __cplusplus
diff --git a/cpukit/rtems/src/taskmode.c b/cpukit/rtems/src/taskmode.c
index 906f86bdcd..8830f6bb5d 100644
--- a/cpukit/rtems/src/taskmode.c
+++ b/cpukit/rtems/src/taskmode.c
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -58,7 +59,7 @@ rtems_status_code rtems_task_mode(
 ( mask & RTEMS_INTERRUPT_MASK ) != 0
   && _Modes_Get_interrupt_level( mode_set ) != 0
 #if CPU_ENABLE_ROBUST_THREAD_DISPATCH == FALSE
-  && rtems_configuration_is_smp_enabled()
+  && _SMP_Need_inter_processor_interrupts()
 #endif
   ) {
 return RTEMS_NOT_IMPLEMENTED;
diff --git a/cpukit/score/src/threaddispatch.c 
b/cpukit/score/src/threaddispatch.c
index 65951cccfe..cd32f5a1d2 100644
--- a/cpukit/score/src/threaddispatch.c
+++ b/cpukit/score/src/threaddispatch.c
@@ -265,7 +265,7 @@ void _Thread_Do_dispatch( Per_CPU_Control *cpu_self, 
ISR_Level level )
   if (
 !_ISR_Is_enabled( level )
 #if defined(RTEMS_SMP) && CPU_ENABLE_ROBUST_THREAD_DISPATCH == FALSE
-  && rtems_configuration_is_smp_enabled()
+  && _SMP_Need_inter_processor_interrupts()
 #endif
   ) {
 _Internal_error( INTERNAL_ERROR_BAD_THREAD_DISPATCH_ENVIRONMENT );
diff --git a/cpukit/score/src/threadinitialize.c 
b/cpukit/score/src/threadinitialize.c
index 4dc6d51d72..976c97701a 100644
--- a/cpukit/score/src/threadinitialize.c
+++ b/cpukit/score/src/threadinitialize.c
@@ -72,7 +72,7 @@ bool _Thread_Initialize(
   if (
 config->isr_level != 0
 #if CPU_ENABLE_ROBUST_THREAD_DISPATCH == FALSE
-  && rtems_configuration_is_smp_enabled()
+  && _SMP_Need_inter_processor_interrupts()
 #endif
   ) {
 goto failed;
-- 
2.16.4

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 32/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am |   1 +
 cpukit/include/rtems/confdefs.h   |  89 +--
 cpukit/include/rtems/confdefs/clock.h | 109 ++
 3 files changed, 111 insertions(+), 88 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/clock.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index 20059a7909..60a3687db8 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -185,6 +185,7 @@ include_rtems_HEADERS += include/rtems/vmeintr.h
 include_rtems_HEADERS += include/rtems/watchdogdrv.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/bdbuf.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/bsp.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/clock.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libio.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/malloc.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index a28e277311..f4cbe43908 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -51,6 +51,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -302,18 +303,6 @@ extern "C" {
   #endif
 #endif
 
-#ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
-  #include 
-
-  #ifdef CONFIGURE_INIT
-RTEMS_SYSINIT_ITEM(
-  _Clock_Initialize,
-  RTEMS_SYSINIT_DEVICE_DRIVERS,
-  RTEMS_SYSINIT_ORDER_THIRD
-);
-  #endif
-#endif
-
 #ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
   #include 
 #endif
@@ -605,54 +594,6 @@ extern "C" {
 
 /**@}*/ /* end of Classic API Configuration */
 
-/**
- * @defgroup ConfigurationGeneral General System Configuration
- *
- * @ingroup Configuration
- *
- * This module contains configuration parameters that are independent
- * of any API but impact general system configuration.
- */
-/**@{*/
-
-/** The configures the number of microseconds per clock tick. */
-#ifndef CONFIGURE_MICROSECONDS_PER_TICK
-  #define CONFIGURE_MICROSECONDS_PER_TICK \
-  RTEMS_MILLISECONDS_TO_MICROSECONDS(10)
-#endif
-
-#if 100 % CONFIGURE_MICROSECONDS_PER_TICK != 0
-  #warning "The clock ticks per second is not an integer"
-#endif
-
-#if CONFIGURE_MICROSECONDS_PER_TICK <= 0
-  #error "The CONFIGURE_MICROSECONDS_PER_TICK must be positive"
-#endif
-
-#ifdef CONFIGURE_INIT
-  const uint32_t _Watchdog_Microseconds_per_tick =
-CONFIGURE_MICROSECONDS_PER_TICK;
-
-  const uint32_t _Watchdog_Nanoseconds_per_tick =
-(uint32_t) 1000 * CONFIGURE_MICROSECONDS_PER_TICK;
-
-  const uint32_t _Watchdog_Ticks_per_second =
-100 / CONFIGURE_MICROSECONDS_PER_TICK;
-#endif
-
-/** The configures the number of clock ticks per timeslice. */
-#if defined(CONFIGURE_TICKS_PER_TIMESLICE) && \
-  CONFIGURE_TICKS_PER_TIMESLICE != WATCHDOG_TICKS_PER_TIMESLICE_DEFAULT
-
-#ifdef CONFIGURE_INIT
-  const uint32_t _Watchdog_Ticks_per_timeslice =
-CONFIGURE_TICKS_PER_TIMESLICE;
-#endif
-
-#endif /* CONFIGURE_TICKS_PER_TIMESLICE */
-
-/**@}*/ /* end of General Configuration */
-
 /*
  *  Initial Extension Set
  */
@@ -1419,34 +1360,6 @@ struct _reent *__getreent(void)
 #endif
 #endif
 
-#if !defined(RTEMS_SCHEDSIM)
-/*
- *  You must either explicitly include or exclude the clock driver.
- *  It is such a common newbie error to leave it out.  Maybe this
- *  will put an end to it.
- *
- *  NOTE: If you are using the timer driver, it is considered
- *mutually exclusive with the clock driver because the
- *drivers are assumed to use the same "timer" hardware
- *on many boards.
- */
-#if !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \
-!defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER) && \
-!defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER)
-  #error "CONFIGURATION ERROR: Do you want the clock driver or not?!?"
- #endif
-
-/*
- * Only one of the following three configuration parameters should be
- * defined at a time.
- */
-#if ((defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) + \
-  defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER) + \
-  defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER)) > 1)
-   #error "CONFIGURATION ERROR: More than one clock/timer driver configuration 
parameter specified?!?"
-#endif
-#endif   /* !defined(RTEMS_SCHEDSIM) */
-
 /*
  * POSIX Key pair shouldn't be less than POSIX Key, which is highly
  * likely to be error.
diff --git a/cpukit/include/rtems/confdefs/clock.h 
b/cpukit/include/rtems/confdefs/clock.h
new file mode 100644
index 00..a19e6130d0
--- /dev/null
+++ b/cpukit/include/rtems/confdefs/clock.h
@@ -0,0 +1,109 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in so

[PATCH v2 26/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove comments and copyrightable content from the moved content.  Use
BSD-2-Clause for new file according to file history of
.

Update #3053.
Update #3875.
---
 cpukit/headers.am  |   1 +
 cpukit/include/rtems/confdefs.h| 164 +
 cpukit/include/rtems/confdefs/percpu.h | 158 +++
 3 files changed, 161 insertions(+), 162 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/percpu.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index 9f736e0c87..e0b5af6402 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -186,6 +186,7 @@ include_rtems_HEADERS += include/rtems/watchdogdrv.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/bsp.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/obsolete.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/percpu.h
 include_rtems_debugger_HEADERS += include/rtems/debugger/rtems-debugger-bsp.h
 include_rtems_debugger_HEADERS += 
include/rtems/debugger/rtems-debugger-remote.h
 include_rtems_debugger_HEADERS += 
include/rtems/debugger/rtems-debugger-server.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index eca210190c..240dd855cc 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -31,7 +31,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -51,8 +50,8 @@
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
 
 #include 
 
@@ -134,13 +133,6 @@ extern "C" {
   const uint32_t rtems_libio_number_iops = RTEMS_ARRAY_SIZE(rtems_libio_iops);
 #endif
 
-/* Ensure that _CONFIGURE_MAXIMUM_PROCESSORS > 1 only in SMP configurations */
-#if defined(CONFIGURE_MAXIMUM_PROCESSORS) && defined(RTEMS_SMP)
-  #define _CONFIGURE_MAXIMUM_PROCESSORS CONFIGURE_MAXIMUM_PROCESSORS
-#else
-  #define _CONFIGURE_MAXIMUM_PROCESSORS 1
-#endif
-
 /*
  * This sets up the resources for the FIFOs/pipes.
  */
@@ -978,130 +970,6 @@ extern "C" {
 #endif
 /**@}*/ /* end of Scheduler Configuration */
 
-/**
- * @defgroup ConfigurationIdle IDLE Thread Configuration
- *
- * @addtogroup Configuration
- *
- * This module contains configuration parameters related to the
- * set of IDLE threads. On a uniprocessor system, there is one
- * IDLE thread. On an SMP system, there is one for each core.
- */
-
-/*
- *  If you said the IDLE task was going to do application initialization
- *  and didn't override the IDLE body, then something is amiss.
- */
-#if (defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) && \
- !defined(CONFIGURE_IDLE_TASK_BODY))
-  #error "CONFIGURE_ERROR: You did not override the IDLE task body."
-#endif
-
-/**
- * @brief Idle task body configuration.
- *
- * There is a default IDLE thread body provided by RTEMS which
- * has the possibility of being CPU specific.  There may be a
- * BSP specific override of the RTEMS default body and in turn,
- * the application may override and provide its own.
- */
-#ifndef CONFIGURE_IDLE_TASK_BODY
-  #if defined(BSP_IDLE_TASK_BODY)
-#define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY
-  #endif
-#endif
-
-#if defined(CONFIGURE_INIT) && defined(CONFIGURE_IDLE_TASK_BODY)
-const Thread_Idle_body _Thread_Idle_body = CONFIGURE_IDLE_TASK_BODY;
-#endif
-/**@}*/ /* end of IDLE thread configuration */
-
-/**
- * @defgroup ConfigurationStackSize Configuration Thread Stack Size
- *
- * @addtogroup Configuration
- *
- * This module contains parameters related to thread and interrupt stacks.
- */
-
-/**
- * By default, use the minimum stack size requested by this port.
- */
-#ifndef CONFIGURE_MINIMUM_TASK_STACK_SIZE
-  #define CONFIGURE_MINIMUM_TASK_STACK_SIZE CPU_STACK_MINIMUM_SIZE
-#endif
-
-/**
- * This specifies the default POSIX thread stack size. By default, it is
- * twice that recommended for the port.
- */
-#ifndef CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE
-#define CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE \
-  (2 * CONFIGURE_MINIMUM_TASK_STACK_SIZE)
-#endif
-
-/**
- * @brief Idle task stack size configuration.
- *
- * By default, the IDLE task will have a stack of minimum size.
- * The BSP or application may override this value.
- */
-#ifndef CONFIGURE_IDLE_TASK_STACK_SIZE
-  #ifdef BSP_IDLE_TASK_STACK_SIZE
-#define CONFIGURE_IDLE_TASK_STACK_SIZE BSP_IDLE_TASK_STACK_SIZE
-  #else
-#define CONFIGURE_IDLE_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE
-  #endif
-#endif
-#if CONFIGURE_IDLE_TASK_STACK_SIZE < CONFIGURE_MINIMUM_TASK_STACK_SIZE
-  #error "CONFIGURE_IDLE_TASK_STACK_SIZE less than 
CONFIGURE_MINIMUM_TASK_STACK_SIZE"
-#endif
-
-#ifdef CONFIGURE_INIT
-  const size_t _Thread_Idle_stack_size = CONFIGURE_IDLE_TASK_STACK_SIZE;
-#endif
-
-/*
- * Interrupt stack configuration.
- *
- * By default, the interrupt stack will be of minimum size.
- * The BSP or application may override this value.
- */
-
-#ifndef CONFIGURE_INTERRUPT_STACK_SIZE
-  #i

[PATCH v2 37/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am   |  1 +
 cpukit/include/rtems/confdefs.h | 25 +-
 cpukit/include/rtems/confdefs/console.h | 85 +
 3 files changed, 87 insertions(+), 24 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/console.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index 7a9cf1adae..2456c42f94 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -186,6 +186,7 @@ include_rtems_HEADERS += include/rtems/watchdogdrv.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/bdbuf.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/bsp.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/clock.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/console.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/extensions.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/inittask.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/initthread.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 4ae6580754..052f958b1a 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -177,30 +178,6 @@ extern "C" {
   #include 
 #endif
 
-#ifdef CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
-  #include 
-
-  #ifdef CONFIGURE_INIT
-RTEMS_SYSINIT_ITEM(
-  _Console_simple_Initialize,
-  RTEMS_SYSINIT_DEVICE_DRIVERS,
-  RTEMS_SYSINIT_ORDER_SECOND
-);
-  #endif
-#endif
-
-#ifdef CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER
-  #include 
-
-  #ifdef CONFIGURE_INIT
-RTEMS_SYSINIT_ITEM(
-  _Console_simple_task_Initialize,
-  RTEMS_SYSINIT_DEVICE_DRIVERS,
-  RTEMS_SYSINIT_ORDER_SECOND
-);
-  #endif
-#endif
-
 #ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
   #include 
 #endif
diff --git a/cpukit/include/rtems/confdefs/console.h 
b/cpukit/include/rtems/confdefs/console.h
new file mode 100644
index 00..d89d776241
--- /dev/null
+++ b/cpukit/include/rtems/confdefs/console.h
@@ -0,0 +1,85 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2020 embedded brains GmbH (http://www.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 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.
+ */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSApplicationConfiguration
+ *
+ * @brief Evaluate Console Driver Configuration Options
+ */
+
+#ifndef _RTEMS_CONFDEFS_SIMPLECONSOLE_H
+#define _RTEMS_CONFDEFS_SIMPLECONSOLE_H
+
+#ifndef __CONFIGURATION_TEMPLATE_h
+#error "Do not include this file directly, use  instead"
+#endif
+
+#ifdef CONFIGURE_INIT
+
+#if defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER) \
+  && defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER)
+  #error "CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER and 
CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER are mutually exclusive"
+#endif
+
+#if defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER) \
+  || defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER)
+
+#include 
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
+  RTEMS_SYSINIT_ITEM(
+_Console_simple_Initialize,
+RTEMS_SYSINIT_DEVICE_DRIVERS,
+RTEMS_SYSINIT_ORDER_SECOND
+  );
+#endif
+
+#ifdef CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER
+  RTEMS_SYSINIT_ITEM(
+_Console_simple_task_Initialize,
+RTEMS_SYSINIT_DEVICE_DRIVERS,
+RTEMS_SYSINIT_ORDER_SECOND
+  );
+#endif
+
+#ifdef __cplu

[PATCH v2 24/44] config: Add

2020-02-21 Thread Sebastian Huber
Derive copyright and license for new file form the file history.

Update #3875.
---
 cpukit/headers.am  |  1 +
 cpukit/include/rtems/confdefs.h| 47 +--
 cpukit/include/rtems/confdefs/libpci.h | 70 ++
 3 files changed, 72 insertions(+), 46 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/libpci.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index f0c8319dcb..658444cf9e 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -183,6 +183,7 @@ include_rtems_HEADERS += include/rtems/userenv.h
 include_rtems_HEADERS += include/rtems/version.h
 include_rtems_HEADERS += include/rtems/vmeintr.h
 include_rtems_HEADERS += include/rtems/watchdogdrv.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/obsolete.h
 include_rtems_debugger_HEADERS += include/rtems/debugger/rtems-debugger-bsp.h
 include_rtems_debugger_HEADERS += 
include/rtems/debugger/rtems-debugger-remote.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 1fecfdcbb6..b2a10902e4 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -51,6 +51,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -2658,52 +2659,6 @@ struct _reent *__getreent(void)
   #endif
 #endif
 
-/*
- *  Select PCI Configuration Library
- */
-#ifdef RTEMS_PCI_CONFIG_LIB
-  #ifdef CONFIGURE_INIT
-#define PCI_LIB_NONE 0
-#define PCI_LIB_AUTO 1
-#define PCI_LIB_STATIC 2
-#define PCI_LIB_READ 3
-#define PCI_LIB_PERIPHERAL 4
-#if CONFIGURE_PCI_LIB == PCI_LIB_AUTO
-  #define PCI_CFG_AUTO_LIB
-  #include 
-  struct pci_bus pci_hb;
-  #define PCI_LIB_INIT pci_config_auto
-  #define PCI_LIB_CONFIG pci_config_auto_register
-#elif CONFIGURE_PCI_LIB == PCI_LIB_STATIC
-  #define PCI_CFG_STATIC_LIB
-  #include 
-  #define PCI_LIB_INIT pci_config_static
-  #define PCI_LIB_CONFIG NULL
-  /* Let user define PCI configuration (struct pci_bus pci_hb) */
-#elif CONFIGURE_PCI_LIB == PCI_LIB_READ
-  #define PCI_CFG_READ_LIB
-  #include 
-  #define PCI_LIB_INIT pci_config_read
-  #define PCI_LIB_CONFIG NULL
-  struct pci_bus pci_hb;
-#elif CONFIGURE_PCI_LIB == PCI_LIB_PERIPHERAL
-  #define PCI_LIB_INIT pci_config_peripheral
-  #define PCI_LIB_CONFIG NULL
-  /* Let user define PCI configuration (struct pci_bus pci_hb) */
-#elif CONFIGURE_PCI_LIB == PCI_LIB_NONE
-  #define PCI_LIB_INIT NULL
-  #define PCI_LIB_CONFIG NULL
-  /* No PCI Configuration at all, user can use/debug access routines */
-#else
-  #error NO PCI LIBRARY DEFINED
-#endif
-
-const int pci_config_lib_type = CONFIGURE_PCI_LIB;
-int (*pci_config_lib_init)(void) = PCI_LIB_INIT;
-void (*pci_config_lib_register)(void *config) = PCI_LIB_CONFIG;
-  #endif
-#endif
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/cpukit/include/rtems/confdefs/libpci.h 
b/cpukit/include/rtems/confdefs/libpci.h
new file mode 100644
index 00..a68eea1903
--- /dev/null
+++ b/cpukit/include/rtems/confdefs/libpci.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2011 Cobham Gaisler AB
+ *
+ * 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.
+ */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSApplicationConfiguration
+ *
+ * @brief This header file evaluates PCI library configuration options.
+ */
+
+#ifndef _RTEMS_CONFDEFS_LIBPCI_H
+#define _RTEMS_CONFDEFS_LIBPCI_H
+
+#ifndef __CONFIGURATION_TEMPLATE_h
+#error "Do not include this file directly, use  instead"
+#endif
+
+/*
+ *  Select PCI Configuration Library
+ */
+#ifdef RTEMS_PCI_CONFIG_LIB
+  #ifdef CONFIGURE_INIT
+#define PCI_LIB_NONE 0
+#define PCI_LIB_AUTO 1
+#define PCI_LIB_STATIC 2
+#define PCI_LIB_READ 3
+#define PCI_LIB_PERIPHERAL 4
+#if CONFIGURE_PCI_LIB == PCI_LIB_AUTO
+  #define PCI_CFG_AUTO_LIB
+  #include 
+  struct pci_bus pci_hb;
+  #define PCI_LIB_INIT pci_config_auto
+  #define PCI_LIB_CONFIG pci_config_auto_register
+#elif CONFIGURE_PCI_LIB == PCI_LIB_STATIC
+  #define PCI_CFG_STATIC_LIB
+  #include 
+  #define PCI_LIB_INIT pci_config_static
+  #define PCI_LIB_CONFIG NULL
+  /* Let user define PCI configuration (struct pci_bus pci_hb) */
+#elif CONFIGURE_PCI_LIB == PCI_LIB_READ
+  #define PCI_CFG_READ_LIB
+  #include 
+  #define PCI_LIB_INIT pci_config_read
+  #define PCI_LIB_CONFIG NULL
+  struct pci_bus pci_hb;
+#elif CONFIGURE_PCI_LIB == PCI_LIB_PERIPHERAL
+  #define PCI_LIB_INIT pci_config_peripheral
+  #define PCI_LIB_CONFIG NULL
+  /* Let user define PCI configuration (struct pci_bus pci_hb) */
+#elif CONFIGURE_PCI_LIB == PCI_LIB_NONE
+  #define PCI_LIB_INIT NULL
+  #define PCI_LIB_CONFIG NUL

[PATCH v2 18/44] score: _Scheduler_Is_non_preempt_mode_supported()

2020-02-21 Thread Sebastian Huber
If the non-preempt mode for threads is supported depends on the
scheduler implementation.  Add
_Scheduler_Is_non_preempt_mode_supported() to indicate this.

Update #3876.
---
 cpukit/include/rtems/scheduler.h   | 16 
 cpukit/include/rtems/score/scheduler.h |  8 
 cpukit/include/rtems/score/schedulerimpl.h | 18 ++
 cpukit/rtems/src/taskmode.c|  9 ++---
 cpukit/score/src/threadinitialize.c|  5 -
 5 files changed, 52 insertions(+), 4 deletions(-)

diff --git a/cpukit/include/rtems/scheduler.h b/cpukit/include/rtems/scheduler.h
index dbc161a69d..955a83cfb4 100644
--- a/cpukit/include/rtems/scheduler.h
+++ b/cpukit/include/rtems/scheduler.h
@@ -26,6 +26,13 @@
 #define SCHEDULER_CONTEXT_NAME( name ) \
   _Configuration_Scheduler_ ## name
 
+#if defined(RTEMS_SMP)
+  #define SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( value ) \
+, value
+#else
+  #define SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( value )
+#endif
+
 #if defined(RTEMS_SMP)
   /* This object doesn't exist and indicates a configuration error */
   extern const Scheduler_Control RTEMS_SCHEDULER_INVALID_INDEX;
@@ -72,6 +79,7 @@
   SCHEDULER_CBS_ENTRY_POINTS, \
   SCHEDULER_CBS_MAXIMUM_PRIORITY, \
   ( obj_name ) \
+  SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( true ) \
 }
 
   /* Provided for backward compatibility */
@@ -98,6 +106,7 @@
   SCHEDULER_EDF_ENTRY_POINTS, \
   SCHEDULER_EDF_MAXIMUM_PRIORITY, \
   ( obj_name ) \
+  SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( true ) \
 }
 
   /* Provided for backward compatibility */
@@ -131,6 +140,7 @@
   SCHEDULER_EDF_SMP_ENTRY_POINTS, \
   SCHEDULER_EDF_MAXIMUM_PRIORITY, \
   ( obj_name ) \
+  SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( false ) \
 }
 
   /* Provided for backward compatibility */
@@ -162,6 +172,7 @@
 SCHEDULER_PRIORITY_CONTEXT_NAME( name ).Ready \
   ) - 1, \
   ( obj_name ) \
+  SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( true ) \
 }
 
   /* Provided for backward compatibility */
@@ -193,6 +204,7 @@
 SCHEDULER_PRIORITY_AFFINITY_SMP_CONTEXT_NAME( name ).Ready \
   ) - 1, \
   ( obj_name ) \
+  SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( false ) \
 }
 
   /* Provided for backward compatibility */
@@ -224,6 +236,7 @@
 SCHEDULER_PRIORITY_SMP_CONTEXT_NAME( name ).Ready \
   ) - 1, \
   ( obj_name ) \
+  SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( false ) \
 }
 
   /* Provided for backward compatibility */
@@ -255,6 +268,7 @@
 SCHEDULER_STRONG_APA_CONTEXT_NAME( name ).Ready \
   ) - 1, \
   ( obj_name ) \
+  SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( false ) \
 }
 
   /* Provided for backward compatibility */
@@ -282,6 +296,7 @@
   SCHEDULER_SIMPLE_ENTRY_POINTS, \
   SCHEDULER_SIMPLE_MAXIMUM_PRIORITY, \
   ( obj_name ) \
+  SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( true ) \
 }
 
   /* Provided for backward compatibility */
@@ -309,6 +324,7 @@
   SCHEDULER_SIMPLE_SMP_ENTRY_POINTS, \
   SCHEDULER_SIMPLE_SMP_MAXIMUM_PRIORITY, \
   ( obj_name ) \
+  SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( false ) \
 }
 
   /* Provided for backward compatibility */
diff --git a/cpukit/include/rtems/score/scheduler.h 
b/cpukit/include/rtems/score/scheduler.h
index 15effd462c..9a6515ba1e 100644
--- a/cpukit/include/rtems/score/scheduler.h
+++ b/cpukit/include/rtems/score/scheduler.h
@@ -289,6 +289,14 @@ struct _Scheduler_Control {
* @brief The scheduler name.
*/
   uint32_t name;
+
+#if defined(RTEMS_SMP)
+  /**
+   * @brief True if the non-preempt mode for threads is supported by the
+   * scheduler, otherwise false.
+   */
+  bool is_non_preempt_mode_supported;
+#endif
 };
 
 /**
diff --git a/cpukit/include/rtems/score/schedulerimpl.h 
b/cpukit/include/rtems/score/schedulerimpl.h
index dcc81fcbbf..e7fbb8b166 100644
--- a/cpukit/include/rtems/score/schedulerimpl.h
+++ b/cpukit/include/rtems/score/schedulerimpl.h
@@ -129,6 +129,24 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Release_critical(
 #endif
 }
 
+#if defined(RTEMS_SMP)
+/**
+ * @brief Indicate if the thread non-preempt mode is supported by the
+ * scheduler.
+ *
+ * @param scheduler The scheduler instance.
+ *
+ * @return True if the non-preempt mode for threads is supported by the
+ *   scheduler, otherwise false.
+ */
+RTEMS_INLINE_ROUTINE bool _Scheduler_Is_non_preempt_mode_supported(
+  const Scheduler_Control *scheduler
+)
+{
+  return scheduler->is_non_preempt_mode_supported;
+}
+#endif
+
 #if defined(RTEMS_SMP)
 void _Scheduler_Request_ask_for_help( Thread_Control *the_thread );
 
diff --git a/cpukit/rtems/src/taskmode.c b/cpukit/rtems/src/taskmode.c
index 8830f6bb5d..3ba5ce7f95 100644
--- a/cpukit/rtems/src/taskmode.c
+++ b/cpukit/rtems/src/taskmode.c
@@ -41,6 +41,8 @@ rtems_status_code rtems_task_mode(
   b

[PATCH v2 09/44] config: Add _Thread_Idle_body

2020-02-21 Thread Sebastian Huber
Move the idle thread body configuration constant out of the
configuration table.

Provide a default definition of the idle thread body constant.

Update #3875.
---
 cpukit/Makefile.am  |  1 +
 cpukit/include/rtems/confdefs.h |  7 +++---
 cpukit/include/rtems/config.h   |  8 +--
 cpukit/include/rtems/score/threadidledata.h | 13 +++
 cpukit/score/src/threadcreateidle.c |  3 +--
 cpukit/score/src/threadidledefault.c| 35 +
 6 files changed, 55 insertions(+), 12 deletions(-)
 create mode 100644 cpukit/score/src/threadidledefault.c

diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index 1adcbb3ae9..42e16d71e6 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -956,6 +956,7 @@ librtemscpu_a_SOURCES += score/src/threaddispatch.c
 librtemscpu_a_SOURCES += score/src/threadget.c
 librtemscpu_a_SOURCES += score/src/threadhandler.c
 librtemscpu_a_SOURCES += score/src/threadinitialize.c
+librtemscpu_a_SOURCES += score/src/threadidledefault.c
 librtemscpu_a_SOURCES += score/src/threadloadenv.c
 librtemscpu_a_SOURCES += score/src/threadrestart.c
 librtemscpu_a_SOURCES += score/src/threadsetstate.c
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 442ee7af92..ae1dca11e0 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -1092,10 +1092,12 @@ extern "C" {
 #ifndef CONFIGURE_IDLE_TASK_BODY
   #if defined(BSP_IDLE_TASK_BODY)
 #define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY
-  #else
-#define CONFIGURE_IDLE_TASK_BODY _CPU_Thread_Idle_body
   #endif
 #endif
+
+#if defined(CONFIGURE_INIT) && defined(CONFIGURE_IDLE_TASK_BODY)
+const Thread_Idle_body _Thread_Idle_body = CONFIGURE_IDLE_TASK_BODY;
+#endif
 /**@}*/ /* end of IDLE thread configuration */
 
 /**
@@ -2636,7 +2638,6 @@ struct _reent *__getreent(void)
*/
   const rtems_configuration_table Configuration = {
 CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */
-CONFIGURE_IDLE_TASK_BODY, /* user's IDLE task */
 #ifdef CONFIGURE_UNIFIED_WORK_AREAS   /* true for unified work areas */
   true,
 #else
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index 62804be41c..017b4ed476 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -87,12 +87,6 @@ typedef struct {
*/
   uintptr_t  work_space_size;
 
-  /** 
-   * This element points to the BSP's optional idle task which may override
-   * the default one provided with RTEMS.
-   */
-  void*(*idle_task)( uintptr_t );
-
   /**
* @brief Specifies if a unified work area is used or not.
*
@@ -155,7 +149,7 @@ uint32_t rtems_configuration_get_maximum_extensions( void );
 (_Watchdog_Ticks_per_timeslice)
 
 #define rtems_configuration_get_idle_task() \
-(Configuration.idle_task)
+(_Thread_Idle_entry)
 
 #define rtems_configuration_get_idle_task_stack_size() \
 (_Thread_Idle_stack_size)
diff --git a/cpukit/include/rtems/score/threadidledata.h 
b/cpukit/include/rtems/score/threadidledata.h
index 0011776ffa..79ac020576 100644
--- a/cpukit/include/rtems/score/threadidledata.h
+++ b/cpukit/include/rtems/score/threadidledata.h
@@ -56,6 +56,19 @@ extern "C" {
  */
 extern const size_t _Thread_Idle_stack_size;
 
+/**
+ * @brief The idle thread body type.
+ */
+typedef void *( *Thread_Idle_body )( uintptr_t );
+
+/**
+ * @brief The idle thread body.
+ *
+ * This constant is defined by the application configuration via
+ * .
+ */
+extern const Thread_Idle_body _Thread_Idle_body;
+
 /** @} */
 
 #ifdef __cplusplus
diff --git a/cpukit/score/src/threadcreateidle.c 
b/cpukit/score/src/threadcreateidle.c
index 66ed92702e..52c3ad4534 100644
--- a/cpukit/score/src/threadcreateidle.c
+++ b/cpukit/score/src/threadcreateidle.c
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
@@ -79,7 +78,7 @@ static void _Thread_Create_idle_for_CPU( Per_CPU_Control *cpu 
)
 
   idle->is_idle = true;
   idle->Start.Entry.adaptor = _Thread_Entry_adaptor_idle;
-  idle->Start.Entry.Kinds.Idle.entry = rtems_configuration_get_idle_task();
+  idle->Start.Entry.Kinds.Idle.entry = _Thread_Idle_body;
 
   _Thread_Load_environment( idle );
 
diff --git a/cpukit/score/src/threadidledefault.c 
b/cpukit/score/src/threadidledefault.c
new file mode 100644
index 00..6babe25d70
--- /dev/null
+++ b/cpukit/score/src/threadidledefault.c
@@ -0,0 +1,35 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2020 embedded brains GmbH (http://www.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 discla

[PATCH v2 22/44] config: Remove _Configure_Max_Objects()

2020-02-21 Thread Sebastian Huber
Use rtems_resource_maximum_per_allocation() directly.  The use of
_Configure_Zero_or_one() was superfluous.

Update #3875.
---
 cpukit/include/rtems/confdefs.h | 13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 50e4646083..a075470b88 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -1255,13 +1255,6 @@ const Thread_Idle_body _Thread_Idle_body = 
CONFIGURE_IDLE_TASK_BODY;
   #define _Configure_From_stackspace(_stack_size) \
 _Configure_From_workspace(_stack_size + CONTEXT_FP_SIZE)
 #endif
-
-/**
- * Do not use the unlimited bit as part of the multiplication
- * for memory usage.
- */
-#define _Configure_Max_Objects(_max) \
-  (_Configure_Zero_or_One(_max) * rtems_resource_maximum_per_allocation(_max))
 /**@}*/
 
 /**
@@ -2069,7 +2062,7 @@ struct _reent *__getreent(void)
  * of the object to be duplicated.
  */
 #define _Configure_POSIX_Named_Object_RAM(_number, _size) \
-  (_Configure_Max_Objects(_number) \
+  (rtems_resource_maximum_per_allocation(_number) \
 * _Configure_From_workspace(_POSIX_PATH_MAX + 1))
 
 /**
@@ -2293,7 +2286,7 @@ struct _reent *__getreent(void)
  * the stacks of all tasks.
  */
 #define _CONFIGURE_TASKS_STACK \
-  (_Configure_Max_Objects( _CONFIGURE_TASKS ) * \
+  (rtems_resource_maximum_per_allocation( _CONFIGURE_TASKS ) * \
 _Configure_From_stackspace( CONFIGURE_MINIMUM_TASK_STACK_SIZE ) )
 
 /*
@@ -2301,7 +2294,7 @@ struct _reent *__getreent(void)
  * the stacks of all POSIX threads.
  */
 #define _CONFIGURE_POSIX_THREADS_STACK \
-  (_Configure_Max_Objects( CONFIGURE_MAXIMUM_POSIX_THREADS ) * \
+  (rtems_resource_maximum_per_allocation( CONFIGURE_MAXIMUM_POSIX_THREADS ) * \
 _Configure_From_stackspace( CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE ) )
 
 #else /* CONFIGURE_EXECUTIVE_RAM_SIZE */
-- 
2.16.4

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 29/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am |   1 +
 cpukit/include/rtems/confdefs.h   | 100 +
 cpukit/include/rtems/confdefs/bdbuf.h | 161 ++
 3 files changed, 164 insertions(+), 98 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/bdbuf.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index 2cb59165bf..10014ee489 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -183,6 +183,7 @@ include_rtems_HEADERS += include/rtems/userenv.h
 include_rtems_HEADERS += include/rtems/version.h
 include_rtems_HEADERS += include/rtems/vmeintr.h
 include_rtems_HEADERS += include/rtems/watchdogdrv.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/bdbuf.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/bsp.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libio.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index ba37f0abe7..15e921629b 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -463,103 +464,6 @@ extern "C" {
 #endif
 /**@}*/ /* end of Device Driver Table Configuration */
 
-/**
- * @defgroup ConfigurationLibBlock Configuration of LIBBLOCK
- *
- * @addtogroup Configuration
- *
- * This module contains parameters related to the LIBBLOCK buffering
- * and caching subsystem. It requires tasks to swap out data to be
- * written to non-volatile storage.
- */
-/**@{*/
-#ifdef CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
-  #include 
-  /*
-   * configure the bdbuf cache parameters
-   */
-  #ifndef CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS
-#define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS \
-  RTEMS_BDBUF_MAX_READ_AHEAD_BLOCKS_DEFAULT
-  #endif
-  #ifndef CONFIGURE_BDBUF_MAX_WRITE_BLOCKS
-#define CONFIGURE_BDBUF_MAX_WRITE_BLOCKS \
-  RTEMS_BDBUF_MAX_WRITE_BLOCKS_DEFAULT
-  #endif
-  #ifndef CONFIGURE_SWAPOUT_TASK_PRIORITY
-#define CONFIGURE_SWAPOUT_TASK_PRIORITY \
-  RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT
-  #endif
-  #ifndef CONFIGURE_SWAPOUT_SWAP_PERIOD
-#define CONFIGURE_SWAPOUT_SWAP_PERIOD \
-  RTEMS_BDBUF_SWAPOUT_TASK_SWAP_PERIOD_DEFAULT
-  #endif
-  #ifndef CONFIGURE_SWAPOUT_BLOCK_HOLD
-#define CONFIGURE_SWAPOUT_BLOCK_HOLD \
-  RTEMS_BDBUF_SWAPOUT_TASK_BLOCK_HOLD_DEFAULT
-  #endif
-  #ifndef CONFIGURE_SWAPOUT_WORKER_TASKS
-#define CONFIGURE_SWAPOUT_WORKER_TASKS \
-  RTEMS_BDBUF_SWAPOUT_WORKER_TASKS_DEFAULT
-  #endif
-  #ifndef CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY
-#define CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY \
-  RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT
-  #endif
-  #ifndef CONFIGURE_BDBUF_TASK_STACK_SIZE
-#define CONFIGURE_BDBUF_TASK_STACK_SIZE \
-  RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT
-  #endif
-  #ifndef CONFIGURE_BDBUF_CACHE_MEMORY_SIZE
-#define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE \
-  RTEMS_BDBUF_CACHE_MEMORY_SIZE_DEFAULT
-  #endif
-  #ifndef CONFIGURE_BDBUF_BUFFER_MIN_SIZE
-#define CONFIGURE_BDBUF_BUFFER_MIN_SIZE \
-  RTEMS_BDBUF_BUFFER_MIN_SIZE_DEFAULT
-  #endif
-  #ifndef CONFIGURE_BDBUF_BUFFER_MAX_SIZE
-#define CONFIGURE_BDBUF_BUFFER_MAX_SIZE \
-  RTEMS_BDBUF_BUFFER_MAX_SIZE_DEFAULT
-  #endif
-  #ifndef CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY
-#define CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY \
-  RTEMS_BDBUF_READ_AHEAD_TASK_PRIORITY_DEFAULT
-  #endif
-  #ifdef CONFIGURE_INIT
-const rtems_bdbuf_config rtems_bdbuf_configuration = {
-  CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS,
-  CONFIGURE_BDBUF_MAX_WRITE_BLOCKS,
-  CONFIGURE_SWAPOUT_TASK_PRIORITY,
-  CONFIGURE_SWAPOUT_SWAP_PERIOD,
-  CONFIGURE_SWAPOUT_BLOCK_HOLD,
-  CONFIGURE_SWAPOUT_WORKER_TASKS,
-  CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY,
-  CONFIGURE_BDBUF_TASK_STACK_SIZE,
-  CONFIGURE_BDBUF_CACHE_MEMORY_SIZE,
-  CONFIGURE_BDBUF_BUFFER_MIN_SIZE,
-  CONFIGURE_BDBUF_BUFFER_MAX_SIZE,
-  CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY
-};
-  #endif
-
-  #define _CONFIGURE_LIBBLOCK_TASKS \
-(1 + CONFIGURE_SWAPOUT_WORKER_TASKS + \
-(CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS != 0))
-
-  #define _CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS \
-(_CONFIGURE_LIBBLOCK_TASKS * \
-(CONFIGURE_BDBUF_TASK_STACK_SIZE <= CONFIGURE_MINIMUM_TASK_STACK_SIZE ? \
-0 : CONFIGURE_BDBUF_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE))
-#else
-  /** This specifies the number of libblo

[PATCH v2 05/44] config: Remove CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE

2020-02-21 Thread Sebastian Huber
The CONFIGURE_HAS_OWN_INIT_TASK_TABLE and
CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE are the last *_HAS_OWN_*
configuration options.  These two options are probably unused, see also:

* https://lists.rtems.org/pipermail/users/2019-April/033129.html

* https://lists.rtems.org/pipermail/users/2019-April/033130.html

Removing them simplifies the configuration. If there is a real user need
which shows up after the removal, we can resurrect them on demand.

Using CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE would have required the
use of the undocumented CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME and
CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE configuration options.

Update #3874.
---
 cpukit/headers.am|  1 -
 cpukit/include/rtems/confdefs.h  | 51 --
 cpukit/include/rtems/config.h|  1 -
 cpukit/include/rtems/posix/config.h  | 60 -
 cpukit/include/rtems/posix/pthread.h | 25 +--
 cpukit/include/rtems/posix/pthreadimpl.h |  1 -
 cpukit/posix/src/pthreadinitthreads.c| 75 +---
 testsuites/psxtests/psxfatal01/init.c| 22 +-
 testsuites/psxtests/psxfatal02/init.c| 40 ++---
 9 files changed, 83 insertions(+), 193 deletions(-)
 delete mode 100644 cpukit/include/rtems/posix/config.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index 6f44b833e1..244e435c62 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -189,7 +189,6 @@ include_rtems_debugger_HEADERS += 
include/rtems/debugger/rtems-debugger-server.h
 include_rtems_posix_HEADERS += include/rtems/posix/aio_misc.h
 include_rtems_posix_HEADERS += include/rtems/posix/barrierimpl.h
 include_rtems_posix_HEADERS += include/rtems/posix/condimpl.h
-include_rtems_posix_HEADERS += include/rtems/posix/config.h
 include_rtems_posix_HEADERS += include/rtems/posix/key.h
 include_rtems_posix_HEADERS += include/rtems/posix/keyimpl.h
 include_rtems_posix_HEADERS += include/rtems/posix/mmanimpl.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 13ba4466f0..6a8b9ecb7e 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -2155,32 +2155,14 @@ struct _reent *__getreent(void)
 #endif
 
 #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
-  #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
-
-#ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
-  #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \
-CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE
-#endif
-
-#ifdef CONFIGURE_INIT
-  posix_initialization_threads_table POSIX_Initialization_threads[] = {
-{ CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT,
-  CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE }
-  };
-#endif
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME \
-  POSIX_Initialization_threads
+  #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
+#define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT   POSIX_Init
+  #endif
 
-#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 */
-  #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL
-  #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0
+  #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
+#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \
+  CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE
+  #endif
 #endif /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
 
 /**
@@ -2755,17 +2737,14 @@ struct _reent *__getreent(void)
  *  then we need to install the code that runs that loop.
  */
 #ifdef CONFIGURE_INIT
-  #if defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) || \
-  defined(CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE)
-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;
+  #if defined(CONFIGURE_POSIX_INIT_THREAD_TABLE)
+const posix_initialization_threads_table _POSIX_Threads_User_thread_table 
= {
+  CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT,
+  CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
+};
 
 RTEMS_SYSINIT_ITEM(
-  _POSIX_Threads_Initialize_user_threads_body,
+  _POSIX_Threads_Initialize_user_thread,
   RTEMS_SYSINIT_POSIX_USER_THREADS,
   RTEMS_SYSINIT_ORDER_MIDDLE
 );
@@ -2990,6 +2969,10 @@ struct _reent *__getreent(void)
   #warning "The CONFIGURE_MAXIMUM_PTYS configuration option is obsolete since 
RTEMS 5.1"
 #endif
 
+#ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
+  #warning "The CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE configuration option 
is obsolete since RTEMS 5.1"
+#endif
+
 #ifdef CONFIGURE_TERMIOS_DISABLED

[PATCH v2 30/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Move the default configuration to library files so that application
configurations do not include the definitions for the default case.

Update #3053.
Update #3875.
---
 cpukit/Makefile.am   |  2 +
 cpukit/headers.am|  1 +
 cpukit/include/rtems/confdefs.h  | 40 +---
 cpukit/include/rtems/confdefs/malloc.h   | 72 
 cpukit/libcsupport/src/mallocdirtydefault.c  | 34 +
 cpukit/libcsupport/src/mallocextenddefault.c | 35 ++
 6 files changed, 145 insertions(+), 39 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/malloc.h
 create mode 100644 cpukit/libcsupport/src/mallocdirtydefault.c
 create mode 100644 cpukit/libcsupport/src/mallocextenddefault.c

diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index 189f525b7d..85b427848a 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -171,6 +171,8 @@ librtemscpu_a_SOURCES += libcsupport/src/lstat.c
 librtemscpu_a_SOURCES += libcsupport/src/malloc.c
 librtemscpu_a_SOURCES += libcsupport/src/malloc_deferred.c
 librtemscpu_a_SOURCES += libcsupport/src/malloc_dirtier.c
+librtemscpu_a_SOURCES += libcsupport/src/mallocdirtydefault.c
+librtemscpu_a_SOURCES += libcsupport/src/mallocextenddefault.c
 librtemscpu_a_SOURCES += libcsupport/src/mallocfreespace.c
 librtemscpu_a_SOURCES += libcsupport/src/mallocgetheapptr.c
 librtemscpu_a_SOURCES += libcsupport/src/mallocinfo.c
diff --git a/cpukit/headers.am b/cpukit/headers.am
index 10014ee489..84e9523718 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -187,6 +187,7 @@ include_rtems_confdefs_HEADERS += 
include/rtems/confdefs/bdbuf.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/bsp.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libio.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/malloc.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/obsolete.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/percpu.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/scheduler.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 15e921629b..4f1ba45de8 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -53,6 +53,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -103,45 +104,6 @@ extern "C" {
   #undef RTEMS_NEWLIB
 #endif
 
-/**
- * @defgroup ConfigurationMalloc RTEMS Malloc configuration
- *
- * This module contains parameters related to configuration of the RTEMS
- * Malloc implementation.
- */
-/**@{*/
-#include 
-
-#ifdef CONFIGURE_INIT
-  /**
-   * This configures the sbrk() support for the malloc family.
-   * By default it is assumed that the BSP provides all available
-   * RAM to the malloc family implementation so sbrk()'ing to get
-   * more memory would always fail anyway.
-   */
-  const rtems_heap_extend_handler rtems_malloc_extend_handler =
-#ifdef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK
-  rtems_heap_extend_via_sbrk;
-#else
-  rtems_heap_null_extend;
-#endif
-#endif
-
-#ifdef CONFIGURE_INIT
-  /**
-   * This configures the malloc family plugin which dirties memory
-   * allocated.  This is helpful for finding unitialized data structure
-   * problems.
-   */
-  rtems_malloc_dirtier_t rtems_malloc_dirty_helper =
-#if defined(CONFIGURE_MALLOC_DIRTY)
-  rtems_malloc_dirty_memory;
-#else
-  NULL;
-#endif
-#endif
-/**@}*/  /* end of Malloc Configuration */
-
 /**
  * @defgroup ConfigurationHelpers Configuration Helpers
  *
diff --git a/cpukit/include/rtems/confdefs/malloc.h 
b/cpukit/include/rtems/confdefs/malloc.h
new file mode 100644
index 00..78cca6f3e3
--- /dev/null
+++ b/cpukit/include/rtems/confdefs/malloc.h
@@ -0,0 +1,72 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2020 embedded brains GmbH (http://www.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 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 DIREC

[PATCH v2 17/44] config: CONFIGURE_INIT_TASK_INITIAL_MODES

2020-02-21 Thread Sebastian Huber
Determine the default for CONFIGURE_INIT_TASK_INITIAL_MODES depeding on
whether RTEMS_SMP is defined or not.

In the tests, use CONFIGURE_INIT_TASK_INITIAL_MODES to explicitly
request RTEMS_NO_PREEMPT mode if necessary.

Update #3876.
---
 cpukit/include/rtems/confdefs.h   | 2 +-
 testsuites/sptests/sp66/init.c| 1 +
 testsuites/sptests/spsimplesched02/init.c | 2 ++
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 0191392cfc..0fc2d0e5a6 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -1343,7 +1343,7 @@ const Thread_Idle_body _Thread_Idle_body = 
CONFIGURE_IDLE_TASK_BODY;
  * used to specify the initial execution mode of the single Classic API task.
  */
 #ifndef CONFIGURE_INIT_TASK_INITIAL_MODES
-  #ifdef _CONFIGURE_SMP_APPLICATION
+  #ifdef RTEMS_SMP
 #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES
   #else
 #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT
diff --git a/testsuites/sptests/sp66/init.c b/testsuites/sptests/sp66/init.c
index f2bf46d049..3dd8e75a32 100644
--- a/testsuites/sptests/sp66/init.c
+++ b/testsuites/sptests/sp66/init.c
@@ -1,2 +1,3 @@
 #define INHERIT_CEILING
+#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT
 #include "../sp65/sp65impl.h"
diff --git a/testsuites/sptests/spsimplesched02/init.c 
b/testsuites/sptests/spsimplesched02/init.c
index b7b1a21919..4a08a6c8ac 100644
--- a/testsuites/sptests/spsimplesched02/init.c
+++ b/testsuites/sptests/spsimplesched02/init.c
@@ -154,6 +154,8 @@ rtems_task Init(
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
 #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
+
+#define CONFIGURE_INIT_TASK_INITIAL_MODES   RTEMS_NO_PREEMPT
 #define CONFIGURE_INIT_TASK_PRIORITY4
 
 #define CONFIGURE_DISABLE_SMP_CONFIGURATION
-- 
2.16.4

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 20/44] config: Remove CONFIGURE_DISABLE_SMP_CONFIGURATION

2020-02-21 Thread Sebastian Huber
The CONFIGURE_DISABLE_SMP_CONFIGURATION configuration option and
rtems_configuration_is_smp_enabled() were added during the SMP support
development cycle as a workaround to fix some testsuite failures in SMP
configurations.  All use cases were replaced with tests for specific
conditions.  The configuration option and test macro were undocumented.

Close #3876.
---
 cpukit/include/rtems/confdefs.h   | 19 ---
 cpukit/include/rtems/config.h | 13 -
 cpukit/include/rtems/score/smp.h  | 13 -
 testsuites/ada/support/initimpl.h |  2 --
 testsuites/libtests/block08/system.h  |  2 --
 testsuites/libtests/cpuuse/system.h   |  2 --
 testsuites/libtests/rtmonuse/system.h |  1 -
 testsuites/libtests/termios05/init.c  |  2 --
 testsuites/smptests/smpunsupported01/init.c   |  2 --
 testsuites/sptests/sp01/system.h  |  2 --
 testsuites/sptests/sp04/system.h  |  2 --
 testsuites/sptests/sp07/system.h  |  2 --
 testsuites/sptests/sp08/init.c|  2 --
 testsuites/sptests/sp12/system.h  |  2 --
 testsuites/sptests/sp13/system.h  |  2 --
 testsuites/sptests/sp14/system.h  |  2 --
 testsuites/sptests/sp16/system.h  |  2 --
 testsuites/sptests/sp20/system.h  |  2 --
 testsuites/sptests/sp37/system.h  |  2 --
 testsuites/sptests/sp65/sp65impl.h|  2 --
 testsuites/sptests/spcbssched01/system.h  |  2 --
 testsuites/sptests/spcbssched02/system.h  |  2 --
 testsuites/sptests/spcbssched03/system.h  |  2 --
 testsuites/sptests/spedfsched01/system.h  |  2 --
 testsuites/sptests/spedfsched02/system.h  |  2 --
 testsuites/sptests/spedfsched03/system.h  |  2 --
 testsuites/sptests/spfatal29/init.c   |  2 --
 testsuites/sptests/spfifo03/init.c|  2 --
 testsuites/sptests/spfifo05/init.c|  2 --
 .../sptests/spintrcritical06/spintrcritical06impl.h   |  2 --
 testsuites/sptests/spintrcritical15/init.c|  2 --
 testsuites/sptests/spmrsp01/init.c|  2 --
 testsuites/sptests/spsimplesched02/init.c |  2 --
 testsuites/tmtests/tm04/system.h  |  2 --
 testsuites/tmtests/tm08/system.h  |  2 --
 testsuites/tmtests/tm15/system.h  |  2 --
 testsuites/tmtests/tm20/system.h  |  2 --
 testsuites/tmtests/tm22/system.h  |  2 --
 testsuites/tmtests/tm24/system.h  |  2 --
 39 files changed, 116 deletions(-)

diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 0fc2d0e5a6..fa19be0184 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -161,18 +161,6 @@ extern "C" {
   #define _CONFIGURE_MAXIMUM_PROCESSORS 1
 #endif
 
-/*
- * An internal define to indicate that this is an SMP application
- * configuration.
- */
-#ifdef RTEMS_SMP
-  #if !defined(CONFIGURE_DISABLE_SMP_CONFIGURATION)
-#define _CONFIGURE_SMP_APPLICATION
-  #elif _CONFIGURE_MAXIMUM_PROCESSORS > 1
-#error "CONFIGURE_DISABLE_SMP_CONFIGURATION and 
CONFIGURE_MAXIMUM_PROCESSORS > 1 makes no sense"
-  #endif
-#endif
-
 #ifdef CONFIGURE_SMP_APPLICATION
   #warning "CONFIGURE_SMP_APPLICATION is obsolete since RTEMS 5.1"
 #endif
@@ -2621,13 +2609,6 @@ struct _reent *__getreent(void)
   #endif
 
   #ifdef RTEMS_SMP
-const bool _SMP_Is_enabled =
-  #ifdef _CONFIGURE_SMP_APPLICATION
-true;
-  #else
-false;
-  #endif
-
 const uint32_t _SMP_Processor_configured_maximum =
   _CONFIGURE_MAXIMUM_PROCESSORS;
   #endif
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index 4811d0e704..e82c7abf11 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -150,19 +150,6 @@ uint32_t rtems_configuration_get_maximum_extensions( void 
);
 NULL
 #endif
 
-/**
- * @brief Returns true if the SMP mode of operation is enabled, and false
- * otherwise.
- *
- * In uni-processor configurations this is a compile-time constant which
- * evaluates to false.
- *
- * @retval true SMP mode of operation is enabled.
- * @retval false Otherwise.
- */
-#define rtems_configuration_is_smp_enabled() \
-  (_SMP_Is_enabled)
-
 /**
  * @brief Returns the configured maximum count of processors.
  *
diff --git a/cpukit/include/rtems/score/smp.h b/cpukit/include/rtems/score/smp.h
index 36cfd981ab..2722fbdcee 100644
--- a/cpukit/include/rtems/score/smp.h
+++ b/cpukit/include/rtems/score/smp.h
@@ -36,19 +36,6 @@ extern "C" {
  * @{
  */
 
-/**
- * @brief Indicates if SMP is enabled.
- *
- * I

[PATCH v2 27/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am |   1 +
 cpukit/include/rtems/confdefs.h   | 449 +-
 cpukit/include/rtems/confdefs/libio.h | 410 +++
 3 files changed, 412 insertions(+), 448 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/libio.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index e0b5af6402..f64e9867ff 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -184,6 +184,7 @@ include_rtems_HEADERS += include/rtems/version.h
 include_rtems_HEADERS += include/rtems/vmeintr.h
 include_rtems_HEADERS += include/rtems/watchdogdrv.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/bsp.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/libio.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/obsolete.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/percpu.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 240dd855cc..a51693834b 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -100,441 +101,6 @@ extern "C" {
   #undef RTEMS_NEWLIB
 #endif
 
-#ifndef RTEMS_SCHEDSIM
-#include 
-
-#ifdef CONFIGURE_INIT
-  #ifndef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
-RTEMS_SYSINIT_ITEM(
-  rtems_filesystem_initialize,
-  RTEMS_SYSINIT_ROOT_FILESYSTEM,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
-  #endif
-#endif
-#endif
-
-/**
- * This macro defines the number of POSIX file descriptors allocated
- * and managed by libio.  These are the "integer" file descriptors that
- * are used by calls like open(2) and read(2).
- */
-#ifndef CONFIGURE_MAXIMUM_FILE_DESCRIPTORS
-  #define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 3
-#endif
-
-#ifdef CONFIGURE_INIT
-  rtems_libio_t rtems_libio_iops[CONFIGURE_MAXIMUM_FILE_DESCRIPTORS];
-
-  /**
-   * When instantiating the configuration tables, this variable is
-   * initialized to specify the maximum number of file descriptors.
-   */
-  const uint32_t rtems_libio_number_iops = RTEMS_ARRAY_SIZE(rtems_libio_iops);
-#endif
-
-/*
- * This sets up the resources for the FIFOs/pipes.
- */
-
-/**
- *  @defgroup ConfigFilesystems Filesystems and Mount Table Configuration
- *
- *  @ingroup Configuration
- *
- *  Defines to control the file system:
- *
- *   - CONFIGURE_APPLICATION_DISABLE_FILESYSTEM:
- * Disable the RTEMS filesystems. You get an empty DEVFS.
- *
- *   - CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM:
- * Use the DEVFS as the root file system. Limited functions are
- * provided when this is used.
- *
- *   - CONFIGURE_FILESYSTEM_ALL:
- * Add file filesystems to the default filesystem table.
- *
- *   List of available file systems. You can define as many as you like:
- * - CONFIGURE_FILESYSTEM_IMFS   - In Memory File System (IMFS)
- * - CONFIGURE_FILESYSTEM_DEVFS  - Device File System (DSVFS)
- * - CONFIGURE_FILESYSTEM_TFTPFS - TFTP File System, networking enabled
- * - CONFIGURE_FILESYSTEM_FTPFS  - FTP File System, networking enabled
- * - CONFIGURE_FILESYSTEM_NFS- Network File System, networking enabled
- * - CONFIGURE_FILESYSTEM_DOSFS  - DOS File System, uses libblock
- * - CONFIGURE_FILESYSTEM_RFS- RTEMS File System (RFS), uses libblock
- * - CONFIGURE_FILESYSTEM_JFFS2  - Journalling Flash File System, Version 2
- *
- *   Combinations:
- *
- *- If nothing is defined the base file system is the IMFS.
- *
- *- If CONFIGURE_APPLICATION_DISABLE_FILESYSTEM is defined all filesystems
- *  are disabled by force.
- *
- *- If CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM is defined all filesystems
- *  are disabled by force and DEVFS is defined.
- */
-/**@{*/
-
-#ifdef CONFIGURE_INIT
-
-  /*
-   * Include all file systems. Do this before checking if the filesystem has
-   * been disabled.
-   */
-  #ifdef CONFIGURE_FILESYSTEM_ALL
-#define CONFIGURE_FILESYSTEM_IMFS
-#define CONFIGURE_FILESYSTEM_DEVFS
-#define CONFIGURE_FILESYSTEM_TFTPFS
-#define CONFIGURE_FILESYSTEM_FTPFS
-#define CONFIGURE_FILESYSTEM_NFS
-#define CONFIGURE_FILESYSTEM_DOSFS
-#define CONFIGURE_FILESYSTEM_RFS
-#define CONFIGURE_FILESYSTEM_JFFS2
-  #endif
-
-  /*
-   * If disabling the file system, give a compile error if the user has
-   * configured other filesystem parameters.
-   */
-  #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM)
- #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
-   #error "Filesystem disabled and a base filesystem configured."
- #endif
-
- #if defined(CONFIGURE_FILESYSTEM_IMFS) || \
-   defined(CONFIGURE_FILESYSTEM_DEVFS) || \
-   defined(CONFIGURE_FILESYSTEM_TFTPFS) || \
-   defined(CON

[PATCH v2 41/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am  |   1 +
 cpukit/include/rtems/confdefs.h| 114 +-
 cpukit/include/rtems/confdefs/objectsclassic.h | 127 +
 3 files changed, 129 insertions(+), 113 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/objectsclassic.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index 2a7e5a8116..d057c6e7d2 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -196,6 +196,7 @@ include_rtems_confdefs_HEADERS += 
include/rtems/confdefs/libpci.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/malloc.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/mpci.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/newlib.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/objectsclassic.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/obsolete.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/percpu.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/scheduler.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 82b6f11774..ef1200419b 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -30,14 +30,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -58,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -146,76 +139,6 @@ extern "C" {
 #endif
 /**@}*/
 
-/**
- * @defgroup ConfigurationClassicAPI Classic API Configuration
- *
- * @ingroup Configuration
- *
- * This module contains the parameters related to configuration
- * of the Classic API services.
- */
-/**@{*/
-
-#ifndef CONFIGURE_MAXIMUM_TIMERS
-  /** This specifies the maximum number of Classic API timers. */
-  #define CONFIGURE_MAXIMUM_TIMERS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_SEMAPHORES
-  /** This specifies the maximum number of Classic API semaphores. */
-  #define CONFIGURE_MAXIMUM_SEMAPHORES 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
-  /**
-   * This configuration parameter specifies the maximum number of
-   * Classic API Message Queues.
-   */
-  #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_PARTITIONS
-  /**
-   * This configuration parameter specifies the maximum number of
-   * Classic API Partitions.
-   */
-  #define CONFIGURE_MAXIMUM_PARTITIONS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_REGIONS
-  /**
-   * This configuration parameter specifies the maximum number of
-   * Classic API Regions.
-   */
-  #define CONFIGURE_MAXIMUM_REGIONS  0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_PORTS
-  /**
-   * This configuration parameter specifies the maximum number of
-   * Classic API Dual-Ported Memory Ports.
-   */
-  #define CONFIGURE_MAXIMUM_PORTS0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_PERIODS
-  /**
-   * This configuration parameter specifies the maximum number of
-   * Classic API Rate Monotonic Periods.
-   */
-  #define CONFIGURE_MAXIMUM_PERIODS  0
-#endif
-
-/**
- * This configuration parameter specifies the maximum number of
- * Classic API Barriers.
- */
-#ifndef CONFIGURE_MAXIMUM_BARRIERS
-  #define CONFIGURE_MAXIMUM_BARRIERS   0
-#endif
-
-/**@}*/ /* end of Classic API Configuration */
-
 /**
  * @defgroup ConfigurationPOSIXAPI POSIX API Configuration Parameters
  *
@@ -458,41 +381,6 @@ extern "C" {
   )
 
 #ifdef CONFIGURE_INIT
-  #if CONFIGURE_MAXIMUM_BARRIERS > 0
-BARRIER_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_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,
-  _CONFIGURE_SCHEDULER_COUNT
-);
-  #endif
-
-  #if CONFIGURE_MAXIMUM_TIMERS > 0
-TIMER_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_TIMERS );
-  #endif
-
   #if CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS > 0
 POSIX_Keys_Key_value_pair _POSIX_Keys_Key_value_pairs[
   rtems_resource_maximum_per_allocation(
diff --git a/cpukit/include/rtems/confdefs/objectsclassic.h 
b/cpukit/include/rtems/confdefs/objectsclassic.h
new file mode 100644
inde

[PATCH v2 21/44] config: Improve _Configure_From_workspace()

2020-02-21 Thread Sebastian Huber
Commit 4c09f4b3fefc7ba5c5868a97ad00c1ee14a06677 changed the cast from
size_t to ssize_t to try to fix an workspace issue on 16-bit
architectures.  This change was reverted by commit
7ff6115b8b913d848b8fe76daf72ca0b4bbf2548 for the workspace but not
_Configure_From_workspace().  Change the cast to uintptr_t to be in line
with the Heap Handler.
---
 cpukit/include/rtems/confdefs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index fa19be0184..50e4646083 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -1239,7 +1239,7 @@ const Thread_Idle_body _Thread_Idle_body = 
CONFIGURE_IDLE_TASK_BODY;
  * may be applied.
  */
 #define _Configure_From_workspace(_size) \
-  (ssize_t) (_Configure_Zero_or_One(_size) * \
+  (uintptr_t) (_Configure_Zero_or_One(_size) * \
 _Configure_Align_up(_size + HEAP_BLOCK_HEADER_SIZE, \
   _CONFIGURE_HEAP_MIN_BLOCK_SIZE))
 
-- 
2.16.4

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 11/44] config: Add _Workspace_Is_unified

2020-02-21 Thread Sebastian Huber
Move the unified workspace configuration constant out of the
configuration table.

Provide a default definition of the unified workspace constant.

Update #3875.
---
 cpukit/Makefile.am |  1 +
 cpukit/include/rtems/confdefs.h|  9 
 cpukit/include/rtems/config.h  | 10 +
 cpukit/include/rtems/score/wkspacedata.h   |  8 +++
 cpukit/score/src/wkspaceisunifieddefault.c | 34 ++
 5 files changed, 48 insertions(+), 14 deletions(-)
 create mode 100644 cpukit/score/src/wkspaceisunifieddefault.c

diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index 42e16d71e6..189f525b7d 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -1014,6 +1014,7 @@ librtemscpu_a_SOURCES += 
score/src/debugisthreaddispatchingallowed.c
 librtemscpu_a_SOURCES += score/src/interr.c
 librtemscpu_a_SOURCES += score/src/isr.c
 librtemscpu_a_SOURCES += score/src/wkspace.c
+librtemscpu_a_SOURCES += score/src/wkspaceisunifieddefault.c
 librtemscpu_a_SOURCES += score/src/wkstringduplicate.c
 librtemscpu_a_SOURCES += score/src/ioprintf.c
 librtemscpu_a_SOURCES += score/src/iovprintf.c
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 6057bf4ac5..33b1aa67d4 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -2637,11 +2637,6 @@ struct _reent *__getreent(void)
* This is the primary Configuration Table for this application.
*/
   const rtems_configuration_table Configuration = {
-#ifdef CONFIGURE_UNIFIED_WORK_AREAS   /* true for unified work areas */
-  true,
-#else
-  false,
-#endif
 #ifdef RTEMS_SMP
   #ifdef _CONFIGURE_SMP_APPLICATION
 true,
@@ -2656,6 +2651,10 @@ struct _reent *__getreent(void)
 
   const uintptr_t _Workspace_Size = CONFIGURE_EXECUTIVE_RAM_SIZE;
 
+  #ifdef CONFIGURE_UNIFIED_WORK_AREAS
+const bool _Workspace_Is_unified = true;
+  #endif
+
   #ifdef CONFIGURE_DIRTY_MEMORY
 RTEMS_SYSINIT_ITEM(
   _Memory_Dirty_free_areas,
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index 0b5527c76d..6489e4e4e8 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -83,14 +83,6 @@ typedef Stack_Allocator_free rtems_stack_free_hook;
  * + required number of each object type for each API configured
  */
 typedef struct {
-  /**
-   * @brief Specifies if a unified work area is used or not.
-   *
-   * If this element is @a true, then the RTEMS Workspace and the C Program
-   * Heap use the same heap, otherwise they use separate heaps.
-   */
-  bool   unified_work_area;
-
   #ifdef RTEMS_SMP
 bool smp_enabled;
   #endif
@@ -111,7 +103,7 @@ extern const rtems_configuration_table Configuration;
  */
 
 #define rtems_configuration_get_unified_work_area() \
-(Configuration.unified_work_area)
+(_Workspace_Is_unified)
 
 /**
  * @brief Return if the stack allocator avoids the work space.
diff --git a/cpukit/include/rtems/score/wkspacedata.h 
b/cpukit/include/rtems/score/wkspacedata.h
index b913c07f8e..9535890dc8 100644
--- a/cpukit/include/rtems/score/wkspacedata.h
+++ b/cpukit/include/rtems/score/wkspacedata.h
@@ -57,6 +57,14 @@ extern "C" {
  */
 extern const uintptr_t _Workspace_Size;
 
+/**
+ * @brief Indicates if the workspace and C program heap are unified.
+ *
+ * This constant is defined by the application configuration via
+ * .
+ */
+extern const bool _Workspace_Is_unified;
+
 /** @} */
 
 #ifdef __cplusplus
diff --git a/cpukit/score/src/wkspaceisunifieddefault.c 
b/cpukit/score/src/wkspaceisunifieddefault.c
new file mode 100644
index 00..80b79622a6
--- /dev/null
+++ b/cpukit/score/src/wkspaceisunifieddefault.c
@@ -0,0 +1,34 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2020 embedded brains GmbH (http://www.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 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 

[PATCH v2 10/44] config: Add _Workspace_Size

2020-02-21 Thread Sebastian Huber
Move the workspace size configuration constant out of the configuration
table.

Update #3875.
---
 cpukit/headers.am|  1 +
 cpukit/include/rtems/confdefs.h  |  3 +-
 cpukit/include/rtems/config.h|  8 +---
 cpukit/include/rtems/score/wkspacedata.h | 66 
 4 files changed, 71 insertions(+), 7 deletions(-)
 create mode 100644 cpukit/include/rtems/score/wkspacedata.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index 351e942cea..6e1ab4ccd0 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -408,6 +408,7 @@ include_rtems_score_HEADERS += 
include/rtems/score/watchdog.h
 include_rtems_score_HEADERS += include/rtems/score/watchdogimpl.h
 include_rtems_score_HEADERS += include/rtems/score/watchdogticks.h
 include_rtems_score_HEADERS += include/rtems/score/wkspace.h
+include_rtems_score_HEADERS += include/rtems/score/wkspacedata.h
 include_rtems_trace_HEADERS += include/rtems/trace/rtems-trace-buffer-vars.h
 include_sys_HEADERS += include/sys/_ffcounter.h
 include_sys_HEADERS += include/sys/cdefs_elf.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index ae1dca11e0..6057bf4ac5 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -2637,7 +2637,6 @@ struct _reent *__getreent(void)
* This is the primary Configuration Table for this application.
*/
   const rtems_configuration_table Configuration = {
-CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */
 #ifdef CONFIGURE_UNIFIED_WORK_AREAS   /* true for unified work areas */
   true,
 #else
@@ -2655,6 +2654,8 @@ struct _reent *__getreent(void)
 #endif
   };
 
+  const uintptr_t _Workspace_Size = CONFIGURE_EXECUTIVE_RAM_SIZE;
+
   #ifdef CONFIGURE_DIRTY_MEMORY
 RTEMS_SYSINIT_ITEM(
   _Memory_Dirty_free_areas,
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index 017b4ed476..0b5527c76d 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #if defined(RTEMS_MULTIPROCESSING)
@@ -82,11 +83,6 @@ typedef Stack_Allocator_free rtems_stack_free_hook;
  * + required number of each object type for each API configured
  */
 typedef struct {
-  /**
-   * This field specifies the size in bytes of the RTEMS Workspace.
-   */
-  uintptr_t  work_space_size;
-
   /**
* @brief Specifies if a unified work area is used or not.
*
@@ -132,7 +128,7 @@ extern const rtems_configuration_table Configuration;
 uintptr_t rtems_configuration_get_stack_space_size( void );
 
 #define rtems_configuration_get_work_space_size() \
-(Configuration.work_space_size + \
+(_Workspace_Size + \
   (rtems_configuration_get_stack_allocator_avoids_work_space() ? \
 0 : rtems_configuration_get_stack_space_size()))
 
diff --git a/cpukit/include/rtems/score/wkspacedata.h 
b/cpukit/include/rtems/score/wkspacedata.h
new file mode 100644
index 00..b913c07f8e
--- /dev/null
+++ b/cpukit/include/rtems/score/wkspacedata.h
@@ -0,0 +1,66 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2020 embedded brains GmbH (http://www.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 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.
+ */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreWorkspace
+ *
+ * @brief Constants defined by the application configuration for the idle
+ * threads.
+ */
+
+#ifndef _RTEMS_SCORE_WKSPACEDATA_H
+#define _RTEMS_SCORE_WKSPACEDATA_H
+
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup RTEMSScoreWorkspace
+ *
+ * @{
+ */
+
+/**

[PATCH v2 31/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am|   1 +
 cpukit/include/rtems/confdefs.h  | 116 +--
 cpukit/include/rtems/confdefs/mpci.h | 147 +++
 3 files changed, 149 insertions(+), 115 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/mpci.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index 84e9523718..20059a7909 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -188,6 +188,7 @@ include_rtems_confdefs_HEADERS += 
include/rtems/confdefs/bsp.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libio.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/malloc.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/mpci.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/obsolete.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/percpu.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/scheduler.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 4f1ba45de8..a28e277311 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -54,6 +54,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -426,108 +427,6 @@ extern "C" {
 #endif
 /**@}*/ /* end of Device Driver Table Configuration */
 
-/**
- * @defgroup ConfigurationMultiprocessing Multiprocessing Configuration
- *
- * @addtogroup Configuration
- *
- * This module contains the parameters related to the Multiprocessing
- * configuration of RTEMS.
- *
- * In a single processor or SMP configuration, only two parameters are
- * needed and they are defaulted. The user should not have to specify
- * any parameters.
- */
-/**@{*/
-
-/**
- * This defines the extra stack space required for the MPCI server thread.
- */
-#ifndef CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK
-  #define CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 0
-#endif
-
-#if defined(RTEMS_MULTIPROCESSING)
-  /*
-   *  Default Multiprocessing Configuration Table.  The defaults are
-   *  appropriate for most of the RTEMS Multiprocessor Test Suite.  Each
-   *  value may be overridden within each test to customize the environment.
-   */
-
-  #ifdef CONFIGURE_MP_APPLICATION
-#ifndef CONFIGURE_MP_NODE_NUMBER
-  #define CONFIGURE_MP_NODE_NUMBERNODE_NUMBER
-#endif
-
-#ifndef CONFIGURE_MP_MAXIMUM_NODES
-  #define CONFIGURE_MP_MAXIMUM_NODES  2
-#endif
-
-#ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
-  #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 32
-#endif
-
-#ifndef CONFIGURE_MP_MAXIMUM_PROXIES
-  #define CONFIGURE_MP_MAXIMUM_PROXIES32
-#endif
-
-#ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
-  #include 
-  #define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table
-#endif
-
-#ifdef CONFIGURE_INIT
-  #if CONFIGURE_MP_NODE_NUMBER < 1
-#error "CONFIGURE_MP_NODE_NUMBER must be greater than or equal to one"
-  #endif
-
-  #if CONFIGURE_MP_NODE_NUMBER > CONFIGURE_MP_MAXIMUM_NODES
-#error "CONFIGURE_MP_NODE_NUMBER must be less than or equal to 
CONFIGURE_MP_MAXIMUM_NODES"
-  #endif
-
-  Objects_MP_Control _Objects_MP_Controls[
-CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
-  ];
-
-  struct Thread_Configured_proxy_control {
-Thread_Proxy_control Control;
-Thread_queue_Configured_heads Heads;
-  };
-
-  static Thread_Configured_proxy_control _Thread_MP_Configured_proxies[
-CONFIGURE_MP_MAXIMUM_PROXIES
-  ];
-
-  Thread_Configured_proxy_control * const _Thread_MP_Proxies =
-&_Thread_MP_Configured_proxies[ 0 ];
-
-  const MPCI_Configuration _MPCI_Configuration = {
-CONFIGURE_MP_NODE_NUMBER,   /* local node number */
-CONFIGURE_MP_MAXIMUM_NODES, /* maximum # nodes */
-CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS,/* maximum # global objects */
-CONFIGURE_MP_MAXIMUM_PROXIES,   /* maximum # proxies */
-CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK, /* MPCI stack > minimum */
-CONFIGURE_MP_MPCI_TABLE_POINTER /* ptr to MPCI config table */
-  };
-
-  char _MPCI_Receive_server_stack[
-CONFIGURE_MINIMUM_TASK_STACK_SIZE
-  + CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK
-  + CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK
-  + CPU_ALL_TASKS_ARE_FP * CONTEXT_FP_SIZE
-  ] RTEMS_ALIGNED( CPU_INTERRUPT_STACK_ALIGNMENT )
-  RTEMS_SECTION( ".rtemsstack.mpci" );
-#endif
-
-#define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 1
-  #else
-#define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 0
-  #endif /* CONFIGURE_MP_APPLICATION */
-#else
-  #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 0
-#endif /* RTEMS_MULTIPROCESSING */
-

[PATCH v2 23/44] config: Add

2020-02-21 Thread Sebastian Huber
Unify handling of obsolete configuration options.  Remove comments and
copyrightable content from the moved content.  Use BSD-2-Clause license
for new file.

Update #3053.
Update #3875.
---
 cpukit/header-dirs.am|   2 +
 cpukit/headers.am|   1 +
 cpukit/include/rtems/confdefs.h  | 167 +-
 cpukit/include/rtems/confdefs/obsolete.h | 234 +++
 4 files changed, 238 insertions(+), 166 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/obsolete.h

diff --git a/cpukit/header-dirs.am b/cpukit/header-dirs.am
index 7197f1a29f..d90271be9e 100644
--- a/cpukit/header-dirs.am
+++ b/cpukit/header-dirs.am
@@ -50,6 +50,8 @@ include_rtems_bfindir = $(includedir)/rtems/bfin
 include_rtems_bfin_HEADERS =
 include_rtems_bsdnetdir = $(includedir)/rtems/bsdnet
 include_rtems_bsdnet_HEADERS =
+include_rtems_confdefsdir = $(includedir)/rtems/confdefs
+include_rtems_confdefs_HEADERS =
 include_rtems_debuggerdir = $(includedir)/rtems/debugger
 include_rtems_debugger_HEADERS =
 include_rtems_m68kdir = $(includedir)/rtems/m68k
diff --git a/cpukit/headers.am b/cpukit/headers.am
index 6e1ab4ccd0..f0c8319dcb 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -183,6 +183,7 @@ include_rtems_HEADERS += include/rtems/userenv.h
 include_rtems_HEADERS += include/rtems/version.h
 include_rtems_HEADERS += include/rtems/vmeintr.h
 include_rtems_HEADERS += include/rtems/watchdogdrv.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/obsolete.h
 include_rtems_debugger_HEADERS += include/rtems/debugger/rtems-debugger-bsp.h
 include_rtems_debugger_HEADERS += 
include/rtems/debugger/rtems-debugger-remote.h
 include_rtems_debugger_HEADERS += 
include/rtems/debugger/rtems-debugger-server.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index a075470b88..1fecfdcbb6 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -125,11 +126,6 @@ extern "C" {
 #endif
 #endif
 
-#ifdef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
-  #warning "CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS has been renamed to 
CONFIGURE_MAXIMUM_FILE_DESCRIPTORS since RTEMS 5.1"
-  #define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 
CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
-#endif
-
 /**
  * This macro defines the number of POSIX file descriptors allocated
  * and managed by libio.  These are the "integer" file descriptors that
@@ -149,11 +145,6 @@ extern "C" {
   const uint32_t rtems_libio_number_iops = RTEMS_ARRAY_SIZE(rtems_libio_iops);
 #endif
 
-#ifdef CONFIGURE_SMP_MAXIMUM_PROCESSORS
-  #warning "CONFIGURE_SMP_MAXIMUM_PROCESSORS has been renamed to 
CONFIGURE_MAXIMUM_PROCESSORS since RTEMS 5.1"
-  #define CONFIGURE_MAXIMUM_PROCESSORS CONFIGURE_SMP_MAXIMUM_PROCESSORS
-#endif
-
 /* Ensure that _CONFIGURE_MAXIMUM_PROCESSORS > 1 only in SMP configurations */
 #if defined(CONFIGURE_MAXIMUM_PROCESSORS) && defined(RTEMS_SMP)
   #define _CONFIGURE_MAXIMUM_PROCESSORS CONFIGURE_MAXIMUM_PROCESSORS
@@ -161,34 +152,10 @@ extern "C" {
   #define _CONFIGURE_MAXIMUM_PROCESSORS 1
 #endif
 
-#ifdef CONFIGURE_SMP_APPLICATION
-  #warning "CONFIGURE_SMP_APPLICATION is obsolete since RTEMS 5.1"
-#endif
-
 /*
  * This sets up the resources for the FIFOs/pipes.
  */
 
-/**
- * This is specified to configure the maximum number of POSIX FIFOs.
- */
-#ifdef CONFIGURE_MAXIMUM_FIFOS
-  #warning "CONFIGURE_MAXIMUM_FIFOS is obsolete since RTEMS 5.1; use 
CONFIGURE_IMFS_ENABLE_MKFIFO instead"
-  #if CONFIGURE_MAXIMUM_FIFOS > 0
-#define CONFIGURE_IMFS_ENABLE_MKFIFO
-  #endif
-#endif
-
-/**
- * This is specified to configure the maximum number of POSIX named pipes.
- */
-#ifdef CONFIGURE_MAXIMUM_PIPES
-  #warning "CONFIGURE_MAXIMUM_PIPES is obsolete since RTEMS 5.1; use 
CONFIGURE_IMFS_ENABLE_MKFIFO instead"
-  #if CONFIGURE_MAXIMUM_PIPES > 0
-#define CONFIGURE_IMFS_ENABLE_MKFIFO
-  #endif
-#endif
-
 /**
  *  @defgroup ConfigFilesystems Filesystems and Mount Table Configuration
  *
@@ -587,14 +554,6 @@ extern "C" {
 #endif
 /**@}*/ /* end of file system group */
 
-/*
- *  STACK_CHECKER_ON was still available in 4.9 so give a warning for now.
- */
-#if defined(STACK_CHECKER_ON)
-  #define CONFIGURE_STACK_CHECKER_ENABLED
-  #warning "STACK_CHECKER_ON deprecated -- use CONFIGURE_STACK_CHECKER_ENABLED"
-#endif
-
 /**
  * @brief Maximum priority configuration.
  *
@@ -663,21 +622,6 @@ extern "C" {
  *- CONFIGURE_SCHEDULER_USER_PER_THREAD
  */
 
-#ifdef CONFIGURE_SCHEDULER_CONTEXT
-  #warning "CONFIGURE_SCHEDULER_CONTEXT has been renamed to 
CONFIGURE_SCHEDULER since RTEMS 5.1"
-  #define CONFIGURE_SCHEDULER CONFIGURE_SCHEDULER_CONTEXT
-#endif
-
-#ifdef CONFIGURE_SCHEDULER_CONTROLS
-  #warning "CONFIGURE_SCHEDULER_CONTROLS has been renamed to 
CONFIGURE_SCHEDULER_TABLE_ENTRIES since RTEMS 5.1"
-  #define CONFIGURE_SCHEDULER_TABLE_ENTRIES CONFIGURE_SCHEDULER_CON

[PATCH v2 19/44] rtems: Change timer server task mode setting

2020-02-21 Thread Sebastian Huber
Use the non-preempt mode only in uni-processor configurations.

Update #3876.
---
 cpukit/rtems/src/timerserver.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/cpukit/rtems/src/timerserver.c b/cpukit/rtems/src/timerserver.c
index 2ebceca1ba..1a332b89ec 100644
--- a/cpukit/rtems/src/timerserver.c
+++ b/cpukit/rtems/src/timerserver.c
@@ -181,11 +181,13 @@ static rtems_status_code _Timer_server_Initiate(
 rtems_build_name('T','I','M','E'),
 priority,
 stack_size,
-rtems_configuration_is_smp_enabled() ?
-  RTEMS_DEFAULT_MODES : /* no preempt is not supported for SMP */
-  RTEMS_NO_PREEMPT,   /* no preempt is like an interrupt */
-  /* user may want floating point but we need */
-  /*   system task specified for 0 priority */
+#ifdef RTEMS_SMP
+RTEMS_DEFAULT_MODES, /* no preempt is not recommended for SMP */
+#else
+RTEMS_NO_PREEMPT,/* no preempt is like an interrupt */
+#endif
+/* user may want floating point but we need */
+/*   system task specified for 0 priority */
 attribute_set | RTEMS_SYSTEM_TASK,
 &id
   );
-- 
2.16.4

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 13/44] config: Add _SMP_Is_enabled

2020-02-21 Thread Sebastian Huber
Move the is SMP enabled configuration constant out of the
configuration table.

Since this was the last configuration constant in
rtems_configuration_table, remove this type.

Update #3875.
---
 cpukit/include/rtems/confdefs.h  | 14 --
 cpukit/include/rtems/config.h| 31 ++-
 cpukit/include/rtems/score/smp.h | 13 +
 3 files changed, 19 insertions(+), 39 deletions(-)

diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index f8a4eb23cf..3741c9a706 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -2633,20 +2633,14 @@ struct _reent *__getreent(void)
 #error "CONFIGURE_TASK_STACK_ALLOCATOR and 
CONFIGURE_TASK_STACK_DEALLOCATOR must be both defined or both undefined"
   #endif
 
-  /**
-   * This is the primary Configuration Table for this application.
-   */
-  const rtems_configuration_table Configuration = {
-#ifdef RTEMS_SMP
+  #ifdef RTEMS_SMP
+const bool _SMP_Is_enabled =
   #ifdef _CONFIGURE_SMP_APPLICATION
-true
+true;
   #else
-false
+false;
   #endif
-#endif
-  };
 
-  #ifdef RTEMS_SMP
 const uint32_t _SMP_Processor_configured_maximum =
   _CONFIGURE_MAXIMUM_PROCESSORS;
   #endif
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index 5550397623..4811d0e704 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -72,28 +72,6 @@ typedef Stack_Allocator_allocate rtems_stack_allocate_hook;
  */
 typedef Stack_Allocator_free rtems_stack_free_hook;
 
-/*
- *  The following records define the Configuration Table.  The
- *  information contained in this table is required in all
- *  RTEMS systems, whether single or multiprocessor.  This
- *  table primarily defines the following:
- *
- * + location and size of the RTEMS Workspace
- * + microseconds per clock tick
- * + clock ticks per task timeslice
- * + required number of each object type for each API configured
- */
-typedef struct {
-  #ifdef RTEMS_SMP
-bool smp_enabled;
-  #endif
-} rtems_configuration_table;
-
-/**
- * This is the configuration table generated by confdefs.h.
- */
-extern const rtems_configuration_table Configuration;
-
 /*
  *  Some handy macros to avoid dependencies on either the BSP
  *  or the exact format of the configuration table.
@@ -182,13 +160,8 @@ uint32_t rtems_configuration_get_maximum_extensions( void 
);
  * @retval true SMP mode of operation is enabled.
  * @retval false Otherwise.
  */
-#ifdef RTEMS_SMP
-  #define rtems_configuration_is_smp_enabled() \
-(Configuration.smp_enabled)
-#else
-  #define rtems_configuration_is_smp_enabled() \
-false
-#endif
+#define rtems_configuration_is_smp_enabled() \
+  (_SMP_Is_enabled)
 
 /**
  * @brief Returns the configured maximum count of processors.
diff --git a/cpukit/include/rtems/score/smp.h b/cpukit/include/rtems/score/smp.h
index 2722fbdcee..36cfd981ab 100644
--- a/cpukit/include/rtems/score/smp.h
+++ b/cpukit/include/rtems/score/smp.h
@@ -36,6 +36,19 @@ extern "C" {
  * @{
  */
 
+/**
+ * @brief Indicates if SMP is enabled.
+ *
+ * In SMP configurations, this constant is defined by the application
+ * configuration via , otherwise it is a compile-time
+ * constant with the value false.
+ */
+#if defined(RTEMS_SMP)
+  extern const bool _SMP_Is_enabled;
+#else
+  #define _SMP_Is_enabled false
+#endif
+
 /**
  * @brief The configured processor maximum.
  *
-- 
2.16.4

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 43/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am|   1 +
 cpukit/include/rtems/confdefs.h  | 200 +--
 cpukit/include/rtems/confdefs/objectsposix.h | 197 ++
 3 files changed, 200 insertions(+), 198 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/objectsposix.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index 5b189a6641..cebab504e9 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -197,6 +197,7 @@ include_rtems_confdefs_HEADERS += 
include/rtems/confdefs/malloc.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/mpci.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/newlib.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/objectsclassic.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/objectsposix.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/obsolete.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/percpu.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/scheduler.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 97e5b6d9fb..fe3b26ce86 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -30,13 +30,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -51,6 +44,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -115,122 +109,6 @@ extern "C" {
 #endif
 /**@}*/
 
-/**
- * @defgroup ConfigurationPOSIXAPI POSIX API Configuration Parameters
- *
- * This module contains the parameters related to configuration
- * of the POSIX API services.
- */
-/**@{*/
-
-/**
- * This configuration parameter specifies the maximum number of
- * POSIX API keys.
- *
- * POSIX Keys are available whether or not the POSIX API is enabled.
- */
-#ifndef CONFIGURE_MAXIMUM_POSIX_KEYS
-  #define CONFIGURE_MAXIMUM_POSIX_KEYS 0
-#endif
-
-/*
- * This macro is calculated to specify the memory required for
- * POSIX API key/value pairs.
- */
-#ifndef CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS
-  #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS \
-(CONFIGURE_MAXIMUM_POSIX_KEYS * \
- (CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_TASKS))
-#endif
-
-/*
- * Account for the object control structures plus the name
- * of the object to be duplicated.
- */
-#define _Configure_POSIX_Named_Object_RAM(_number, _size) \
-  (rtems_resource_maximum_per_allocation(_number) \
-* _Configure_From_workspace(_POSIX_PATH_MAX + 1))
-
-/**
- * This configuration parameter specifies the maximum number of
- * POSIX API message queues.
- */
-#ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
-  #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0
-#endif
-
-/*
- * This macro is calculated to specify the memory required for
- * POSIX API message queues.
- */
-#define _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \
-  _Configure_POSIX_Named_Object_RAM( \
- _message_queues, sizeof(POSIX_Message_queue_Control) )
-
-/**
- * This configuration parameter specifies the maximum number of
- * POSIX API semaphores.
- */
-#ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
-  #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0
-#endif
-
-/*
- * This macro is calculated to specify the memory required for
- * POSIX API semaphores.
- */
-#define _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \
-  _Configure_POSIX_Named_Object_RAM( \
- _semaphores, sizeof(POSIX_Semaphore_Control) )
-
-/**
- * Configure the maximum number of POSIX shared memory objects.
- */
-#ifndef CONFIGURE_MAXIMUM_POSIX_SHMS
-  #define CONFIGURE_MAXIMUM_POSIX_SHMS 0
-#endif
-
-/*
- * This macro is calculated to specify the memory required for
- * POSIX API shared memory.
- */
-#define _CONFIGURE_MEMORY_FOR_POSIX_SHMS(_shms) \
-  _Configure_POSIX_Named_Object_RAM(_shms, sizeof(POSIX_Shm_Control) )
-
-/**
- * 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 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
-
-#if CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS > 0
-  #define _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS \
-_Configure_From_workspace( (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS)

[PATCH v2 34/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am  |   1 +
 cpukit/include/rtems/confdefs.h| 104 +--
 cpukit/include/rtems/confdefs/extensions.h | 158 +
 3 files changed, 160 insertions(+), 103 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/extensions.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index 1a23ce5608..7bcc7be6ca 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -186,6 +186,7 @@ include_rtems_HEADERS += include/rtems/watchdogdrv.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/bdbuf.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/bsp.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/clock.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/extensions.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libio.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/malloc.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 0e5038cf92..b0783ae225 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -26,12 +26,10 @@
  * Include the executive's configuration
  */
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -52,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -573,69 +572,8 @@ extern "C" {
   #define CONFIGURE_MAXIMUM_BARRIERS   0
 #endif
 
-#ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS
-  /**
-   * This configuration parameter specifies the maximum number of
-   * Classic API User Extensions.
-   */
-  #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0
-#endif
-
 /**@}*/ /* end of Classic API Configuration */
 
-/*
- *  Initial Extension Set
- */
-
-#ifdef CONFIGURE_INIT
-#if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS > 0
-#include 
-#endif
-#ifdef CONFIGURE_STACK_CHECKER_ENABLED
-#include 
-#endif
-
-#include 
-
-#if defined(BSP_INITIAL_EXTENSION) || \
-defined(CONFIGURE_INITIAL_EXTENSIONS) || \
-defined(CONFIGURE_STACK_CHECKER_ENABLED) || \
-(defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY))
-  const User_extensions_Table _User_extensions_Initial_extensions[] = {
-#if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS > 0 && \
-  defined(CONFIGURE_RECORD_EXTENSIONS_ENABLED)
-  RECORD_EXTENSION,
-#endif
-#if !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)
-  RTEMS_NEWLIB_EXTENSION,
-#endif
-#if defined(CONFIGURE_STACK_CHECKER_ENABLED)
-  RTEMS_STACK_CHECKER_EXTENSION,
-#endif
-#if defined(CONFIGURE_INITIAL_EXTENSIONS)
-  CONFIGURE_INITIAL_EXTENSIONS,
-#endif
-#if defined(BSP_INITIAL_EXTENSION)
-  BSP_INITIAL_EXTENSION
-#endif
-  };
-
-  const size_t _User_extensions_Initial_count =
-RTEMS_ARRAY_SIZE( _User_extensions_Initial_extensions );
-
-  User_extensions_Switch_control _User_extensions_Initial_switch_controls[
-RTEMS_ARRAY_SIZE( _User_extensions_Initial_extensions )
-  ];
-
-  RTEMS_SYSINIT_ITEM(
-_User_extensions_Handler_initialization,
-RTEMS_SYSINIT_INITIAL_EXTENSIONS,
-RTEMS_SYSINIT_ORDER_MIDDLE
-  );
-#endif
-
-#endif
-
 /**
  * @defgroup ConfigurationPOSIXAPI POSIX API Configuration Parameters
  *
@@ -1099,10 +1037,6 @@ extern "C" {
 );
   #endif
 
-  #if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
-EXTENSION_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_USER_EXTENSIONS );
-  #endif
-
   #if CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS > 0
 POSIX_Keys_Key_value_pair _POSIX_Keys_Key_value_pairs[
   rtems_resource_maximum_per_allocation(
@@ -1220,42 +1154,6 @@ extern "C" {
   RTEMS_SYSINIT_ORDER_MIDDLE
 );
   #endif
-
-  #if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS > 0
-#if (CONFIGURE_RECORD_PER_PROCESSOR_ITEMS & 
(CONFIGURE_RECORD_PER_PROCESSOR_ITEMS - 1)) != 0
-  #error "CONFIGURE_RECORD_PER_PROCESSOR_ITEMS must be a power of two"
-#endif
-
-#if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS < 16
-  #error "CONFIGURE_RECORD_PER_PROCESSOR_ITEMS must be at least 16"
-#endif
-
-typedef struct {
-  Record_ControlControl;
-  rtems_record_item Items[ CONFIGURE_RECORD_PER_PROCESSOR_ITEMS ];
-} Record_Configured_control;
-
-static Record_Configured_control _Record_Controls[ 
_CONFIGURE_MAXIMUM_PROCESSORS ];
-
-const Record_Configuration _Record_Configuration = {
-  CONFIGURE_RECORD_PER_PROCESSOR_ITEMS,
-  &_Record_Controls[ 0 ].Control
-};
-
-RTEMS_SYSINIT_ITEM(
-  _Record_Initialize,
-  RTEMS_SYSINIT_RECORD,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
-  #endif
-
-  #ifdef CONFIGURE_VERBOSE_SYSTEM_INITIALIZATION
-RTEMS_SYSINIT_ITEM(
-  _Sysinit_Verbose,
-  RTEMS_SYSINIT_RECORD,
-  RTEMS_SYSINI

[PATCH v2 38/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am |   1 +
 cpukit/include/rtems/confdefs.h   | 148 +-
 cpukit/include/rtems/confdefs/iodrivers.h | 166 ++
 3 files changed, 168 insertions(+), 147 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/iodrivers.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index 2456c42f94..9f2e06b870 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -190,6 +190,7 @@ include_rtems_confdefs_HEADERS += 
include/rtems/confdefs/console.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/extensions.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/inittask.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/initthread.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/iodrivers.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libio.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/malloc.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 052f958b1a..e1b23ddaef 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -26,7 +26,6 @@
  * Include the executive's configuration
  */
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -54,6 +53,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -146,151 +146,6 @@ extern "C" {
 #endif
 /**@}*/
 
-/**
- * @defgroup ConfigurationDriverTable Device Driver Table Configuration
- *
- * @addtogroup Configuration
- *
- * This group contains parameters related to generating a Device Driver
- * Table.
- *
- * Default Device Driver Table.  Each driver needed by the test is explicitly
- * chosen by the application.  There is always a null driver entry.
- */
-/**@{*/
-
-/**
- * This is an empty device driver slot.
- */
-#define NULL_DRIVER_TABLE_ENTRY \
- { NULL, NULL, NULL, NULL, NULL, NULL }
-
-#if (defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \
-defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER)) || \
-  (defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \
-defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER)) || \
-  (defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER) && \
-defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER))
-#error "CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER, 
CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER, and 
CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER are mutually exclusive"
-#endif
-
-#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
-  #include 
-#endif
-
-#ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
-  #include 
-#endif
-
-#ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
-  #include 
-#endif
-
-#ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER
-  #include 
-#endif
-
-#ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER
-  #include 
-#endif
-
-#ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
-  #include 
-#endif
-
-#ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER
-  #include 
-#endif
-
-#ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
-  /* the ide driver needs the ATA driver */
-  #ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
-#define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
-  #endif
-  #include 
-#endif
-
-#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
-  #include 
-#endif
-
-/**
- * This specifies the maximum number of device drivers that
- * can be installed in the system at one time.  It must account
- * for both the statically and dynamically installed drivers.
- */
-#ifndef CONFIGURE_MAXIMUM_DRIVERS
-  #define CONFIGURE_MAXIMUM_DRIVERS
-#endif
-
-#ifdef CONFIGURE_INIT
-  rtems_driver_address_table
-_IO_Driver_address_table[ CONFIGURE_MAXIMUM_DRIVERS ] = {
-#ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS
-  CONFIGURE_BSP_PREREQUISITE_DRIVERS,
-#endif
-#ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS
-  CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS,
-#endif
-#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
-  CONSOLE_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
-  RTC_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER
-  WATCHDOG_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
-  DEVNULL_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER
-  DEVZERO_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
-  IDE_CONTROLLER_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
-  ATA_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER
-  FRAME_BUFFER_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_APPLICATI

[PATCH v2 14/44] libio: Add POSIX user environment to TCB

2020-02-21 Thread Sebastian Huber
The IO library used a POSIX key to store an optional POSIX user
environment pointer.  This pulled in the POSIX keys support in every
application configuration.  Add a user environment pointer to the thread
control block (TCB) instead.  Applications which do not need the POSIX
user environment will just get an overhead of one pointer per thread.
---
 cpukit/include/rtems/confdefs.h| 17 +--
 cpukit/include/rtems/libio_.h  |  4 --
 cpukit/include/rtems/score/interr.h|  2 +-
 cpukit/include/rtems/score/thread.h|  7 +++
 cpukit/include/rtems/sysinit.h |  1 +
 cpukit/include/rtems/userenv.h |  6 ++-
 cpukit/libcsupport/src/__usrenv.c  | 14 +-
 cpukit/libcsupport/src/libio_init.c| 11 -
 cpukit/libcsupport/src/privateenv.c| 67 +-
 cpukit/sapi/src/sysinitverbose.c   | 10 +++-
 testsuites/fstests/fsdosfsname01/init.c|  1 -
 testsuites/fstests/imfs_support/fs_support.c   |  1 -
 testsuites/fstests/jffs2_support/fs_support.c  |  2 -
 testsuites/fstests/mdosfs_support/fs_support.c |  1 -
 testsuites/fstests/mimfs_support/fs_support.c  |  1 -
 testsuites/fstests/mrfs_support/fs_support.c   |  1 -
 testsuites/libtests/ftp01/init.c   |  2 -
 testsuites/psxtests/psxchroot01/main.c |  2 -
 testsuites/psxtests/psxconfig01/init.c |  2 +-
 testsuites/psxtests/psxmount/main.c|  2 -
 testsuites/sptests/Makefile.am |  9 
 testsuites/sptests/configure.ac|  1 -
 testsuites/sptests/spfatal27/init.c| 34 -
 testsuites/sptests/spfatal27/spfatal27.doc | 23 -
 testsuites/sptests/spfatal27/spfatal27.scn |  3 --
 testsuites/sptests/spprivenv01/init.c  |  3 --
 testsuites/sptests/spsysinit01/init.c  | 41 +++-
 27 files changed, 123 insertions(+), 145 deletions(-)
 delete mode 100644 testsuites/sptests/spfatal27/init.c
 delete mode 100644 testsuites/sptests/spfatal27/spfatal27.doc
 delete mode 100644 testsuites/sptests/spfatal27/spfatal27.scn

diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 3741c9a706..0191392cfc 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -139,11 +139,6 @@ extern "C" {
   #define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 3
 #endif
 
-/*
- * POSIX key count used by the IO library.
- */
-#define _CONFIGURE_LIBIO_POSIX_KEYS 1
-
 #ifdef CONFIGURE_INIT
   rtems_libio_t rtems_libio_iops[CONFIGURE_MAXIMUM_FILE_DESCRIPTORS];
 
@@ -2073,14 +2068,6 @@ struct _reent *__getreent(void)
  (CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_TASKS))
 #endif
 
-/*
- * This macro is calculated to specify the total number of
- * POSIX API keys required by the application and configured
- * system capabilities.
- */
-#define _CONFIGURE_POSIX_KEYS \
-  (CONFIGURE_MAXIMUM_POSIX_KEYS + _CONFIGURE_LIBIO_POSIX_KEYS)
-
 /**
  * This configuration parameter specifies the maximum number of
  * POSIX API threads.
@@ -2550,8 +2537,8 @@ struct _reent *__getreent(void)
   CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS;
   #endif
 
-  #if _CONFIGURE_POSIX_KEYS > 0
-POSIX_KEYS_INFORMATION_DEFINE( _CONFIGURE_POSIX_KEYS );
+  #if CONFIGURE_MAXIMUM_POSIX_KEYS > 0
+POSIX_KEYS_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_POSIX_KEYS );
   #endif
 
   #if CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES > 0
diff --git a/cpukit/include/rtems/libio_.h b/cpukit/include/rtems/libio_.h
index cf80ea8075..2473bb5e5a 100644
--- a/cpukit/include/rtems/libio_.h
+++ b/cpukit/include/rtems/libio_.h
@@ -336,10 +336,6 @@ void rtems_filesystem_location_free( 
rtems_filesystem_location_info_t *loc );
  */
 #include 
 
-void rtems_libio_free_user_env( void *env );
-
-extern pthread_key_t rtems_current_user_env_key;
-
 void rtems_libio_lock( void );
 
 void rtems_libio_unlock( void );
diff --git a/cpukit/include/rtems/score/interr.h 
b/cpukit/include/rtems/score/interr.h
index e57c415eed..2f449deedb 100644
--- a/cpukit/include/rtems/score/interr.h
+++ b/cpukit/include/rtems/score/interr.h
@@ -197,7 +197,7 @@ typedef enum {
   INTERNAL_ERROR_BAD_THREAD_DISPATCH_ENVIRONMENT = 31,
   INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILED = 32,
   INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED = 33,
-  INTERNAL_ERROR_LIBIO_USER_ENV_KEY_CREATE_FAILED = 34,
+  /* INTERNAL_ERROR_LIBIO_USER_ENV_KEY_CREATE_FAILED = 34, */
   /* INTERNAL_ERROR_LIBIO_SEM_CREATE_FAILED = 35, */
   INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED = 36,
   INTERNAL_ERROR_LIBIO_STDERR_FD_OPEN_FAILED = 37,
diff --git a/cpukit/include/rtems/score/thread.h 
b/cpukit/include/rtems/score/thread.h
index 3e2e0638f8..2e7380f99a 100644
--- a/cpukit/include/rtems/score/thread.h
+++ b/cpukit/include/rtems/score/thread.h
@@ -43,6 +43,8 @@
 #include 
 #endif
 
+struct rtems_user_env_t;
+
 struct _pthread_cleanup_context;
 
 struct Per_CPU_Control;
@@ -858,6 +8

[PATCH v2 36/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am  |  1 +
 cpukit/include/rtems/confdefs.h| 58 +-
 cpukit/include/rtems/confdefs/initthread.h | 97 ++
 3 files changed, 100 insertions(+), 56 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/initthread.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index ae235a3f32..7a9cf1adae 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -188,6 +188,7 @@ include_rtems_confdefs_HEADERS += 
include/rtems/confdefs/bsp.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/clock.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/extensions.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/inittask.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/initthread.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libio.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/malloc.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index d31c125f7e..4ae6580754 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -52,6 +52,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -605,24 +606,6 @@ extern "C" {
   #define _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS 0
 #endif
 
-#ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
-  #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
-#define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT   POSIX_Init
-  #endif
-
-  #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
-#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \
-  CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE
-  #endif
-#endif /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
-
-/**
- * This configuration parameter specifies the stack size of the
- * POSIX API Initialization thread (if used).
- */
-#ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
-  #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE0
-#endif
 /**@}*/  /* end of POSIX API Configuration */
 
 /**
@@ -700,31 +683,13 @@ extern "C" {
_CONFIGURE_HEAP_HANDLER_OVERHEAD \
 )
 
-/*
- *  Now account for any extra memory that initialization tasks or threads
- *  may have requested.
- */
-
-/*
- * This accounts for any extra memory required by the POSIX API
- * Initialization Thread.
- */
-#if (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE > \
-  CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE)
-  #define _CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \
-(CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - \
-  CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE)
-#else
-  #define _CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 0
-#endif
-
 /*
  * This macro provides a summation of the various initialization task
  * and thread stack requirements.
  */
 #define _CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS \
 (_CONFIGURE_INIT_TASK_STACK_EXTRA + \
-_CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART)
+_CONFIGURE_POSIX_INIT_THREAD_STACK_EXTRA)
 
 /*
  * This macro is calculated to specify the memory required for
@@ -1054,25 +1019,6 @@ extern "C" {
   #endif
 #endif
 
-/*
- *  If the user has configured a set of POSIX Initialization Threads,
- *  then we need to install the code that runs that loop.
- */
-#ifdef CONFIGURE_INIT
-  #if defined(CONFIGURE_POSIX_INIT_THREAD_TABLE)
-const posix_initialization_threads_table _POSIX_Threads_User_thread_table 
= {
-  CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT,
-  CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
-};
-
-RTEMS_SYSINIT_ITEM(
-  _POSIX_Threads_Initialize_user_thread,
-  RTEMS_SYSINIT_POSIX_USER_THREADS,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
-  #endif
-#endif
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/cpukit/include/rtems/confdefs/initthread.h 
b/cpukit/include/rtems/confdefs/initthread.h
new file mode 100644
index 00..9d924d3aea
--- /dev/null
+++ b/cpukit/include/rtems/confdefs/initthread.h
@@ -0,0 +1,97 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2020 embedded brains GmbH (http://www.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 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 

[PATCH v2 28/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am |   1 +
 cpukit/include/rtems/confdefs.h   | 453 +-
 cpukit/include/rtems/confdefs/scheduler.h | 370 
 3 files changed, 372 insertions(+), 452 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/scheduler.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index f64e9867ff..2cb59165bf 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -188,6 +188,7 @@ include_rtems_confdefs_HEADERS += 
include/rtems/confdefs/libio.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/obsolete.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/percpu.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/scheduler.h
 include_rtems_debugger_HEADERS += include/rtems/debugger/rtems-debugger-bsp.h
 include_rtems_debugger_HEADERS += 
include/rtems/debugger/rtems-debugger-remote.h
 include_rtems_debugger_HEADERS += 
include/rtems/debugger/rtems-debugger-server.h
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 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -101,441 +102,6 @@ extern "C" {
   #undef RTEMS_NEWLIB
 #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 

[PATCH v2 39/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am |   1 +
 cpukit/include/rtems/confdefs.h   |  92 ++-
 cpukit/include/rtems/confdefs/unlimited.h | 143 ++
 3 files changed, 149 insertions(+), 87 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/unlimited.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index 9f2e06b870..ba6222fd4f 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -199,6 +199,7 @@ include_rtems_confdefs_HEADERS += 
include/rtems/confdefs/newlib.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/obsolete.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/percpu.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/scheduler.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/unlimited.h
 include_rtems_debugger_HEADERS += include/rtems/debugger/rtems-debugger-bsp.h
 include_rtems_debugger_HEADERS += 
include/rtems/debugger/rtems-debugger-remote.h
 include_rtems_debugger_HEADERS += 
include/rtems/debugger/rtems-debugger-server.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index e1b23ddaef..c48a2aae81 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -61,6 +61,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -146,93 +147,6 @@ extern "C" {
 #endif
 /**@}*/
 
-/**
- * This macro specifies that the user wants to use unlimited objects for any
- * classic or posix objects that have not already been given resource limits.
- */
-#if defined(CONFIGURE_UNLIMITED_OBJECTS)
-  #if !defined(CONFIGURE_UNIFIED_WORK_AREAS) && \
- !defined(CONFIGURE_EXECUTIVE_RAM_SIZE) && \
- !defined(CONFIGURE_MEMORY_OVERHEAD)
- #error "CONFIGURE_UNLIMITED_OBJECTS requires a unified work area, an 
executive RAM size, or a defined workspace memory overhead"
-  #endif
-
-  #if !defined(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
-  /**
-   * This macro specifies a default allocation size for when auto-extending
-   * unlimited objects if none was given by the user.
-   */
-#define CONFIGURE_UNLIMITED_ALLOCATION_SIZE 8
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_TASKS)
-#define CONFIGURE_MAXIMUM_TASKS \
-  rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_TIMERS)
-#define CONFIGURE_MAXIMUM_TIMERS \
-  rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_SEMAPHORES)
-#define CONFIGURE_MAXIMUM_SEMAPHORES \
-  rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_MESSAGE_QUEUES)
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES \
-  rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_PARTITIONS)
-#define CONFIGURE_MAXIMUM_PARTITIONS \
-  rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_REGIONS)
-#define CONFIGURE_MAXIMUM_REGIONS \
-  rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_PORTS)
-#define CONFIGURE_MAXIMUM_PORTS \
-  rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_PERIODS)
-#define CONFIGURE_MAXIMUM_PERIODS \
-  rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_BARRIERS)
-#define CONFIGURE_MAXIMUM_BARRIERS \
-  rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_POSIX_KEYS)
-#define CONFIGURE_MAXIMUM_POSIX_KEYS \
-  rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS)
-#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS \
-  rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES)
-#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES \
-  rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_POSIX_SEMAPHORES)
-#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES \
-  rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_POSIX_SHMS)
-#define CONFIGURE_MAXIMUM_POSIX_SHMS \
-  rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_POSIX_THREADS)
-#define CONFIGURE_MAXIMUM_POSIX_THREADS \
-  rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
-  #endif
-
-  #ifdef RTEMS_POSIX_API
-#if !defined(CONFIGURE_MAXIMUM_POSIX_TIMERS)
-  #define CONFIGURE_MAXIMUM_POSIX_TIMERS \
-rtems_resource_unlimite

[PATCH v2 33/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am  |  1 +
 cpukit/include/rtems/confdefs.h| 24 +---
 cpukit/include/rtems/confdefs/newlib.h | 72 ++
 3 files changed, 75 insertions(+), 22 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/newlib.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index 60a3687db8..1a23ce5608 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -190,6 +190,7 @@ include_rtems_confdefs_HEADERS += 
include/rtems/confdefs/libio.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/malloc.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/mpci.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/newlib.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/obsolete.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/percpu.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/scheduler.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index f4cbe43908..0e5038cf92 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -56,15 +56,12 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
 #include 
 
-#ifdef RTEMS_NEWLIB
-  #include 
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -98,14 +95,6 @@ extern "C" {
  *used remarkably reliably by most applications.
  */
 
-/**
- * This macro determines whether the RTEMS reentrancy support for
- * the Newlib C Library is enabled.
- */
-#ifdef RTEMS_SCHEDSIM
-  #undef RTEMS_NEWLIB
-#endif
-
 /**
  * @defgroup ConfigurationHelpers Configuration Helpers
  *
@@ -645,13 +634,6 @@ extern "C" {
   );
 #endif
 
-#if defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)
-struct _reent *__getreent(void)
-{
-  return _Thread_Get_executing()->libc_reent;
-}
-#endif
-
 #endif
 
 /**
@@ -1005,9 +987,7 @@ struct _reent *__getreent(void)
 #if CONFIGURE_MAXIMUM_THREAD_NAME_SIZE > 1
   char name[ CONFIGURE_MAXIMUM_THREAD_NAME_SIZE ];
 #endif
-#if !defined(RTEMS_SCHEDSIM) \
-  && defined(RTEMS_NEWLIB) \
-  && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)
+#ifdef _CONFIGURE_ENABLE_NEWLIB_REENTRANCY
   struct _reent Newlib;
 #else
   struct { /* Empty */ } Newlib;
diff --git a/cpukit/include/rtems/confdefs/newlib.h 
b/cpukit/include/rtems/confdefs/newlib.h
new file mode 100644
index 00..5951eb83fb
--- /dev/null
+++ b/cpukit/include/rtems/confdefs/newlib.h
@@ -0,0 +1,72 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2020 embedded brains GmbH (http://www.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 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.
+ */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSApplicationConfiguration
+ *
+ * @brief Evaluate Newlib Configuration Options
+ *
+ * This header file defines _CONFIGURE_ENABLE_NEWLIB_REENTRANCY for use by 
other
+ * configuration header files.
+ */
+
+#ifndef _RTEMS_CONFDEFS_NEWLIB_H
+#define _RTEMS_CONFDEFS_NEWLIB_H
+
+#ifndef __CONFIGURATION_TEMPLATE_h
+#error "Do not include this file directly, use  instead"
+#endif
+
+#ifdef CONFIGURE_INIT
+
+#if defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)
+  #include 
+  #include 
+  #include 
+  #define _CONFIGURE_ENABLE_NEWLIB_REENTRANCY
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef _CONFIGURE_ENABLE_NEWLIB_REENTRANCY
+  struct _reent *__getreent( void )
+  {
+return _Thread_Get_executing()->libc_reent;
+  }
+#endif
+
+#ifdef __cplu

[PATCH v2 42/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am  |  1 +
 cpukit/include/rtems/confdefs.h| 26 +--
 cpukit/include/rtems/confdefs/wkspacesupport.h | 64 ++
 3 files changed, 66 insertions(+), 25 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/wkspacesupport.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index d057c6e7d2..5b189a6641 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -202,6 +202,7 @@ include_rtems_confdefs_HEADERS += 
include/rtems/confdefs/percpu.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/scheduler.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/threads.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/unlimited.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/wkspacesupport.h
 include_rtems_debugger_HEADERS += include/rtems/debugger/rtems-debugger-bsp.h
 include_rtems_debugger_HEADERS += 
include/rtems/debugger/rtems-debugger-remote.h
 include_rtems_debugger_HEADERS += 
include/rtems/debugger/rtems-debugger-server.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index ef1200419b..97e5b6d9fb 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -54,6 +54,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -100,31 +101,6 @@ extern "C" {
  */
 /**@{*/
 
-/**
- * Zero of one returns 0 if the parameter is 0 else 1 is returned.
- */
-#define _Configure_Zero_or_One(_number) ((_number) != 0 ? 1 : 0)
-
-/**
- * General helper to align up a value.
- */
-#define _Configure_Align_up(_val, _align) \
-  (((_val) + (_align) - 1) - ((_val) + (_align) - 1) % (_align))
-
-#define _CONFIGURE_HEAP_MIN_BLOCK_SIZE \
-  _Configure_Align_up(sizeof(Heap_Block), CPU_HEAP_ALIGNMENT)
-
-/**
- * This is a helper macro used in calculations in this file.  It is used
- * to noted when an element is allocated from the RTEMS Workspace and adds
- * a factor to account for heap overhead plus an alignment factor that
- * may be applied.
- */
-#define _Configure_From_workspace(_size) \
-  (uintptr_t) (_Configure_Zero_or_One(_size) * \
-_Configure_Align_up(_size + HEAP_BLOCK_HEADER_SIZE, \
-  _CONFIGURE_HEAP_MIN_BLOCK_SIZE))
-
 /**
  * This is a helper macro used in stack space calculations in this file.  It
  * may be provided by the application in case a special task stack allocator
diff --git a/cpukit/include/rtems/confdefs/wkspacesupport.h 
b/cpukit/include/rtems/confdefs/wkspacesupport.h
new file mode 100644
index 00..2a3def5cee
--- /dev/null
+++ b/cpukit/include/rtems/confdefs/wkspacesupport.h
@@ -0,0 +1,64 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2020 embedded brains GmbH (http://www.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 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.
+ */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSApplicationConfiguration
+ *
+ * @brief Configuration Options Workspace Support Macros
+ */
+
+#ifndef _RTEMS_CONFDEFS_WKSPACESUPPORT_H
+#define _RTEMS_CONFDEFS_WKSPACESUPPORT_H
+
+#ifndef __CONFIGURATION_TEMPLATE_h
+#error "Do not include this file directly, use  instead"
+#endif
+
+#ifdef CONFIGURE_INIT
+
+#include 
+
+#define _Configure_Zero_or_one( _number ) ( ( _number ) != 0 ? 1 : 0 )
+
+#define _Configure_Align_up( _val, _align ) \
+  ( ( ( _val ) + ( _align ) - 1) - ( ( _val ) + ( _align ) - 1 ) % ( _align ) )
+
+#define _CONFIGURE_HEAP_MIN_BLOCK_SIZE \
+  _Configure_Align_up( sizeof( Heap_Block ), CPU_HEAP_ALIGNMENT )
+
+#define _Configure_From_workspace( _size ) \
+  ( (uintptr_t) ( _Con

[PATCH v2 16/44] bsps/clock: Use _SMP_Get_processor_maximum()

2020-02-21 Thread Sebastian Huber
Use a specific test to enable the fast idle mode instead of using the
rtems_configuration_is_smp_enabled() workaround.

Update #3876.
---
 bsps/shared/dev/clock/clockimpl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bsps/shared/dev/clock/clockimpl.h 
b/bsps/shared/dev/clock/clockimpl.h
index 163b498a18..3c08c80859 100644
--- a/bsps/shared/dev/clock/clockimpl.h
+++ b/bsps/shared/dev/clock/clockimpl.h
@@ -150,7 +150,7 @@ rtems_isr Clock_isr(
 
   Clock_driver_timecounter_tick();
 
-  if (!rtems_configuration_is_smp_enabled()) {
+  if (_SMP_Get_processor_maximum() == 1) {
 while (
   _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle
 ) {
-- 
2.16.4

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 44/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Change licence of  to BSD-2-Clause according to file
history.

Update #3053.
Update #3875.
---
 cpukit/headers.am   |   1 +
 cpukit/include/rtems/confdefs.h | 318 ++--
 cpukit/include/rtems/confdefs/wkspace.h | 182 ++
 3 files changed, 235 insertions(+), 266 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/wkspace.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index cebab504e9..185e3b8e38 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -203,6 +203,7 @@ include_rtems_confdefs_HEADERS += 
include/rtems/confdefs/percpu.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/scheduler.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/threads.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/unlimited.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/wkspace.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/wkspacesupport.h
 include_rtems_debugger_HEADERS += include/rtems/debugger/rtems-debugger-bsp.h
 include_rtems_debugger_HEADERS += 
include/rtems/debugger/rtems-debugger-remote.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index fe3b26ce86..5c8f4b99af 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -1,36 +1,66 @@
-/**
- * @file
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
  *
- * @brief Configuration Table Template that will be Instantiated
- * by an Application
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 1989, 2000 On-Line Applications Research Corporation (OAR)
  *
- * This include file contains the configuration table template that will
- * be instantiated by an application based on the setting of a number
- * of macros.  The macros are documented in the Configuring a System
- * chapter of the Classic API User's Guide
+ * 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.
  */
 
-/*
- *  COPYRIGHT (c) 1989-2015.
- *  On-Line Applications Research Corporation (OAR).
+/**
+ * @file
+ * 
+ * @ingroup RTEMSApplicationConfiguration
+ *
+ * @brief Evaluate Configuration Options
  *
- *  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 header file includes a couple of header files which evaluate the
+ * configuration options specified by the application.  The macros and defines
+ * used to configure the system are documented in the Configuring a System
+ * chapter of the Classic API User's Guide.
  */
 
 #ifndef __CONFIGURATION_TEMPLATE_h
 #define __CONFIGURATION_TEMPLATE_h
 
+/**
+ * @defgroup RTEMSApplicationConfiguration Application Configuration
+ *
+ * @ingroup RTEMSInternal
+ *
+ * @brief Evaluation of Application Configuration Options
+ *
+ * This group contains header files which evaluate the configuration options
+ * specified by the application.
+ *
+ * @{
+ */
+
 /*
- * Include the executive's configuration
+ * This header file must be included first.  For example, configuration options
+ * which have been renamed are mapped to the new define.
  */
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
+
 #include 
 #include 
 #include 
@@ -48,253 +78,9 @@
 #include 
 #include 
 #include 
-#include 
-
-#include 
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Internal defines must be prefixed with _CONFIGURE to distinguish them from
- * user-provided options which use a CONFIGURE prefix.
- */
-
-/**
- * @defgroup Configuration RTEMS Configuration
- *
- * 

[PATCH v2 25/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am   |  1 +
 cpukit/include/rtems/confdefs.h | 14 +
 cpukit/include/rtems/confdefs/bsp.h | 60 +
 3 files changed, 62 insertions(+), 13 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/bsp.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index 658444cf9e..9f736e0c87 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -183,6 +183,7 @@ include_rtems_HEADERS += include/rtems/userenv.h
 include_rtems_HEADERS += include/rtems/version.h
 include_rtems_HEADERS += include/rtems/vmeintr.h
 include_rtems_HEADERS += include/rtems/watchdogdrv.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/bsp.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/obsolete.h
 include_rtems_debugger_HEADERS += include/rtems/debugger/rtems-debugger-bsp.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index b2a10902e4..eca210190c 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -51,23 +51,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
 
-#ifdef CONFIGURE_DISABLE_BSP_SETTINGS
-  #undef BSP_DEFAULT_UNIFIED_WORK_AREAS
-  #undef BSP_IDLE_TASK_BODY
-  #undef BSP_IDLE_TASK_STACK_SIZE
-  #undef BSP_INITIAL_EXTENSION
-  #undef BSP_INTERRUPT_STACK_SIZE
-  #undef BSP_MAXIMUM_DEVICES
-  #undef CONFIGURE_BSP_PREREQUISITE_DRIVERS
-  #undef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK
-#else
-  #include 
-#endif
-
 #ifdef RTEMS_NEWLIB
   #include 
 #endif
diff --git a/cpukit/include/rtems/confdefs/bsp.h 
b/cpukit/include/rtems/confdefs/bsp.h
new file mode 100644
index 00..7dab15a472
--- /dev/null
+++ b/cpukit/include/rtems/confdefs/bsp.h
@@ -0,0 +1,60 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2013 embedded brains GmbH (http://www.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 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.
+ */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSApplicationConfiguration
+ *
+ * @brief Evaluate BSP Related Configuration Options
+ */
+
+#ifndef _RTEMS_CONFDEFS_BSP_H
+#define _RTEMS_CONFDEFS_BSP_H
+
+#ifndef __CONFIGURATION_TEMPLATE_h
+#error "Do not include this file directly, use  instead"
+#endif
+
+#ifdef CONFIGURE_INIT
+
+#ifdef CONFIGURE_DISABLE_BSP_SETTINGS
+  #undef BSP_DEFAULT_UNIFIED_WORK_AREAS
+  #undef BSP_IDLE_TASK_BODY
+  #undef BSP_IDLE_TASK_STACK_SIZE
+  #undef BSP_INITIAL_EXTENSION
+  #undef BSP_INTERRUPT_STACK_SIZE
+  #undef BSP_MAXIMUM_DEVICES
+  #undef CONFIGURE_BSP_PREREQUISITE_DRIVERS
+  #undef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK
+#else
+  #include 
+#endif
+
+#endif /* CONFIGURE_INIT */
+
+#endif /* _RTEMS_CONFDEFS_BSP_H */
-- 
2.16.4

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 12/44] config: Add _SMP_Processor_configure_maximum

2020-02-21 Thread Sebastian Huber
Move the processor maximum configuration constant out of the
configuration table.

Update #3875.
---
 cpukit/include/rtems/confdefs.h  | 12 +++-
 cpukit/include/rtems/config.h| 14 +++---
 cpukit/include/rtems/score/smp.h | 13 +
 3 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 33b1aa67d4..f8a4eb23cf 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -2639,16 +2639,18 @@ struct _reent *__getreent(void)
   const rtems_configuration_table Configuration = {
 #ifdef RTEMS_SMP
   #ifdef _CONFIGURE_SMP_APPLICATION
-true,
+true
   #else
-false,
+false
   #endif
 #endif
-#ifdef RTEMS_SMP
-  _CONFIGURE_MAXIMUM_PROCESSORS,
-#endif
   };
 
+  #ifdef RTEMS_SMP
+const uint32_t _SMP_Processor_configured_maximum =
+  _CONFIGURE_MAXIMUM_PROCESSORS;
+  #endif
+
   const uintptr_t _Workspace_Size = CONFIGURE_EXECUTIVE_RAM_SIZE;
 
   #ifdef CONFIGURE_UNIFIED_WORK_AREAS
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index 6489e4e4e8..5550397623 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -86,10 +87,6 @@ typedef struct {
   #ifdef RTEMS_SMP
 bool smp_enabled;
   #endif
-
-  #ifdef RTEMS_SMP
-uint32_t maximum_processors;
-  #endif
 } rtems_configuration_table;
 
 /**
@@ -204,13 +201,8 @@ uint32_t rtems_configuration_get_maximum_extensions( void 
);
  *
  * @return The configured maximum count of processors.
  */
-#ifdef RTEMS_SMP
-  #define rtems_configuration_get_maximum_processors() \
-(Configuration.maximum_processors)
-#else
-  #define rtems_configuration_get_maximum_processors() \
-1
-#endif
+#define rtems_configuration_get_maximum_processors() \
+(_SMP_Processor_configured_maximum)
 
 #ifdef __cplusplus
 }
diff --git a/cpukit/include/rtems/score/smp.h b/cpukit/include/rtems/score/smp.h
index 4d6b24ae48..2722fbdcee 100644
--- a/cpukit/include/rtems/score/smp.h
+++ b/cpukit/include/rtems/score/smp.h
@@ -36,6 +36,19 @@ extern "C" {
  * @{
  */
 
+/**
+ * @brief The configured processor maximum.
+ *
+ * In SMP configurations, this constant is defined by the application
+ * configuration via , otherwise it is a compile-time
+ * constant with the value one.
+ */
+#if defined(RTEMS_SMP)
+  extern const uint32_t _SMP_Processor_configured_maximum;
+#else
+  #define _SMP_Processor_configured_maximum 1
+#endif
+
 #if defined( RTEMS_SMP )
   extern uint32_t _SMP_Processor_maximum;
 
-- 
2.16.4

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 40/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am   |   1 +
 cpukit/include/rtems/confdefs.h | 192 +-
 cpukit/include/rtems/confdefs/threads.h | 234 
 cpukit/posix/src/pthread.c  |   2 +
 4 files changed, 238 insertions(+), 191 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/threads.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index ba6222fd4f..2a7e5a8116 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -199,6 +199,7 @@ include_rtems_confdefs_HEADERS += 
include/rtems/confdefs/newlib.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/obsolete.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/percpu.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/scheduler.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/threads.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/unlimited.h
 include_rtems_debugger_HEADERS += include/rtems/debugger/rtems-debugger-bsp.h
 include_rtems_debugger_HEADERS += 
include/rtems/debugger/rtems-debugger-remote.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index c48a2aae81..82b6f11774 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -37,7 +37,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -61,7 +60,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 
@@ -157,18 +156,6 @@ extern "C" {
  */
 /**@{*/
 
-/** This configures the maximum number of Classic API tasks. */
-#ifndef CONFIGURE_MAXIMUM_TASKS
-  #define CONFIGURE_MAXIMUM_TASKS   0
-#endif
-
-/*
- * This is calculated to account for the maximum number of Classic API
- * tasks used by the application and configured RTEMS capabilities.
- */
-#define _CONFIGURE_TASKS \
-  (CONFIGURE_MAXIMUM_TASKS + _CONFIGURE_LIBBLOCK_TASKS)
-
 #ifndef CONFIGURE_MAXIMUM_TIMERS
   /** This specifies the maximum number of Classic API timers. */
   #define CONFIGURE_MAXIMUM_TIMERS 0
@@ -257,14 +244,6 @@ extern "C" {
  (CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_TASKS))
 #endif
 
-/**
- * This configuration parameter specifies the maximum number of
- * POSIX API threads.
- */
-#ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
-  #define CONFIGURE_MAXIMUM_POSIX_THREADS 0
-#endif
-
 /*
  * Account for the object control structures plus the name
  * of the object to be duplicated.
@@ -478,129 +457,7 @@ extern "C" {
 _CONFIGURE_HEAP_HANDLER_OVERHEAD \
   )
 
-#ifndef CONFIGURE_MAXIMUM_THREAD_NAME_SIZE
-  #define CONFIGURE_MAXIMUM_THREAD_NAME_SIZE THREAD_DEFAULT_MAXIMUM_NAME_SIZE
-#endif
-
 #ifdef CONFIGURE_INIT
-  typedef union {
-Scheduler_Node Base;
-#ifdef CONFIGURE_SCHEDULER_CBS
-  Scheduler_CBS_Node CBS;
-#endif
-#ifdef CONFIGURE_SCHEDULER_EDF
-  Scheduler_EDF_Node EDF;
-#endif
-#ifdef CONFIGURE_SCHEDULER_EDF_SMP
-  Scheduler_EDF_SMP_Node EDF_SMP;
-#endif
-#ifdef CONFIGURE_SCHEDULER_PRIORITY
-  Scheduler_priority_Node Priority;
-#endif
-#ifdef CONFIGURE_SCHEDULER_SIMPLE_SMP
-  Scheduler_SMP_Node Simple_SMP;
-#endif
-#ifdef CONFIGURE_SCHEDULER_PRIORITY_SMP
-  Scheduler_priority_SMP_Node Priority_SMP;
-#endif
-#ifdef CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP
-  Scheduler_priority_affinity_SMP_Node Priority_affinity_SMP;
-#endif
-#ifdef CONFIGURE_SCHEDULER_STRONG_APA
-  Scheduler_strong_APA_Node Strong_APA;
-#endif
-#ifdef CONFIGURE_SCHEDULER_USER_PER_THREAD
-  CONFIGURE_SCHEDULER_USER_PER_THREAD User;
-#endif
-  } Configuration_Scheduler_node;
-
-  #ifdef RTEMS_SMP
-const size_t _Scheduler_Node_size = sizeof( Configuration_Scheduler_node );
-  #endif
-
-  const size_t _Thread_Maximum_name_size = CONFIGURE_MAXIMUM_THREAD_NAME_SIZE;
-
-  struct Thread_Configured_control {
-Thread_Control Control;
-#if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
-  void *extensions[ CONFIGURE_MAXIMUM_USER_EXTENSIONS + 1 ];
-#endif
-Configuration_Scheduler_node Scheduler_nodes[ _CONFIGURE_SCHEDULER_COUNT ];
-RTEMS_API_Control API_RTEMS;
-#ifdef RTEMS_POSIX_API
-  POSIX_API_Control API_POSIX;
-#endif
-#if CONFIGURE_MAXIMUM_THREAD_NAME_SIZE > 1
-  char name[ CONFIGURE_MAXIMUM_THREAD_NAME_SIZE ];
-#endif
-#ifdef _CONFIGURE_ENABLE_NEWLIB_REENTRANCY
-  struct _reent Newlib;
-#else
-  struct { /* Empty */ } Newlib;
-#endif
-  };
-
-  const Thread_Control_add_on _Thread_Control_add_ons[] = {
-{
-  offsetof( Thread_Configured_control, Control.Scheduler.nodes ),
-  offsetof( Thread_Configured_control, Scheduler_nodes )
-}, {
-  offsetof(
-Thread_Configured_control,
-Control.API_Extensions[ THREAD_API_RTEMS ]
-  ),
-  offsetof(

[PATCH v2 35/44] config: Add

2020-02-21 Thread Sebastian Huber
Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.
---
 cpukit/headers.am|   1 +
 cpukit/include/rtems/confdefs.h  | 130 +-
 cpukit/include/rtems/confdefs/inittask.h | 131 +++
 3 files changed, 134 insertions(+), 128 deletions(-)
 create mode 100644 cpukit/include/rtems/confdefs/inittask.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index 7bcc7be6ca..ae235a3f32 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -187,6 +187,7 @@ include_rtems_confdefs_HEADERS += 
include/rtems/confdefs/bdbuf.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/bsp.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/clock.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/extensions.h
+include_rtems_confdefs_HEADERS += include/rtems/confdefs/inittask.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libio.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h
 include_rtems_confdefs_HEADERS += include/rtems/confdefs/malloc.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index b0783ae225..d31c125f7e 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -51,6 +51,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -143,98 +144,6 @@ extern "C" {
 #endif
 /**@}*/
 
-/**
- * @defgroup ConfigurationInitTasksTable Initialization Tasks Configuration
- *
- * @addtogroup Configuration
- *
- * This group contains the elements needed to define the Classic API
- * Initialization Tasks Table.
- *
- * Default User Initialization Task Table.  This table guarantees that
- * one user initialization table is defined.
- */
-#if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE)
-
-/**
- * When using the default Classic API Initialization Tasks Table, this is
- * used to specify the name of the single Classic API task.
- */
-#ifndef CONFIGURE_INIT_TASK_NAME
-  #define CONFIGURE_INIT_TASK_NAME  rtems_build_name('U', 'I', '1', ' 
')
-#endif
-
-/**
- * When using the default Classic API Initialization Tasks Table, this is
- * used to specify the stack size of the single Classic API task.
- */
-#ifndef CONFIGURE_INIT_TASK_STACK_SIZE
-  #define CONFIGURE_INIT_TASK_STACK_SIZECONFIGURE_MINIMUM_TASK_STACK_SIZE
-#endif
-
-/**
- * When using the default Classic API Initialization Tasks Table, this is
- * used to specify the priority of the single Classic API task.
- */
-#ifndef CONFIGURE_INIT_TASK_PRIORITY
-  #define CONFIGURE_INIT_TASK_PRIORITY  1
-#endif
-
-/**
- * When using the default Classic API Initialization Tasks Table, this is
- * used to specify the attributes size of the single Classic API task.
- */
-#ifndef CONFIGURE_INIT_TASK_ATTRIBUTES
-  #define CONFIGURE_INIT_TASK_ATTRIBUTESRTEMS_DEFAULT_ATTRIBUTES
-#endif
-
-/**
- * When using the default Classic API Initialization Tasks Table, this is
- * used to specify the entry point of the single Classic API task.
- */
-#ifndef CONFIGURE_INIT_TASK_ENTRY_POINT
-  #ifdef __cplusplus
-  extern "C" {
-  #endif
-rtems_task Init (rtems_task_argument );
-  #ifdef __cplusplus
-  }
-  #endif
-  #define CONFIGURE_INIT_TASK_ENTRY_POINT   Init
-  extern const char* bsp_boot_cmdline;
-  #define CONFIGURE_INIT_TASK_ARGUMENTS ((rtems_task_argument) 
&bsp_boot_cmdline)
-#endif
-
-/**
- * When using the default Classic API Initialization Tasks Table, this is
- * used to specify the initial execution mode of the single Classic API task.
- */
-#ifndef CONFIGURE_INIT_TASK_INITIAL_MODES
-  #ifdef RTEMS_SMP
-#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES
-  #else
-#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT
-  #endif
-#endif
-
-/**
- * When using the default Classic API Initialization Tasks Table, this is
- * used to specify the initial argument to the single Classic API task.
- */
-#ifndef CONFIGURE_INIT_TASK_ARGUMENTS
-  #define CONFIGURE_INIT_TASK_ARGUMENTS 0
-#endif
-
-#else /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */
-
-/*
- * This is the stack size of the Initialization Task when none is configured.
- */
-#define CONFIGURE_INIT_TASK_STACK_SIZE 0
-
-#endif
-/**@}*/  /* end of Classic API Initialization Tasks Table */
-
 /**
  * @defgroup ConfigurationDriverTable Device Driver Table Configuration
  *
@@ -796,17 +705,6 @@ extern "C" {
  *  may have requested.
  */
 
-/*
- * This accounts for any extra memory required by the Classic API
- * Initialization Task.
- */
-#if (CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE)
-  #define _CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART \
-  (CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)
-#else
-  #define _CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART 0
-#endif
-
 /*
  * This accounts for any extra memory required by the POSIX API

Re: Waf Build System Status in RTEMS?

2020-02-21 Thread Sebastian Huber

Hello Hesham,

On 20/02/2020 16:40, Hesham Almatary wrote:

Hello,

Are there any progress updates to the Waf build system integration in RTEMS?

I have pulled [1] and it seems like it hasn't got many updates since
December. I wonder what's still remaining/blocking to merge it, or at
least push it as a development branch (without re-writing history)
that others, including me, can use it and submit patches against.

[1] git://git.rtems.org/sebh/rtems.git


technically, the new build system is ready for integration into the 
master branch. I would need about one day to rebase and test it before 
the push. The integration is currently blocked since Chris and Joel had 
no time to look at it.


--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Waf Build System Status in RTEMS?

2020-02-21 Thread Hesham Almatary
On Fri, 21 Feb 2020 at 11:07, Sebastian Huber
 wrote:
>
> Hello Hesham,
>
> On 20/02/2020 16:40, Hesham Almatary wrote:
> > Hello,
> >
> > Are there any progress updates to the Waf build system integration in RTEMS?
> >
> > I have pulled [1] and it seems like it hasn't got many updates since
> > December. I wonder what's still remaining/blocking to merge it, or at
> > least push it as a development branch (without re-writing history)
> > that others, including me, can use it and submit patches against.
> >
> > [1] git://git.rtems.org/sebh/rtems.git
>
> technically, the new build system is ready for integration into the
> master branch. I would need about one day to rebase and test it before
> the push. The integration is currently blocked since Chris and Joel had
> no time to look at it.
>
Thanks for your input, Sebastian. Is there a recommended branch I
should be based on? I noticed there's "build" and "build-next".
Do you intend to re-write git history in either?

> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail  : sebastian.hu...@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



-- 
Hesham
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: GSOC: Call for Mentors

2020-02-21 Thread Hesham Almatary
Hello Gedare,

I can mentor RISC-V related projects or co-mentor others I may have
experience with.

Regards,
Hesham

On Fri, 21 Feb 2020 at 05:41, Sebastian Huber
 wrote:
>
> Hello Gedare,
>
> I probably have no time to be a mentor this year. It depends a bit on
> the project and the student. I can help out as an active co-mentor.
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail  : sebastian.hu...@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel

-- 
Hesham
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Waf Build System Status in RTEMS?

2020-02-21 Thread Sebastian Huber

On 21/02/2020 12:26, Hesham Almatary wrote:

On Fri, 21 Feb 2020 at 11:07, Sebastian Huber
  wrote:

Hello Hesham,

On 20/02/2020 16:40, Hesham Almatary wrote:

Hello,

Are there any progress updates to the Waf build system integration in RTEMS?

I have pulled [1] and it seems like it hasn't got many updates since
December. I wonder what's still remaining/blocking to merge it, or at
least push it as a development branch (without re-writing history)
that others, including me, can use it and submit patches against.

[1] git://git.rtems.org/sebh/rtems.git

technically, the new build system is ready for integration into the
master branch. I would need about one day to rebase and test it before
the push. The integration is currently blocked since Chris and Joel had
no time to look at it.


Thanks for your input, Sebastian. Is there a recommended branch I
should be based on? I noticed there's "build" and "build-next".


The "build" branch contains the state of the first review. I updated 
"build-next" a couple of times to integrate the changes on the RTEMS master.



Do you intend to re-write git history in either?


Yes, when I started with the build system work I didn't expect a more 
than two months review period.


--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH] bsps/arm: Initialize priorities of PPIs

2020-02-21 Thread Sebastian Huber
From: "sebastian.huber" 

At least on GICv1 the interrupts 0 up to including 31 are so called
Peripheral Private Interrupts (PPIs).  We have to initialize the
priority of the PPIs on secondary processors.
---
 bsps/arm/shared/irq/irq-gic.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/bsps/arm/shared/irq/irq-gic.c b/bsps/arm/shared/irq/irq-gic.c
index 7cf469d0f7..42ae6c4d7d 100644
--- a/bsps/arm/shared/irq/irq-gic.c
+++ b/bsps/arm/shared/irq/irq-gic.c
@@ -152,6 +152,7 @@ BSP_START_TEXT_SECTION void 
arm_gic_irq_initialize_secondary_cpu(void)
 {
   volatile gic_cpuif *cpuif = GIC_CPUIF;
   volatile gic_dist *dist = ARM_GIC_DIST;
+  uint32_t id;
 
   while ((dist->icddcr & GIC_DIST_ICDDCR_ENABLE) == 0) {
 /* Wait */
@@ -161,6 +162,11 @@ BSP_START_TEXT_SECTION void 
arm_gic_irq_initialize_secondary_cpu(void)
   dist->icdigr[0] = 0x;
 #endif
 
+  /* Initialize Peripheral Private Interrupts (PPIs) */
+  for (id = 0; id < 32; ++id) {
+gic_id_set_priority(dist, id, PRIORITY_DEFAULT);
+  }
+
   cpuif->iccpmr = GIC_CPUIF_ICCPMR_PRIORITY(0xff);
   cpuif->iccbpr = GIC_CPUIF_ICCBPR_BINARY_POINT(0x0);
   cpuif->iccicr = CPUIF_ICCICR;
-- 
2.16.4

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: SPDX License Identifier Only and Full Copy?

2020-02-21 Thread Joel Sherrill
On Fri, Feb 21, 2020 at 2:31 AM Thomas Doerfler <
thomas.doerf...@embedded-brains.de> wrote:

> Hello,
>
> I think the GPL and the BSD licenses had a different approach from the
> start:
> - GPL always came with a separate "COPYING" file (and the GPL sources
> pointed to it)
> - BSD always/most of the times was included in the headers
>
> Lokking at how the linux kernel team handles this therefore only has a
> limited weight. So I tend to keep the BSD license text in the source
> code files.
>
> Keep in mind: We want to make sure the license topic is properly handled
> and clear. What is the harm to be conservative here and spend some extra
> lines of header in the files?
>
> Kind regards,
> Thomas.
>
> Am 21.02.20 um 02:15 schrieb Chris Johns:
> >
> >
> > On 21/2/20 12:11 pm, Joel Sherrill wrote:
> >>
> >>
> >> On Thu, Feb 20, 2020, 3:49 PM Chris Johns  >> > wrote:
> >>
> >> On 21/2/20 3:20 am, Gedare Bloom wrote:
> >> > On Thu, Feb 20, 2020 at 12:58 AM Thomas Doerfler
> >> >  >> > wrote:
> >> >>
> >> >> Hello,
> >> >>
> >> >> I just want to speak up here. I talked with Sebastian today and
> I really
> >> >> tend to keep the license text in each file.
> >> >>
> >> >> Rational:
> >> >>
> >> >> - With the BSD license, anyone can pick any file from the RTEMS
> repo and
> >> >> use/modify it in any project (and this is fine). The original
> authors
> >> >> (and their copyright) are listed in the file, but the only
> pointer to
> >> >> the legal part is the "SPDX identifier". I am not sure whether
> this is a
> >> >> legally binding "tag" and whether this tag is clear to any user.
> >> >>
> >> >> - Strictly seen, it is not even forbidden to remove the "SPDX
> >> >> identifier", because it is not part of the BSD-2-clause-license,
> it's
> >> >> just a pointer to it. In the end we might result in code
> drifting around
> >> >> without license information, which we all do not want to see.
> >> >>
> >> > This is a valid point. I also have no desire to be a lawyer.
> >> >
> >> > My intuition here is that, even without any licensing information
> at
> >> > all in individual files, one can still apply a single license to
> an
> >> > entire repository, e.g., BSD or GPL. For historical reasons, and
> >> > similar arguments as you've made, BSD-style licenses have tended
> to be
> >> > copy-pasted to individual files to make them easier to excerpt. We
> >> > don't have license uniformity, so we do need to individually
> specify
> >> > which license(s) apply to each file.
> >>
> >> This makes sense. The simplified BSD license states ...
> >>
> >>  1. Redistributions of source code must retain the above copyright
> >> notice, this list of conditions and the following disclaimer.
> >>
> >> I do not see how we can centralise this and have the "above
> copyright" work?
> >> Also the SPDX site here ...
> >>
> >>  https://spdx.org/ids-how
> >>
> >> ... under the heading "Standard license headers" states ...
> >>
> >>  When a license defines a recommended notice to attach to files
> >>  under that license (sometimes called a "standard header"), the SPDX
> >>  project recommends that the standard header be included in the
> files,
> >>  in addition to an SPDX ID.
> >>
> >> My reading of this means we should include the license in the
> source.
> >>
> >> We need to consider compliance and machine auditing of the source.
> The SPDX tag
> >> is important. Maybe ...
> >>
> >> /*
> >>  * SPDX tag suff
> >>  */
> >> /*
> >>  * Copyright stuff
> >>  *
> >>  * 2-Clause BSD license
> >>  */
> >>
> >> > Linux follows a similar philosophy as Sebastian suggests. I think
> we
> >> > can also follow Linux in this regards.
> >> > https://www.kernel.org/doc/html/latest/process/license-rules.html
> >> >
> >> > I would suggest we follow their approach to self-document the
> licenses
> >> > centrally. I suspect the risk of someone using code without
> adhering
> >> > to the license is no greater. Probably they have a higher risk
> >> > exposure than we do!
> >>
> >> I agree with the comments in the Linux license rules text about
> license text in
> >> files making it harder to check for compliance.
> >>
> >>
> >> Following Linux is probably a safe approach. I assume there was
> significant
> >> legal review of their policy.
> >
> > Does the Linux kernel rules apply to the 2 clause BSD license we have?
>

I am surprised no one thought to look at FreeBSD for similar advice. :)

https://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/pref-license.html


The example there has SPDX and license in the same comment block. Repeating
the text of the license in each file apparently.

The GPL is too long to repeat in a file

Re: SPDX License Identifier Only and Full Copy?

2020-02-21 Thread Sebastian Huber

On 21/02/2020 15:06, Joel Sherrill wrote:
I think we should following the FreeBSD guidance. Whether the license or 
Doxygen @file
is first is a different issue. I personally like the @file first. They 
aren't usually very long and
the license is visible when you open the file.  If someone can find 
another project's example

including both, that would be nice to see.

Seeing the license when I open a file tells me nothing about the file 
and then I have to
page down to see the comment. Perhaps I'm just old and telling you to 
get off my lawn

though. :)


My main goal is to have a foolproof file template for all our source 
files very soon.


Linux has the policy to put the SPDX at the first line if possible. The 
only exception are scripts which need an interpreter line for the shell 
(2. Style):


https://www.kernel.org/doc/html/latest/process/license-rules.html

Maybe we can use this policy in RTEMS as well (except for third-party 
code of course).


We can keep the BSD-2-Clause text in the file. We can also keep the 
@file on the top. Example:


/* SPDX-License-Identifier: BSD-2-Clause */

/**
 * @file
 *
 * @ingroup RTEMSApplicationConfiguration
 *
 * @brief Evaluate Configuration Options
 *
 * This header file includes a couple of header files which evaluate the
 * configuration options specified by the application.  The macros and 
defines

 * used to configure the system are documented in the Configuring a System
 * chapter of the Classic API User's Guide.
 */

/*
 * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
 * Copyright (C) 1989, 2000 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.
 *
 * 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.
 */


--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: SPDX License Identifier Only and Full Copy?

2020-02-21 Thread Thomas Doerfler
+1 from me.

Am 21.02.20 um 15:26 schrieb Sebastian Huber:
> 
> My main goal is to have a foolproof file template for all our source
> files very soon.
> 
> Linux has the policy to put the SPDX at the first line if possible. The
> only exception are scripts which need an interpreter line for the shell
> (2. Style):
> 
> https://www.kernel.org/doc/html/latest/process/license-rules.html
> 
> Maybe we can use this policy in RTEMS as well (except for third-party
> code of course).
> 
> We can keep the BSD-2-Clause text in the file. We can also keep the
> @file on the top. Example:
> 
> /* SPDX-License-Identifier: BSD-2-Clause */
> 
> /**
>  * @file
>  *
>  * @ingroup RTEMSApplicationConfiguration
>  *
>  * @brief Evaluate Configuration Options
>  *
>  * This header file includes a couple of header files which evaluate the
>  * configuration options specified by the application.  The macros and
> defines
>  * used to configure the system are documented in the Configuring a System
>  * chapter of the Classic API User's Guide.
>  */
> 
> /*
>  * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
>  * Copyright (C) 1989, 2000 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.
>  *
>  * 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.
>  */
> 
> 

-- 

embedded brains GmbH
Thomas Doerfler
Dornierstr. 4
D-82178 Puchheim
Germany
email: thomas.doerf...@embedded-brains.de
Phone: +49-89-18 94 741-12
Fax:   +49-89-18 94 741-09
PGP: Public key available on request.
For our privacy statement, see
https://embedded-brains.de/en/data-privacy-statement/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: SPDX License Identifier Only and Full Copy?

2020-02-21 Thread Andrew Butterfield
I like this because,
1. It tells me it is a BSD license (which the BSD license at the bottom doesn't)
2 . Then the stuff that tells me if the file is interesting (as per Joel's 
comment)
3. Then the license

Just my thruppence worth ;-)

Andrew

> On 21 Feb 2020, at 14:26, Sebastian Huber 
>  wrote:
> 
> We can keep the BSD-2-Clause text in the file. We can also keep the @file on 
> the top. Example:
> 
> /* SPDX-License-Identifier: BSD-2-Clause */
> 
> /**
> * @file
> *
> * @ingroup RTEMSApplicationConfiguration
> *
> * @brief Evaluate Configuration Options
> *
> * This header file includes a couple of header files which evaluate the
> * configuration options specified by the application.  The macros and defines
> * used to configure the system are documented in the Configuring a System
> * chapter of the Classic API User's Guide.
> */
> 
> /*
> * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
> * Copyright (C) 1989, 2000 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.
> *
> * 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.
> */
> 


Andrew Butterfield Tel: +353-1-896-2517 Fax: +353-1-677-2204
Lero@TCD, Head of Software Foundations & Verification Research Group
School of Computer Science and Statistics,
Room G.39, O'Reilly Institute, Trinity College, University of Dublin
 http://www.scss.tcd.ie/Andrew.Butterfield/


___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

rtems-boot-image tool: Raspberry Pi

2020-02-21 Thread G. S. Niteesh
Hi,

This is regarding adding RPi support to the boot image generation tool.

The boot process for Raspberry Pi is very unconventional. The GPU starts
first, initializes RAM, other hardware, loads the bootloaders and then
starts
the ARM CPU.

The minimum files that are required to boot an RPi are
bootcode.bin, startx.elf, fixup.dat, kernel.img, config.txt
There are also other variants of startx.elf and fixup.dat.
Please have a look at
https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md
for information on the variants.

>From what I have tried on my Rpi3 model b v1.2 the minimum files that are
required are start_x.elf, fixup_x.dat, bootcode.bin, kernel.img, config.txt
But for this to work, we must add start_x=1 to config.txt because by default
start.elf is loaded.

So, what should be the values for the first and second stages in
rtems-boot.ini for Rpi?
And also wouldn't it be nice if we could add a files field, which will copy
the specified files
to the image? This would save a lot of typing in case of RPi

Thank you,
Niteesh.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Project for GSoC 2020

2020-02-21 Thread Utkarsh Rai
Thanks, I will check it out.

On Fri, Feb 21, 2020 at 12:56 AM Gedare Bloom  wrote:

> On Tue, Feb 18, 2020 at 12:45 PM Utkarsh Rai 
> wrote:
> >
> > Based on your feedback,  adding memory protection or enhancing Wi-fi
> Support in libbsd are two projects that I would like to work upon.
> >
> > For MMU support I think a lot unmerged PowerPC code is already present,
> but since  I would be using BBB I would only be able to use that as a
> reference. Is it feasible to start it from scratch?
> >
> The state-of-the-art has advanced in the rtems.git tree since these
> projects happened, and it is not all documented. The ARM in particular
> generally uses a static initialization or boot-time initialization of
> the MMU. You  should study how the ARM approach works in the RTEMS
> main repo, and consider whether that approach can be adopted by other
> architectures/BSPs, how to improve that approach, and how to build
> higher-level services on top of the low-level BSP support that exists.
>
> One of the main interesting applications is to provide thread stack
> protection.
>
> > For Wi-Fi support, I would require an RTL8188 USB dongle along with JTAG
> for debugging purposes. I am not quite sure about how to handle the
> 'hot-plugging' case in this project it would be very helpful if someone
> could point me in the right direction.
> >
> I can't speak to the WiFi support, maybe others know. But to get
> started you would need to at least demonstrate that you have the
> necessary hardware to succeed and that you can at a minimum boot/run
> BBB with libbsd, and probably we should like you to show that you can
> generate patches for libbsd.
>
> Gedare
>
> >
> > On Tue, Feb 18, 2020 at 1:21 AM Gedare Bloom  wrote:
> >>
> >>
> >> On Mon, Feb 17, 2020 at 9:42 AM Utkarsh Rai 
> wrote:
> >>>
> >>> Hello everyone,
> >>
> >> Hello Utkarsh Rai,
> >>
> >>>
> >>> I would like to contribute to the Beagleboard BSP project, in
> particular towards the improvement of the peripheral support. I have a few
> questions pertaining to the same:-
> >>>
> >>> 1. Is adding support for Ethernet and USB a reasonable goal for the
> duration of the GSOC?
> >>>
> >>> 2. FreeBSD has support for Ethernet and USB  can we port that to
> libbsd?
> >>>
> >>> 3. What are the deliverables for this project, for instance, would I
> be required to add shell support for these peripherals or maybe an example
> app?
> >>>
> >>> I have also attached a screenshot of the changed  'hello world'
> program along with this email
> >>
> >> Thanks. It is nice to see that you already ran it successfully on the
> BBB.
> >>
> >> As of now, the BBB has quite mature support including Ethernet and USB.
> There is another student actively working on a proposal to expand our BBB
> support a bit further. I'm not certain if there is sufficient
> work/interest/mentoring available to support multiple BBB projects. You
> might consider what specific projects would interest you though. You should
> take a look at past years' GSoC projects documented on our wiki, they are
> linked from our main 'GSoC' page.
> >>
> >> There are also lots of interesting projects that can be done in a
> BSP-agnostic way, but still could be valuable to test with the BBB. The
> most important aspect about doing development with a BBB is that you can
> use the JTAG, which requires some soldering and additional effort to work
> with a standalone JTAG debugger.  If you don't have that, and want to work
> with the BBB, it is highly recommended.
> >>
> >>
> >>>
> >>> ___
> >>> devel mailing list
> >>> devel@rtems.org
> >>> http://lists.rtems.org/mailman/listinfo/devel
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH] Add CoreMark Benchmark

2020-02-21 Thread Hesham Almatary
CoreMark's primary goals are simplicity and providing a method for testing only 
a processor's core features.
It is used primarily here as a performance benchmark

Built and tested for RISC-V rv64imafdc_medany on QEMU and HW
---
 .gitmodules  |  3 +++
 benchmarks/coremark/coremark |  1 +
 benchmarks/coremark/wscript  | 48 
 benchmarks/wscript   |  2 ++
 4 files changed, 54 insertions(+)
 create mode 16 benchmarks/coremark/coremark
 create mode 100644 benchmarks/coremark/wscript

diff --git a/.gitmodules b/.gitmodules
index ae86e49..2bcba90 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
 [submodule "rtems_waf"]
path = rtems_waf
url = git://git.rtems.org/rtems_waf.git
+[submodule "benchmarks/coremark/coremark"]
+   path = benchmarks/coremark/coremark
+   url = g...@github.com:CTSRD-CHERI/coremark.git
diff --git a/benchmarks/coremark/coremark b/benchmarks/coremark/coremark
new file mode 16
index 000..cdafe98
--- /dev/null
+++ b/benchmarks/coremark/coremark
@@ -0,0 +1 @@
+Subproject commit cdafe986865cf46a3222f7bf28be82fc8d96fa8f
diff --git a/benchmarks/coremark/wscript b/benchmarks/coremark/wscript
new file mode 100644
index 000..c2c225a
--- /dev/null
+++ b/benchmarks/coremark/wscript
@@ -0,0 +1,48 @@
+#-
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2020 Hesham Almatary
+#
+# This software was developed by SRI International and the University of
+# Cambridge Computer Laboratory (Department of Computer Science and
+# Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the
+# DARPA SSITH research programme.
+#
+# 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.
+#
+
+import rtems_waf.rtems as rtems
+
+def build(bld):
+rtems.build(bld)
+
+bld(features = 'c cprogram',
+target = 'coremark.bin',
+includes = 'coremark/ coremark/rtems',
+source = ['coremark/rtems/core_portme.c',
+  'coremark/core_list_join.c', 'coremark/core_main.c', 
'coremark/core_matrix.c', 'coremark/core_state.c', 'coremark/core_util.c'],
+
+defines = [
+# FLAGS_STR is used within CoreMark to print the compiler flags used
+'FLAGS_STR="'+' '.join([str(flag) for flag in bld.env.CFLAGS])+'"'
+]
+)
diff --git a/benchmarks/wscript b/benchmarks/wscript
index 12741e7..24db85b 100644
--- a/benchmarks/wscript
+++ b/benchmarks/wscript
@@ -1,3 +1,4 @@
+# Copyright 2020 Hesham Almatary (hesham.almat...@cl.cam.ac.uk)
 # Copyright 2013 Gedare Bloom (ged...@rtems.org)
 #
 # This file's license is 2-clause BSD as in this distribution's LICENSE.2 file.
@@ -7,4 +8,5 @@ import rtems_waf.rtems as rtems
 
 def build(bld):
 bld.recurse('nbench')
+bld.recurse('coremark')
 
-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH v2] Add Amaan to MAINTAINERS

2020-02-21 Thread Gedare Bloom
This second one looks good, please push!

On Thu, Feb 20, 2020 at 9:55 PM Amaan Cheval  wrote:
>
> ---
>  MAINTAINERS | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f00f2753f2..437b55418b 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -51,6 +51,7 @@ Ben Gras   b...@rtems.org
>  Pavel Pisa pp...@pikron.com
>  Christian Mauderer christian.maude...@embedded-brains.de
>  Hesham Almataryheshamelmat...@gmail.com
> +Amaan Cheval   am...@rtems.org
>
>  Localized Write Permission
>  ==
> @@ -58,4 +59,5 @@ sparc  Daniel Hellstrom 
> (dan...@gaisler.com)
>  beagle Ben Gras (b...@rtems.org)
>  tms570 Pavel Pisa (p...@cmp.felk.cvut.cz)
>  raspberrypiPavel Pisa (p...@cmp.felk.cvut.cz)
> +x86_64 Amaan Cheval (am...@rtems.org)
>
> --
> 2.23.0
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: SPDX License Identifier Only and Full Copy?

2020-02-21 Thread Gedare Bloom
On Fri, Feb 21, 2020 at 7:38 AM Andrew Butterfield
 wrote:
>
> I like this because,
> 1. It tells me it is a BSD license (which the BSD license at the bottom 
> doesn't)
> 2 . Then the stuff that tells me if the file is interesting (as per Joel's 
> comment)
> 3. Then the license
>
> Just my thruppence worth ;-)
>
> Andrew
>
> On 21 Feb 2020, at 14:26, Sebastian Huber 
>  wrote:
>
> We can keep the BSD-2-Clause text in the file. We can also keep the @file on 
> the top. Example:
>
+1

I like this approach best. I think it offers a great compromise.

> /* SPDX-License-Identifier: BSD-2-Clause */
>
> /**
> * @file
> *
> * @ingroup RTEMSApplicationConfiguration
> *
> * @brief Evaluate Configuration Options
> *
> * This header file includes a couple of header files which evaluate the
> * configuration options specified by the application.  The macros and defines
> * used to configure the system are documented in the Configuring a System
> * chapter of the Classic API User's Guide.
> */
>
> /*
> * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
> * Copyright (C) 1989, 2000 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.
> *
> * 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.
> */
>
>
> 
> Andrew Butterfield Tel: +353-1-896-2517 Fax: +353-1-677-2204
> Lero@TCD, Head of Software Foundations & Verification Research Group
> School of Computer Science and Statistics,
> Room G.39, O'Reilly Institute, Trinity College, University of Dublin
>  http://www.scss.tcd.ie/Andrew.Butterfield/
> 
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] Add CoreMark Benchmark

2020-02-21 Thread Gedare Bloom
What is the difference between the CTSRD-CHERI fork and the upstream Coremark?

It should be made clear in the repo the license of the Coremark (APL
1.0 I believe)

On Fri, Feb 21, 2020 at 10:00 AM Hesham Almatary
 wrote:
>
> CoreMark's primary goals are simplicity and providing a method for testing 
> only a processor's core features.
> It is used primarily here as a performance benchmark
>
> Built and tested for RISC-V rv64imafdc_medany on QEMU and HW
> ---
>  .gitmodules  |  3 +++
>  benchmarks/coremark/coremark |  1 +
>  benchmarks/coremark/wscript  | 48 
>  benchmarks/wscript   |  2 ++
>  4 files changed, 54 insertions(+)
>  create mode 16 benchmarks/coremark/coremark
>  create mode 100644 benchmarks/coremark/wscript
>
> diff --git a/.gitmodules b/.gitmodules
> index ae86e49..2bcba90 100644
> --- a/.gitmodules
> +++ b/.gitmodules
> @@ -1,3 +1,6 @@
>  [submodule "rtems_waf"]
> path = rtems_waf
> url = git://git.rtems.org/rtems_waf.git
> +[submodule "benchmarks/coremark/coremark"]
> +   path = benchmarks/coremark/coremark
> +   url = g...@github.com:CTSRD-CHERI/coremark.git
> diff --git a/benchmarks/coremark/coremark b/benchmarks/coremark/coremark
> new file mode 16
> index 000..cdafe98
> --- /dev/null
> +++ b/benchmarks/coremark/coremark
> @@ -0,0 +1 @@
> +Subproject commit cdafe986865cf46a3222f7bf28be82fc8d96fa8f
> diff --git a/benchmarks/coremark/wscript b/benchmarks/coremark/wscript
> new file mode 100644
> index 000..c2c225a
> --- /dev/null
> +++ b/benchmarks/coremark/wscript
> @@ -0,0 +1,48 @@
> +#-
> +# SPDX-License-Identifier: BSD-2-Clause
> +#
> +# Copyright (c) 2020 Hesham Almatary
> +#
> +# This software was developed by SRI International and the University of
> +# Cambridge Computer Laboratory (Department of Computer Science and
> +# Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the
> +# DARPA SSITH research programme.
> +#
> +# 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.
> +#
> +
> +import rtems_waf.rtems as rtems
> +
> +def build(bld):
> +rtems.build(bld)
> +
> +bld(features = 'c cprogram',
> +target = 'coremark.bin',
> +includes = 'coremark/ coremark/rtems',
> +source = ['coremark/rtems/core_portme.c',
> +  'coremark/core_list_join.c', 'coremark/core_main.c', 
> 'coremark/core_matrix.c', 'coremark/core_state.c', 'coremark/core_util.c'],
> +
> +defines = [
> +# FLAGS_STR is used within CoreMark to print the compiler flags used
> +'FLAGS_STR="'+' '.join([str(flag) for flag in bld.env.CFLAGS])+'"'
> +]
> +)
> diff --git a/benchmarks/wscript b/benchmarks/wscript
> index 12741e7..24db85b 100644
> --- a/benchmarks/wscript
> +++ b/benchmarks/wscript
> @@ -1,3 +1,4 @@
> +# Copyright 2020 Hesham Almatary (hesham.almat...@cl.cam.ac.uk)
>  # Copyright 2013 Gedare Bloom (ged...@rtems.org)
>  #
>  # This file's license is 2-clause BSD as in this distribution's LICENSE.2 
> file.
> @@ -7,4 +8,5 @@ import rtems_waf.rtems as rtems
>
>  def build(bld):
>  bld.recurse('nbench')
> +bld.recurse('coremark')
>
> --
> 2.17.1
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] Add CoreMark Benchmark

2020-02-21 Thread Hesham Almatary
On Fri, 21 Feb 2020 at 17:11, Gedare Bloom  wrote:
>
> What is the difference between the CTSRD-CHERI fork and the upstream Coremark?
>
I submitted a pending PR to CoreMark/upstream to add RTEMS support
[1]. I have more flexbility and control over the CTSRD-CHERI fork to
push/use
fixess/features more quickly. Furthermore, CHERI-related bits and
another pending PR aren't upstream yet [2].

Currently, I have no problem just using the upstream one once my PR is
merged and later if we add CHERI support to RTEMS upstream, change the
fork.

[1] https://github.com/eembc/coremark/pull/21
[2] https://github.com/eembc/coremark/pull/19

> It should be made clear in the repo the license of the Coremark (APL
> 1.0 I believe)
>
That's included in the coremark repo itself. Do you suggest adding a
note in the commit message about the license?

> On Fri, Feb 21, 2020 at 10:00 AM Hesham Almatary
>  wrote:
> >
> > CoreMark's primary goals are simplicity and providing a method for testing 
> > only a processor's core features.
> > It is used primarily here as a performance benchmark
> >
> > Built and tested for RISC-V rv64imafdc_medany on QEMU and HW
> > ---
> >  .gitmodules  |  3 +++
> >  benchmarks/coremark/coremark |  1 +
> >  benchmarks/coremark/wscript  | 48 
> >  benchmarks/wscript   |  2 ++
> >  4 files changed, 54 insertions(+)
> >  create mode 16 benchmarks/coremark/coremark
> >  create mode 100644 benchmarks/coremark/wscript
> >
> > diff --git a/.gitmodules b/.gitmodules
> > index ae86e49..2bcba90 100644
> > --- a/.gitmodules
> > +++ b/.gitmodules
> > @@ -1,3 +1,6 @@
> >  [submodule "rtems_waf"]
> > path = rtems_waf
> > url = git://git.rtems.org/rtems_waf.git
> > +[submodule "benchmarks/coremark/coremark"]
> > +   path = benchmarks/coremark/coremark
> > +   url = g...@github.com:CTSRD-CHERI/coremark.git
> > diff --git a/benchmarks/coremark/coremark b/benchmarks/coremark/coremark
> > new file mode 16
> > index 000..cdafe98
> > --- /dev/null
> > +++ b/benchmarks/coremark/coremark
> > @@ -0,0 +1 @@
> > +Subproject commit cdafe986865cf46a3222f7bf28be82fc8d96fa8f
> > diff --git a/benchmarks/coremark/wscript b/benchmarks/coremark/wscript
> > new file mode 100644
> > index 000..c2c225a
> > --- /dev/null
> > +++ b/benchmarks/coremark/wscript
> > @@ -0,0 +1,48 @@
> > +#-
> > +# SPDX-License-Identifier: BSD-2-Clause
> > +#
> > +# Copyright (c) 2020 Hesham Almatary
> > +#
> > +# This software was developed by SRI International and the University of
> > +# Cambridge Computer Laboratory (Department of Computer Science and
> > +# Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of 
> > the
> > +# DARPA SSITH research programme.
> > +#
> > +# 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.
> > +#
> > +
> > +import rtems_waf.rtems as rtems
> > +
> > +def build(bld):
> > +rtems.build(bld)
> > +
> > +bld(features = 'c cprogram',
> > +target = 'coremark.bin',
> > +includes = 'coremark/ coremark/rtems',
> > +source = ['coremark/rtems/core_portme.c',
> > +  'coremark/core_list_join.c', 'coremark/core_main.c', 
> > 'coremark/core_matrix.c', 'coremark/core_state.c', 'coremark/core_util.c'],
> > +
> > +defines = [
> > +# FLAGS_STR is used within CoreMark to print the compiler flags 
> > used
> > +'FLAGS_STR="'+' '.join([str(flag) for flag in bld.env.CFLAGS])+'"'
> > +]
> > +)
> > diff --git a/benchmarks/wscript b/benchmarks/wscript
> > index 12741e7..24db85b 100644
> > --- a/benchmarks/wscript
> > +++ b/benchmarks/wscript
> > @@ -1,3 +1,4 @@

Re: [PATCH v2] Add Amaan to MAINTAINERS

2020-02-21 Thread Amaan Cheval
Done!
https://git.rtems.org/rtems/commit/?id=486829b2766119275f74e7a2a11d7bf3a9561f54

On Fri, Feb 21, 2020 at 10:35 PM Gedare Bloom  wrote:

> This second one looks good, please push!
>
> On Thu, Feb 20, 2020 at 9:55 PM Amaan Cheval 
> wrote:
> >
> > ---
> >  MAINTAINERS | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index f00f2753f2..437b55418b 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -51,6 +51,7 @@ Ben Gras   b...@rtems.org
> >  Pavel Pisa pp...@pikron.com
> >  Christian Mauderer christian.maude...@embedded-brains.de
> >  Hesham Almataryheshamelmat...@gmail.com
> > +Amaan Cheval   am...@rtems.org
> >
> >  Localized Write Permission
> >  ==
> > @@ -58,4 +59,5 @@ sparc  Daniel Hellstrom (
> dan...@gaisler.com)
> >  beagle Ben Gras (b...@rtems.org)
> >  tms570 Pavel Pisa (p...@cmp.felk.cvut.cz)
> >  raspberrypiPavel Pisa (p...@cmp.felk.cvut.cz)
> > +x86_64 Amaan Cheval (am...@rtems.org)
> >
> > --
> > 2.23.0
> >
> > ___
> > devel mailing list
> > devel@rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] Add CoreMark Benchmark

2020-02-21 Thread Joel Sherrill
Is this being added to rtems-examples?

Is it clear where this came from (URL) and what version it is per the
origin?

Do all of examples build for you with waf? I tried this week and they all
build with make but not waf?

How do the numbers look?

Except for origin statement, none of this is a reason not to merge.

--joel

On Fri, Feb 21, 2020, 11:00 AM Hesham Almatary 
wrote:

> CoreMark's primary goals are simplicity and providing a method for testing
> only a processor's core features.
> It is used primarily here as a performance benchmark
>
> Built and tested for RISC-V rv64imafdc_medany on QEMU and HW
> ---
>  .gitmodules  |  3 +++
>  benchmarks/coremark/coremark |  1 +
>  benchmarks/coremark/wscript  | 48 
>  benchmarks/wscript   |  2 ++
>  4 files changed, 54 insertions(+)
>  create mode 16 benchmarks/coremark/coremark
>  create mode 100644 benchmarks/coremark/wscript
>
> diff --git a/.gitmodules b/.gitmodules
> index ae86e49..2bcba90 100644
> --- a/.gitmodules
> +++ b/.gitmodules
> @@ -1,3 +1,6 @@
>  [submodule "rtems_waf"]
> path = rtems_waf
> url = git://git.rtems.org/rtems_waf.git
> +[submodule "benchmarks/coremark/coremark"]
> +   path = benchmarks/coremark/coremark
> +   url = g...@github.com:CTSRD-CHERI/coremark.git
> diff --git a/benchmarks/coremark/coremark b/benchmarks/coremark/coremark
> new file mode 16
> index 000..cdafe98
> --- /dev/null
> +++ b/benchmarks/coremark/coremark
> @@ -0,0 +1 @@
> +Subproject commit cdafe986865cf46a3222f7bf28be82fc8d96fa8f
> diff --git a/benchmarks/coremark/wscript b/benchmarks/coremark/wscript
> new file mode 100644
> index 000..c2c225a
> --- /dev/null
> +++ b/benchmarks/coremark/wscript
> @@ -0,0 +1,48 @@
> +#-
> +# SPDX-License-Identifier: BSD-2-Clause
> +#
> +# Copyright (c) 2020 Hesham Almatary
> +#
> +# This software was developed by SRI International and the University of
> +# Cambridge Computer Laboratory (Department of Computer Science and
> +# Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of
> the
> +# DARPA SSITH research programme.
> +#
> +# 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.
> +#
> +
> +import rtems_waf.rtems as rtems
> +
> +def build(bld):
> +rtems.build(bld)
> +
> +bld(features = 'c cprogram',
> +target = 'coremark.bin',
> +includes = 'coremark/ coremark/rtems',
> +source = ['coremark/rtems/core_portme.c',
> +  'coremark/core_list_join.c', 'coremark/core_main.c',
> 'coremark/core_matrix.c', 'coremark/core_state.c', 'coremark/core_util.c'],
> +
> +defines = [
> +# FLAGS_STR is used within CoreMark to print the compiler flags
> used
> +'FLAGS_STR="'+' '.join([str(flag) for flag in bld.env.CFLAGS])+'"'
> +]
> +)
> diff --git a/benchmarks/wscript b/benchmarks/wscript
> index 12741e7..24db85b 100644
> --- a/benchmarks/wscript
> +++ b/benchmarks/wscript
> @@ -1,3 +1,4 @@
> +# Copyright 2020 Hesham Almatary (hesham.almat...@cl.cam.ac.uk)
>  # Copyright 2013 Gedare Bloom (ged...@rtems.org)
>  #
>  # This file's license is 2-clause BSD as in this distribution's LICENSE.2
> file.
> @@ -7,4 +8,5 @@ import rtems_waf.rtems as rtems
>
>  def build(bld):
>  bld.recurse('nbench')
> +bld.recurse('coremark')
>
> --
> 2.17.1
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] Add CoreMark Benchmark

2020-02-21 Thread Joel Sherrill
On Fri, Feb 21, 2020, 11:27 AM Hesham Almatary 
wrote:

> On Fri, 21 Feb 2020 at 17:11, Gedare Bloom  wrote:
> >
> > What is the difference between the CTSRD-CHERI fork and the upstream
> Coremark?
> >
> I submitted a pending PR to CoreMark/upstream to add RTEMS support
> [1]. I have more flexbility and control over the CTSRD-CHERI fork to
> push/use
> fixess/features more quickly. Furthermore, CHERI-related bits and
> another pending PR aren't upstream yet [2].
>
> Currently, I have no problem just using the upstream one once my PR is
> merged and later if we add CHERI support to RTEMS upstream, change the
> fork.
>
> [1] https://github.com/eembc/coremark/pull/21
> [2] https://github.com/eembc/coremark/pull/19
>
> > It should be made clear in the repo the license of the Coremark (APL
> > 1.0 I believe)
> >
> That's included in the coremark repo itself. Do you suggest adding a
> note in the commit message about the license?
>

That would be good but it should also be in the contents of the repo so a
tar release has the info.

>
> > On Fri, Feb 21, 2020 at 10:00 AM Hesham Almatary
> >  wrote:
> > >
> > > CoreMark's primary goals are simplicity and providing a method for
> testing only a processor's core features.
> > > It is used primarily here as a performance benchmark
> > >
> > > Built and tested for RISC-V rv64imafdc_medany on QEMU and HW
> > > ---
> > >  .gitmodules  |  3 +++
> > >  benchmarks/coremark/coremark |  1 +
> > >  benchmarks/coremark/wscript  | 48 
> > >  benchmarks/wscript   |  2 ++
> > >  4 files changed, 54 insertions(+)
> > >  create mode 16 benchmarks/coremark/coremark
> > >  create mode 100644 benchmarks/coremark/wscript
> > >
> > > diff --git a/.gitmodules b/.gitmodules
> > > index ae86e49..2bcba90 100644
> > > --- a/.gitmodules
> > > +++ b/.gitmodules
> > > @@ -1,3 +1,6 @@
> > >  [submodule "rtems_waf"]
> > > path = rtems_waf
> > > url = git://git.rtems.org/rtems_waf.git
> > > +[submodule "benchmarks/coremark/coremark"]
> > > +   path = benchmarks/coremark/coremark
> > > +   url = g...@github.com:CTSRD-CHERI/coremark.git
> > > diff --git a/benchmarks/coremark/coremark
> b/benchmarks/coremark/coremark
> > > new file mode 16
> > > index 000..cdafe98
> > > --- /dev/null
> > > +++ b/benchmarks/coremark/coremark
> > > @@ -0,0 +1 @@
> > > +Subproject commit cdafe986865cf46a3222f7bf28be82fc8d96fa8f
> > > diff --git a/benchmarks/coremark/wscript b/benchmarks/coremark/wscript
> > > new file mode 100644
> > > index 000..c2c225a
> > > --- /dev/null
> > > +++ b/benchmarks/coremark/wscript
> > > @@ -0,0 +1,48 @@
> > > +#-
> > > +# SPDX-License-Identifier: BSD-2-Clause
> > > +#
> > > +# Copyright (c) 2020 Hesham Almatary
> > > +#
> > > +# This software was developed by SRI International and the University
> of
> > > +# Cambridge Computer Laboratory (Department of Computer Science and
> > > +# Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as
> part of the
> > > +# DARPA SSITH research programme.
> > > +#
> > > +# 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.
> > > +#
> > > +
> > > +import rtems_waf.rtems as rtems
> > > +
> > > +def build(bld):
> > > +rtems.build(bld)
> > > +
> > > +bld(features = 'c cprogram',
> > > +target = 'coremark.bin',
> > > +includes = 'coremark/ coremark/rtems',
> > > +source = ['coremark/rtems/core_portme.c',
> > > +  'coremark/core_list_join.c',
> 'coremark/core_main.c', 'coremark/core_matrix.c', 'coremark/core_state.c',
> 'coremark/core_util.c'],
> > > +
> > > +   

Re: SPDX License Identifier Only and Full Copy?

2020-02-21 Thread Chris Johns

> On 22 Feb 2020, at 6:08 am, Gedare Bloom  wrote:
> 
> On Fri, Feb 21, 2020 at 7:38 AM Andrew Butterfield
>  wrote:
>> 
>> I like this because,
>> 1. It tells me it is a BSD license (which the BSD license at the bottom 
>> doesn't)
>> 2 . Then the stuff that tells me if the file is interesting (as per Joel's 
>> comment)
>> 3. Then the license
>> 
>> Just my thruppence worth ;-)
>> 
>> Andrew
>> 
>> On 21 Feb 2020, at 14:26, Sebastian Huber 
>>  wrote:
>> 
>> We can keep the BSD-2-Clause text in the file. We can also keep the @file on 
>> the top. Example:
>> 
> +1
> 
> I like this approach best. I think it offers a great compromise.

+1

Chris

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: SPDX License Identifier Only and Full Copy?

2020-02-21 Thread Joel Sherrill
On Fri, Feb 21, 2020, 8:34 AM Andrew Butterfield <
andrew.butterfi...@cs.tcd.ie> wrote:

> I like this because,
> 1. It tells me it is a BSD license (which the BSD license at the bottom
> doesn't)
> 2 . Then the stuff that tells me if the file is interesting (as per Joel's
> comment)
> 3. Then the license
>

+1

And to toss in another decision point, the ntpsec project has a thread now
that copyright statements do not need to include years. Apparently, Debian
has some opinions on this and from what I can tell, it simplifies an
overall copyright report.


> Just my thruppence worth ;-)
>

How much is that worth at the current exchange rate? :)

>
> ANDREW
>
> On 21 Feb 2020, at 14:26, Sebastian Huber <
> sebastian.hu...@embedded-brains.de> wrote:
>
> We can keep the BSD-2-Clause text in the file. We can also keep the @file
> on the top. Example:
>
> /* SPDX-License-Identifier: BSD-2-Clause */
>
> /**
> * @file
> *
> * @ingroup RTEMSApplicationConfiguration
> *
> * @brief Evaluate Configuration Options
> *
> * This header file includes a couple of header files which evaluate the
> * configuration options specified by the application.  The macros and
> defines
> * used to configure the system are documented in the Configuring a System
> * chapter of the Classic API User's Guide.
> */
>
> /*
> * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
> * Copyright (C) 1989, 2000 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.
> *
> * 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.
> */
>
>
> 
> Andrew Butterfield Tel: +353-1-896-2517 Fax: +353-1-677-2204
> Lero@TCD, Head of Software Foundations & Verification Research Group
> School of Computer Science and Statistics,
> Room G.39, O'Reilly Institute, Trinity College, University of Dublin
>  http://www.scss.tcd.ie/Andrew.Butterfield/
> 
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel