diff options
Diffstat (limited to 'cpukit/include/rtems/confdefs')
23 files changed, 327 insertions, 98 deletions
diff --git a/cpukit/include/rtems/confdefs/bdbuf.h b/cpukit/include/rtems/confdefs/bdbuf.h index 79e991f6d9..1cffe3fef6 100644 --- a/cpukit/include/rtems/confdefs/bdbuf.h +++ b/cpukit/include/rtems/confdefs/bdbuf.h @@ -18,7 +18,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/cpukit/include/rtems/confdefs/bsp.h b/cpukit/include/rtems/confdefs/bsp.h index 03ad9bf55f..9e50b14f26 100644 --- a/cpukit/include/rtems/confdefs/bsp.h +++ b/cpukit/include/rtems/confdefs/bsp.h @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2013 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2013 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -41,19 +41,8 @@ #error "Do not include this file directly, use <rtems/confdefs.h> instead" #endif -#ifdef CONFIGURE_INIT - -#ifdef CONFIGURE_DISABLE_BSP_SETTINGS - #undef BSP_IDLE_TASK_BODY - #undef BSP_IDLE_TASK_STACK_SIZE - #undef BSP_INITIAL_EXTENSION - #undef BSP_INTERRUPT_STACK_SIZE - #undef CONFIGURE_BSP_PREREQUISITE_DRIVERS - #undef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK -#else - #include <bsp.h> +#if defined(CONFIGURE_INIT) && !defined(CONFIGURE_DISABLE_BSP_SETTINGS) +#include <bsp.h> #endif -#endif /* CONFIGURE_INIT */ - #endif /* _RTEMS_CONFDEFS_BSP_H */ diff --git a/cpukit/include/rtems/confdefs/clock.h b/cpukit/include/rtems/confdefs/clock.h index 4e86ec5d02..e57daa899b 100644 --- a/cpukit/include/rtems/confdefs/clock.h +++ b/cpukit/include/rtems/confdefs/clock.h @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -70,6 +70,11 @@ #warning "The clock ticks per second is not an integer" #endif +#if defined(CONFIGURE_TICKS_PER_TIMESLICE) \ + && CONFIGURE_TICKS_PER_TIMESLICE <= 0 + #error "CONFIGURE_TICKS_PER_TIMESLICE shall be greater than zero" +#endif + #if CONFIGURE_MICROSECONDS_PER_TICK <= 0 #error "CONFIGURE_MICROSECONDS_PER_TICK must be positive" #endif diff --git a/cpukit/include/rtems/confdefs/console.h b/cpukit/include/rtems/confdefs/console.h index f4ee59feea..9e12fa4c86 100644 --- a/cpukit/include/rtems/confdefs/console.h +++ b/cpukit/include/rtems/confdefs/console.h @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/cpukit/include/rtems/confdefs/extensions.h b/cpukit/include/rtems/confdefs/extensions.h index 83d690d50a..c3bceda773 100644 --- a/cpukit/include/rtems/confdefs/extensions.h +++ b/cpukit/include/rtems/confdefs/extensions.h @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -93,6 +93,10 @@ #include <rtems/stackchk.h> #endif +#ifdef CONFIGURE_EXCEPTION_TO_SIGNAL_MAPPING + #include <rtems/score/exception.h> +#endif + #ifdef __cplusplus extern "C" { #endif @@ -103,6 +107,9 @@ extern "C" { || defined(CONFIGURE_INITIAL_EXTENSIONS) \ || defined(BSP_INITIAL_EXTENSION) const User_extensions_Table _User_extensions_Initial_extensions[] = { + #ifdef CONFIGURE_EXCEPTION_TO_SIGNAL_MAPPING + { .fatal = _Exception_Raise_signal }, + #endif #ifdef _CONFIGURE_RECORD_NEED_EXTENSION { #ifdef CONFIGURE_RECORD_EXTENSIONS_ENABLED @@ -139,7 +146,8 @@ extern "C" { #ifdef CONFIGURE_INITIAL_EXTENSIONS CONFIGURE_INITIAL_EXTENSIONS, #endif - #ifdef BSP_INITIAL_EXTENSION + #if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \ + defined(BSP_INITIAL_EXTENSION) BSP_INITIAL_EXTENSION #endif }; @@ -180,6 +188,14 @@ extern "C" { RTEMS_SYSINIT_RECORD, RTEMS_SYSINIT_ORDER_MIDDLE ); + + #ifdef CONFIGURE_RECORD_INTERRUPTS_ENABLED + RTEMS_SYSINIT_ITEM( + _Record_Interrupt_initialize, + RTEMS_SYSINIT_LAST, + RTEMS_SYSINIT_ORDER_MIDDLE + ); + #endif #endif #ifdef CONFIGURE_VERBOSE_SYSTEM_INITIALIZATION diff --git a/cpukit/include/rtems/confdefs/face.h b/cpukit/include/rtems/confdefs/face.h new file mode 100644 index 0000000000..317d821623 --- /dev/null +++ b/cpukit/include/rtems/confdefs/face.h @@ -0,0 +1,82 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup RTEMSImplApplConfig + * + * @brief This header file evaluates configuration options related to + * the FACE Technical Standard. + * + * The FACE Technical Standard (https://opengroup.org/face) is an + * open standard designed for safety critical embedded systems. It + * includes POSIX profiles and requirements that promote safety + * and portability. As a general rules, the profiles place a minimum + * on the services which an operating system must provide. Those + * same profile definitions represent the maximum services which + * an application may use. + */ + +/* + * Copyright (C) 2022 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. + */ + +#ifndef _RTEMS_CONFDEFS_FACE_H +#define _RTEMS_CONFDEFS_FACE_H + +#ifndef __CONFIGURATION_TEMPLATE_h +#error "Do not include this file directly, use <rtems/confdefs.h> instead" +#endif + +#ifdef CONFIGURE_INIT + +#ifdef CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR + + #include <rtems/posix/timer.h> + + int _POSIX_Timer_Is_allowed( + clockid_t clock_id + ) + { + /* + * Per the FACE Technical Standard, POSIX timers should not be + * allowed on CLOCK_REALTIME for safety reasons. If the application + * wants the FACE behavior, then this method is instantiated. + */ + if ( clock_id == CLOCK_REALTIME ) { + return EPERM; + } + + if ( clock_id != CLOCK_MONOTONIC ) { + return EINVAL; + } + + return 0; + } + +#endif /* CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR */ + +#endif /* CONFIGURE_INIT */ + +#endif /* _RTEMS_CONFDEFS_FACE_H */ diff --git a/cpukit/include/rtems/confdefs/inittask.h b/cpukit/include/rtems/confdefs/inittask.h index 9dbf0b967b..0b17c08677 100644 --- a/cpukit/include/rtems/confdefs/inittask.h +++ b/cpukit/include/rtems/confdefs/inittask.h @@ -13,7 +13,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -122,8 +122,9 @@ RTEMS_STATIC_ASSERT( CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE_IS_TOO_SMALL ); +static RTEMS_SECTION( ".rtemsstack.userinit" ) RTEMS_ALIGNED( RTEMS_TASK_STORAGE_ALIGNMENT ) -static char _RTEMS_tasks_User_task_storage[ CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE ]; +char _RTEMS_tasks_User_task_storage[ CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE ]; const RTEMS_tasks_User_task_config _RTEMS_tasks_User_task_config = { { diff --git a/cpukit/include/rtems/confdefs/initthread.h b/cpukit/include/rtems/confdefs/initthread.h index 2b3d957515..325795b754 100644 --- a/cpukit/include/rtems/confdefs/initthread.h +++ b/cpukit/include/rtems/confdefs/initthread.h @@ -13,7 +13,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/cpukit/include/rtems/confdefs/iodrivers.h b/cpukit/include/rtems/confdefs/iodrivers.h index e12640624d..16d64fbb98 100644 --- a/cpukit/include/rtems/confdefs/iodrivers.h +++ b/cpukit/include/rtems/confdefs/iodrivers.h @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,16 +43,30 @@ #ifdef CONFIGURE_INIT -#if defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) \ - || defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) \ - || defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) \ - || defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) \ - || defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) \ - || defined(CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER) \ - || defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) \ - || defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) \ - || defined(CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER) \ - || CONFIGURE_MAXIMUM_DRIVERS > 0 +#include <rtems/confdefs/bsp.h> + +#if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \ + defined(CONFIGURE_BSP_PREREQUISITE_DRIVERS) +#define _CONFIGURE_BSP_PREREQUISITE_DRIVERS CONFIGURE_BSP_PREREQUISITE_DRIVERS +#endif + +#if defined(_CONFIGURE_BSP_PREREQUISITE_DRIVERS) || \ + defined(CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS) || \ + defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) || \ + defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) || \ + defined(CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER) || \ + defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) || \ + defined(CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER) || \ + defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) || \ + defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) || \ + defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) || \ + defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) +#define _CONFIGURE_HAS_IO_DRIVERS +#endif + +#if defined(_CONFIGURE_HAS_IO_DRIVERS) || \ + defined(CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER) || \ + CONFIGURE_MAXIMUM_DRIVERS > 0 #include <rtems/ioimpl.h> #include <rtems/sysinit.h> @@ -110,8 +124,8 @@ extern "C" { rtems_driver_address_table _IO_Driver_address_table[ CONFIGURE_MAXIMUM_DRIVERS ] = { - #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS - CONFIGURE_BSP_PREREQUISITE_DRIVERS, + #ifdef _CONFIGURE_BSP_PREREQUISITE_DRIVERS + _CONFIGURE_BSP_PREREQUISITE_DRIVERS, #endif #ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS, @@ -143,15 +157,8 @@ _IO_Driver_address_table[ CONFIGURE_MAXIMUM_DRIVERS ] = { #ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS CONFIGURE_APPLICATION_EXTRA_DRIVERS, #endif - #if defined(CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER) \ - || ( !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) \ - && !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) \ - && !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) \ - && !defined(CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER) \ - && !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) \ - && !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) \ - && !defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) \ - && !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) ) + #if defined(CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER) || \ + !defined(_CONFIGURE_HAS_IO_DRIVERS) NULL_DRIVER_TABLE_ENTRY #endif }; @@ -178,16 +185,30 @@ RTEMS_SYSINIT_ITEM( } #endif -#endif /* CONFIGURE_APPLICATION_EXTRA_DRIVERS - || CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER - || CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - || CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER - || CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER - || CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER - || CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER - || CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER - || CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER - || CONFIGURE_MAXIMUM_DRIVERS */ +#endif /* _CONFIGURE_HAS_IO_DRIVERS) || + CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER || + CONFIGURE_MAXIMUM_DRIVERS */ + + +/* + * If any flavor of console driver is configured, then configure the post + * driver hook which opens /dev/console as stdin, stdout, and stderr. + * + * NOTE: This also results in an atexit() handler being registered to close + * /dev/console. + */ +#if defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) || \ + defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER) || \ + defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER) + + #include <rtems/libio.h> + + RTEMS_SYSINIT_ITEM( + rtems_libio_post_driver, + RTEMS_SYSINIT_STD_FILE_DESCRIPTORS, + RTEMS_SYSINIT_ORDER_MIDDLE + ); +#endif #endif /* CONFIGURE_INIT */ diff --git a/cpukit/include/rtems/confdefs/libio.h b/cpukit/include/rtems/confdefs/libio.h index 16a4fb6962..7cf9f46487 100644 --- a/cpukit/include/rtems/confdefs/libio.h +++ b/cpukit/include/rtems/confdefs/libio.h @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -145,6 +145,16 @@ #ifdef CONFIGURE_FILESYSTEM_JFFS2 #include <rtems/jffs2.h> + +#ifndef CONFIGURE_JFFS2_DELAYED_WRITE_TASK_PRIORITY + #define CONFIGURE_JFFS2_DELAYED_WRITE_TASK_PRIORITY \ + RTEMS_JFFS2_DELAYED_WRITE_TASK_PRIORITY_DEFAULT +#endif + +const rtems_jffs2_config jffs2_config = { + CONFIGURE_JFFS2_DELAYED_WRITE_TASK_PRIORITY, +}; + #endif #ifdef CONFIGURE_FILESYSTEM_NFS @@ -231,9 +241,9 @@ static const rtems_filesystem_operations_table IMFS_root_ops = { #endif rtems_filesystem_default_fsunmount, #ifdef CONFIGURE_IMFS_DISABLE_UTIME - rtems_filesystem_default_utime, + rtems_filesystem_default_utimens, #else - IMFS_utime, + IMFS_utimens, #endif #ifdef CONFIGURE_IMFS_DISABLE_SYMLINK rtems_filesystem_default_symlink, diff --git a/cpukit/include/rtems/confdefs/libpci.h b/cpukit/include/rtems/confdefs/libpci.h index fb30eacdfa..07bf346f69 100644 --- a/cpukit/include/rtems/confdefs/libpci.h +++ b/cpukit/include/rtems/confdefs/libpci.h @@ -1,10 +1,4 @@ -/* - * 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. - */ +/* SPDX-License-Identifier: BSD-2-Clause */ /** * @file @@ -15,6 +9,31 @@ * library configuration. */ +/* + * Copyright (C) 2011 Cobham Gaisler AB + * + * 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. + */ + #ifndef _RTEMS_CONFDEFS_LIBPCI_H #define _RTEMS_CONFDEFS_LIBPCI_H diff --git a/cpukit/include/rtems/confdefs/malloc.h b/cpukit/include/rtems/confdefs/malloc.h index d864a98270..a20c6a290e 100644 --- a/cpukit/include/rtems/confdefs/malloc.h +++ b/cpukit/include/rtems/confdefs/malloc.h @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -45,8 +45,12 @@ #include <rtems/confdefs/bsp.h> -#if defined(CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK) \ - || defined(CONFIGURE_MALLOC_DIRTY) +#if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \ + defined(CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK) +#define _CONFIGURE_HEAP_EXTEND_VIA_SBRK +#endif + +#if defined(_CONFIGURE_HEAP_EXTEND_VIA_SBRK) || defined(CONFIGURE_MALLOC_DIRTY) #include <rtems/malloc.h> #endif @@ -54,7 +58,7 @@ extern "C" { #endif -#ifdef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK +#ifdef _CONFIGURE_HEAP_EXTEND_VIA_SBRK const rtems_heap_extend_handler rtems_malloc_extend_handler = rtems_heap_extend_via_sbrk; #endif diff --git a/cpukit/include/rtems/confdefs/mpci.h b/cpukit/include/rtems/confdefs/mpci.h index 76bdf4af16..e079a59d70 100644 --- a/cpukit/include/rtems/confdefs/mpci.h +++ b/cpukit/include/rtems/confdefs/mpci.h @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/cpukit/include/rtems/confdefs/newlib.h b/cpukit/include/rtems/confdefs/newlib.h index 96bf850163..65393fe92d 100644 --- a/cpukit/include/rtems/confdefs/newlib.h +++ b/cpukit/include/rtems/confdefs/newlib.h @@ -13,7 +13,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,7 +57,8 @@ extern "C" { #endif -#ifdef _CONFIGURE_ENABLE_NEWLIB_REENTRANCY +#if defined(_CONFIGURE_ENABLE_NEWLIB_REENTRANCY) && \ + !defined(_REENT_THREAD_LOCAL) struct _reent *__getreent( void ) { return _Thread_Get_executing()->libc_reent; diff --git a/cpukit/include/rtems/confdefs/objectsclassic.h b/cpukit/include/rtems/confdefs/objectsclassic.h index ff6f79a30b..aec4cf388b 100644 --- a/cpukit/include/rtems/confdefs/objectsclassic.h +++ b/cpukit/include/rtems/confdefs/objectsclassic.h @@ -12,7 +12,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/cpukit/include/rtems/confdefs/objectsposix.h b/cpukit/include/rtems/confdefs/objectsposix.h index b4685c28f7..7dabb326f4 100644 --- a/cpukit/include/rtems/confdefs/objectsposix.h +++ b/cpukit/include/rtems/confdefs/objectsposix.h @@ -12,7 +12,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/cpukit/include/rtems/confdefs/obsolete.h b/cpukit/include/rtems/confdefs/obsolete.h index b8b041efb5..a2eedad794 100644 --- a/cpukit/include/rtems/confdefs/obsolete.h +++ b/cpukit/include/rtems/confdefs/obsolete.h @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2017, 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2017, 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/cpukit/include/rtems/confdefs/percpu.h b/cpukit/include/rtems/confdefs/percpu.h index badb616988..8ea7dae250 100644 --- a/cpukit/include/rtems/confdefs/percpu.h +++ b/cpukit/include/rtems/confdefs/percpu.h @@ -18,7 +18,7 @@ */ /* - * Copyright (C) 2018, 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2018, 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -78,7 +78,8 @@ extern "C" { /* Interrupt stack configuration */ #ifndef CONFIGURE_INTERRUPT_STACK_SIZE - #ifdef BSP_INTERRUPT_STACK_SIZE + #if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \ + defined(BSP_INTERRUPT_STACK_SIZE) #define CONFIGURE_INTERRUPT_STACK_SIZE BSP_INTERRUPT_STACK_SIZE #else #define CONFIGURE_INTERRUPT_STACK_SIZE CPU_STACK_MINIMUM_SIZE @@ -121,7 +122,8 @@ RTEMS_DEFINE_GLOBAL_SYMBOL( /* Idle thread configuration */ #ifndef CONFIGURE_IDLE_TASK_STACK_SIZE - #ifdef BSP_IDLE_TASK_STACK_SIZE + #if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \ + defined(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 @@ -134,18 +136,13 @@ RTEMS_DEFINE_GLOBAL_SYMBOL( const size_t _Thread_Idle_stack_size = CONFIGURE_IDLE_TASK_STACK_SIZE; -char _Thread_Idle_stacks[ - _CONFIGURE_MAXIMUM_PROCESSORS - * ( CONFIGURE_IDLE_TASK_STACK_SIZE + CPU_IDLE_TASK_IS_FP * CONTEXT_FP_SIZE ) -] RTEMS_ALIGNED( CPU_INTERRUPT_STACK_ALIGNMENT ) -RTEMS_SECTION( ".rtemsstack.idle" ); - #if defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) && \ !defined(CONFIGURE_IDLE_TASK_BODY) #error "If you define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION, then you must define CONFIGURE_IDLE_TASK_BODY as well" #endif -#if !defined(CONFIGURE_IDLE_TASK_BODY) && defined(BSP_IDLE_TASK_BODY) +#if !defined(CONFIGURE_IDLE_TASK_BODY) && \ + !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && defined(BSP_IDLE_TASK_BODY) #define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY #endif diff --git a/cpukit/include/rtems/confdefs/scheduler.h b/cpukit/include/rtems/confdefs/scheduler.h index 84ca810fd7..fdad17a4e1 100644 --- a/cpukit/include/rtems/confdefs/scheduler.h +++ b/cpukit/include/rtems/confdefs/scheduler.h @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -234,7 +234,17 @@ extern "C" { #endif #ifdef CONFIGURE_SCHEDULER + /* + * Ignore these warnings: + * + * - invalid use of structure with flexible array member + * + * - struct has no members + */ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpedantic" CONFIGURE_SCHEDULER; + #pragma GCC diagnostic pop #endif const Scheduler_Control _Scheduler_Table[] = { diff --git a/cpukit/include/rtems/confdefs/threads.h b/cpukit/include/rtems/confdefs/threads.h index 279c6264db..2e83df73b0 100644 --- a/cpukit/include/rtems/confdefs/threads.h +++ b/cpukit/include/rtems/confdefs/threads.h @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -147,7 +147,15 @@ const size_t _Thread_Maximum_TLS_size = CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE; struct Thread_Configured_control { +/* + * This was added to address the following warning. + * warning: invalid use of structure with flexible array member + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" Thread_Control Control; +#pragma GCC diagnostic pop + #if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0 void *extensions[ CONFIGURE_MAXIMUM_USER_EXTENSIONS + 1 ]; #endif @@ -159,10 +167,9 @@ struct Thread_Configured_control { #if CONFIGURE_MAXIMUM_THREAD_NAME_SIZE > 1 char name[ CONFIGURE_MAXIMUM_THREAD_NAME_SIZE ]; #endif - #ifdef _CONFIGURE_ENABLE_NEWLIB_REENTRANCY + #if defined(_CONFIGURE_ENABLE_NEWLIB_REENTRANCY) && \ + !defined(_REENT_THREAD_LOCAL) struct _reent Newlib; - #else - struct { /* Empty */ } Newlib; #endif }; @@ -176,13 +183,17 @@ const Thread_Control_add_on _Thread_Control_add_ons[] = { Control.API_Extensions[ THREAD_API_RTEMS ] ), offsetof( Thread_Configured_control, API_RTEMS ) - }, { - offsetof( - Thread_Configured_control, - Control.libc_reent - ), - offsetof( Thread_Configured_control, Newlib ) } + #if defined(_CONFIGURE_ENABLE_NEWLIB_REENTRANCY) && \ + !defined(_REENT_THREAD_LOCAL) + , { + offsetof( + Thread_Configured_control, + Control.libc_reent + ), + offsetof( Thread_Configured_control, Newlib ) + } + #endif #if CONFIGURE_MAXIMUM_THREAD_NAME_SIZE > 1 , { offsetof( @@ -208,7 +219,14 @@ const size_t _Thread_Control_add_on_count = #ifdef RTEMS_SMP struct Thread_queue_Configured_heads { +/* + * This was put in to address the following warning. + * warning: invalid use of structure with flexible array member + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" Thread_queue_Heads Heads; +#pragma GCC diagnostic pop Thread_queue_Priority_queue Priority[ _CONFIGURE_SCHEDULER_COUNT ]; }; @@ -217,6 +235,10 @@ const size_t _Thread_Control_add_on_count = #endif const size_t _Thread_Initial_thread_count = +#if !defined(CONFIGURE_IDLE_TASK_STORAGE_SIZE) && \ + !defined(CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE) + _CONFIGURE_MAXIMUM_PROCESSORS + +#endif rtems_resource_maximum_per_allocation( _CONFIGURE_TASKS ) + rtems_resource_maximum_per_allocation( CONFIGURE_MAXIMUM_POSIX_THREADS ); diff --git a/cpukit/include/rtems/confdefs/unlimited.h b/cpukit/include/rtems/confdefs/unlimited.h index 41e79af1ba..98475297ed 100644 --- a/cpukit/include/rtems/confdefs/unlimited.h +++ b/cpukit/include/rtems/confdefs/unlimited.h @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/cpukit/include/rtems/confdefs/wkspace.h b/cpukit/include/rtems/confdefs/wkspace.h index 1db4f2d09d..65f66c5c48 100644 --- a/cpukit/include/rtems/confdefs/wkspace.h +++ b/cpukit/include/rtems/confdefs/wkspace.h @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2020, 2021 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020, 2021 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -47,6 +47,7 @@ #include <rtems/confdefs/inittask.h> #include <rtems/confdefs/initthread.h> #include <rtems/confdefs/objectsposix.h> +#include <rtems/confdefs/percpu.h> #include <rtems/confdefs/threads.h> #include <rtems/confdefs/wkspacesupport.h> #include <rtems/score/coremsg.h> @@ -111,8 +112,18 @@ + 1024 * CONFIGURE_MEMORY_OVERHEAD \ + _CONFIGURE_HEAP_HANDLER_OVERHEAD ) +#if defined(CONFIGURE_IDLE_TASK_STORAGE_SIZE) || \ + defined(CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE) + #define _CONFIGURE_IDLE_TASK_STACKS 0 +#else + #define _CONFIGURE_IDLE_TASK_STACKS \ + ( _CONFIGURE_MAXIMUM_PROCESSORS * \ + _Configure_From_stackspace( CONFIGURE_IDLE_TASK_STACK_SIZE ) ) +#endif + #define _CONFIGURE_STACK_SPACE_SIZE \ ( _CONFIGURE_INIT_TASK_STACK_EXTRA \ + + _CONFIGURE_IDLE_TASK_STACKS \ + _CONFIGURE_POSIX_INIT_THREAD_STACK_EXTRA \ + _CONFIGURE_LIBBLOCK_TASKS_STACK_EXTRA \ + CONFIGURE_EXTRA_TASK_STACKS \ @@ -167,12 +178,14 @@ const uintptr_t _Stack_Space_size = _CONFIGURE_STACK_SPACE_SIZE; #pragma GCC diagnostic ignored "-Wpragmas" #pragma GCC diagnostic ignored "-Wtautological-pointer-compare" + /* Custom allocator may or may not use the work space. */ #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE const bool _Stack_Allocator_avoids_workspace = true; #else const bool _Stack_Allocator_avoids_workspace = false; #endif + /* Custom allocator may or may not need initialization. */ #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_INIT const Stack_Allocator_initialize _Stack_Allocator_initialize = _CONFIGURE_ASSERT_NOT_NULL( @@ -187,6 +200,7 @@ const uintptr_t _Stack_Space_size = _CONFIGURE_STACK_SPACE_SIZE; ); #endif + /* Custom allocator must include allocate and free */ const Stack_Allocator_allocate _Stack_Allocator_allocate = _CONFIGURE_ASSERT_NOT_NULL( Stack_Allocator_allocate, @@ -200,11 +214,49 @@ const uintptr_t _Stack_Space_size = _CONFIGURE_STACK_SPACE_SIZE; ); #pragma GCC diagnostic pop + +/* + * Must provide both a custom stack allocator and deallocator + */ #elif defined(CONFIGURE_TASK_STACK_ALLOCATOR) \ || defined(CONFIGURE_TASK_STACK_DEALLOCATOR) #error "CONFIGURE_TASK_STACK_ALLOCATOR and CONFIGURE_TASK_STACK_DEALLOCATOR must be both defined or both undefined" #endif +#ifdef CONFIGURE_IDLE_TASK_STORAGE_SIZE + #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE + #error "CONFIGURE_IDLE_TASK_STORAGE_SIZE and CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE are mutually exclusive" + #endif + + #define _CONFIGURE_IDLE_TASK_STORAGE_SIZE \ + RTEMS_ALIGN_UP( \ + RTEMS_TASK_STORAGE_SIZE( \ + CONFIGURE_IDLE_TASK_STORAGE_SIZE, \ + RTEMS_DEFAULT_ATTRIBUTES \ + ), \ + CPU_INTERRUPT_STACK_ALIGNMENT \ + ) + + const size_t _Stack_Allocator_allocate_for_idle_storage_size = + _CONFIGURE_IDLE_TASK_STORAGE_SIZE; + + char _Stack_Allocator_allocate_for_idle_storage_areas[ + _CONFIGURE_MAXIMUM_PROCESSORS * _CONFIGURE_IDLE_TASK_STORAGE_SIZE + ] RTEMS_ALIGNED( CPU_INTERRUPT_STACK_ALIGNMENT ) + RTEMS_SECTION( ".rtemsstack.idle" ); + + #define CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE \ + _Stack_Allocator_allocate_for_idle_static +#endif + +#ifndef CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE + #define CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE \ + _Stack_Allocator_allocate_for_idle_workspace +#endif + +const Stack_Allocator_allocate_for_idle _Stack_Allocator_allocate_for_idle = + CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE; + #ifdef CONFIGURE_DIRTY_MEMORY RTEMS_SYSINIT_ITEM( _Memory_Dirty_free_areas, diff --git a/cpukit/include/rtems/confdefs/wkspacesupport.h b/cpukit/include/rtems/confdefs/wkspacesupport.h index 4036a7ae7f..ada91d7e91 100644 --- a/cpukit/include/rtems/confdefs/wkspacesupport.h +++ b/cpukit/include/rtems/confdefs/wkspacesupport.h @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions |