diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-02-04 13:56:41 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-02-06 15:19:35 +0100 |
commit | 8ecbc3826edfbfebabf5b9b75243df8b04421073 (patch) | |
tree | c2d172bad057023e18b2d53ded98eef69593e145 /cpukit/include/rtems/confdefs.h | |
parent | config: CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY (diff) | |
download | rtems-8ecbc3826edfbfebabf5b9b75243df8b04421073.tar.bz2 |
sysinit: Add RTEMS_SYSINIT_ZERO_MEMORY
Use a dedicate system initialization step to zero the memory used for
the workspace and C program heap.
This avoids dead code in case CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY is
not configured.
Diffstat (limited to 'cpukit/include/rtems/confdefs.h')
-rw-r--r-- | cpukit/include/rtems/confdefs.h | 15 |
1 files changed, 10 insertions, 5 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" |