diff options
Diffstat (limited to 'cpukit/include')
-rw-r--r-- | cpukit/include/rtems/confdefs.h | 15 | ||||
-rw-r--r-- | cpukit/include/rtems/config.h | 11 | ||||
-rw-r--r-- | cpukit/include/rtems/score/memory.h | 13 | ||||
-rw-r--r-- | cpukit/include/rtems/sysinit.h | 3 |
4 files changed, 27 insertions, 15 deletions
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h index 7d0d3fbeab..982e3ddb56 100644 --- a/cpukit/include/rtems/confdefs.h +++ b/cpukit/include/rtems/confdefs.h @@ -2778,11 +2778,6 @@ struct _reent *__getreent(void) CONFIGURE_TASK_STACK_ALLOCATOR_INIT, /* stack allocator init */ CONFIGURE_TASK_STACK_ALLOCATOR, /* stack allocator */ CONFIGURE_TASK_STACK_DEALLOCATOR, /* stack deallocator */ - #ifdef CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY /* true to clear memory */ - true, - #else - false, - #endif #ifdef CONFIGURE_UNIFIED_WORK_AREAS /* true for unified work areas */ true, #else @@ -2807,6 +2802,16 @@ struct _reent *__getreent(void) #endif }; + #ifdef CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY + const bool _Memory_Zero_before_use = true; + + RTEMS_SYSINIT_ITEM( + _Memory_Zero_free_areas, + RTEMS_SYSINIT_ZERO_MEMORY, + 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" diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h index 15e944dd2f..fac5c6e009 100644 --- a/cpukit/include/rtems/config.h +++ b/cpukit/include/rtems/config.h @@ -29,6 +29,7 @@ #include <rtems/score/object.h> #include <rtems/score/isr.h> +#include <rtems/score/memory.h> #include <rtems/score/userextdata.h> #include <rtems/score/watchdogticks.h> #include <rtems/rtems/config.h> @@ -148,14 +149,6 @@ typedef struct { */ rtems_stack_free_hook stack_free_hook; - /** - * If this element is TRUE, then RTEMS will zero the Executive Workspace. - * When this element is FALSE, it is assumed that the BSP or invoking - * environment has ensured that memory was cleared before RTEMS was - * invoked. - */ - bool do_zero_of_workspace; - /** * @brief Specifies if a unified work area is used or not. * @@ -241,7 +234,7 @@ uint32_t rtems_configuration_get_maximum_extensions( void ); * RTEMS is responsible for zeroing the Executive Workspace. */ #define rtems_configuration_get_do_zero_of_workspace() \ - (Configuration.do_zero_of_workspace) + _Memory_Zero_before_use #define rtems_configuration_get_number_of_initial_extensions() \ ((uint32_t) _User_extensions_Initial_count) diff --git a/cpukit/include/rtems/score/memory.h b/cpukit/include/rtems/score/memory.h index f26c7f4031..ffc4897ed5 100644 --- a/cpukit/include/rtems/score/memory.h +++ b/cpukit/include/rtems/score/memory.h @@ -331,6 +331,19 @@ void *_Memory_Allocate( */ void _Memory_Fill( const Memory_Information *information, int c ); +/** + * @brief Indicates if the memory is zeroed during system initialization. + * + * This value is provided via <rtems/confdefs.h> in case + * CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY is defined. + */ +extern const bool _Memory_Zero_before_use; + +/** + * @brief Zeros all free memory areas of the system. + */ +void _Memory_Zero_free_areas( void ); + /** @} */ #ifdef __cplusplus diff --git a/cpukit/include/rtems/sysinit.h b/cpukit/include/rtems/sysinit.h index 58f35542b7..d181c42780 100644 --- a/cpukit/include/rtems/sysinit.h +++ b/cpukit/include/rtems/sysinit.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018 embedded brains GmbH. All rights reserved. + * Copyright (c) 2015, 2020 embedded brains GmbH. All rights reserved. * * embedded brains GmbH * Dornierstr. 4 @@ -30,6 +30,7 @@ extern "C" { #define RTEMS_SYSINIT_BSP_EARLY 000140 #define RTEMS_SYSINIT_MEMORY 000180 #define RTEMS_SYSINIT_DIRTY_MEMORY 0001c0 +#define RTEMS_SYSINIT_ZERO_MEMORY 0001e0 #define RTEMS_SYSINIT_ISR_STACK 000200 #define RTEMS_SYSINIT_PER_CPU_DATA 000220 #define RTEMS_SYSINIT_SBRK 000240 |