diff options
Diffstat (limited to 'cpukit/include/rtems/confdefs')
23 files changed, 240 insertions, 60 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 bc96713765..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 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 118ad29484..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 @@ -188,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 1f77948676..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 diff --git a/cpukit/include/rtems/confdefs/libio.h b/cpukit/include/rtems/confdefs/libio.h index 1b84f8c20f..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 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 a8dae6e739..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 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 b91590bfd9..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 @@ -136,20 +136,6 @@ RTEMS_DEFINE_GLOBAL_SYMBOL( const size_t _Thread_Idle_stack_size = CONFIGURE_IDLE_TASK_STACK_SIZE; -/* - * If the user provides a custom idle stack allocator, then we do not need - * memory reserved for the stacks but the symbol is still referenced in - * threadcreateidle.c. The code path just never uses it. Make it minimal - * size to proceed. - */ -#ifndef CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE - 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" ); -#endif - #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" 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 82de8633bf..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 \ @@ -212,15 +223,40 @@ const uintptr_t _Stack_Space_size = _CONFIGURE_STACK_SPACE_SIZE; #error "CONFIGURE_TASK_STACK_ALLOCATOR and CONFIGURE_TASK_STACK_DEALLOCATOR must be both defined or both undefined" #endif -/* - * Custom IDLE thread stacks allocator. If this is provided, it is assumed - * that the allocator is providing its own memory for these stacks. - */ -#ifdef CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE - const Stack_Allocator_allocate_for_idle _Stack_Allocator_allocate_for_idle = - CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE; +#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 |