diff options
Diffstat (limited to 'cpukit/score/include/rtems')
-rw-r--r-- | cpukit/score/include/rtems/score/heap.h | 30 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/interr.h | 3 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/wkspace.h | 14 |
3 files changed, 41 insertions, 6 deletions
diff --git a/cpukit/score/include/rtems/score/heap.h b/cpukit/score/include/rtems/score/heap.h index 964386a36f..36ef48f3b6 100644 --- a/cpukit/score/include/rtems/score/heap.h +++ b/cpukit/score/include/rtems/score/heap.h @@ -675,6 +675,36 @@ Heap_Resize_status _Heap_Resize_block( uintptr_t *new_size ); +RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( + uintptr_t value, + uintptr_t alignment +) +{ + uintptr_t remainder = value % alignment; + + if ( remainder != 0 ) { + return value - remainder + alignment; + } else { + return value; + } +} + +/** + * @brief Returns the worst case overhead to manage a memory area. + */ +RTEMS_INLINE_ROUTINE uintptr_t _Heap_Area_overhead( + uintptr_t page_size +) +{ + if ( page_size != 0 ) { + page_size = _Heap_Align_up( page_size, CPU_ALIGNMENT ); + } else { + page_size = CPU_ALIGNMENT; + } + + return 2 * (page_size - 1) + HEAP_BLOCK_HEADER_SIZE; +} + #if !defined(__RTEMS_APPLICATION__) #include <rtems/score/heap.inl> diff --git a/cpukit/score/include/rtems/score/interr.h b/cpukit/score/include/rtems/score/interr.h index 19342a3db8..2a21fe01eb 100644 --- a/cpukit/score/include/rtems/score/interr.h +++ b/cpukit/score/include/rtems/score/interr.h @@ -72,7 +72,8 @@ typedef enum { INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0, INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP, INTERNAL_ERROR_GXX_KEY_ADD_FAILED, - INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED + INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED, + INTERNAL_ERROR_NO_MEMORY_FOR_HEAP } Internal_errors_Core_list; typedef uint32_t Internal_errors_t; diff --git a/cpukit/score/include/rtems/score/wkspace.h b/cpukit/score/include/rtems/score/wkspace.h index 10b80ccaab..db6eb38f96 100644 --- a/cpukit/score/include/rtems/score/wkspace.h +++ b/cpukit/score/include/rtems/score/wkspace.h @@ -36,19 +36,23 @@ extern "C" { #include <rtems/score/interr.h> /** - * @brief Executive Workspace Control + * @brief Executive workspace control. * - * The is the heap control structure that used to manage the - * RTEMS Executive Workspace. + * This is the heap control structure used to manage the RTEMS Executive + * Workspace. */ -SCORE_EXTERN Heap_Control _Workspace_Area; /* executive heap header */ +SCORE_EXTERN Heap_Control _Workspace_Area; /** * @brief Workspace Handler Initialization * * This routine performs the initialization necessary for this handler. */ -void _Workspace_Handler_initialization(void); +void _Workspace_Handler_initialization( + Heap_Area *areas, + size_t area_count, + Heap_Initialization_or_extend_handler extend +); /** * @brief Allocate Memory from Workspace |