From 3f1bf0ce4b3cc7eed25897d5f6f81c232976ff19 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 27 May 2015 09:04:25 +0200 Subject: sapi: Fix workspace size estimate --- cpukit/sapi/include/confdefs.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'cpukit/sapi') diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index 9e66357d6d..0a12787aeb 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -27,6 +27,7 @@ */ #include #include +#include #include #ifdef CONFIGURE_DISABLE_BSP_SETTINGS @@ -2944,6 +2945,14 @@ const rtems_libio_helper rtems_fs_init_helper = #define CONFIGURE_MEMORY_FOR_POSIX 0 #endif +/* + * We must be able to split the free block used for the second last allocation + * into two parts so that we have a free block for the last allocation. See + * _Heap_Block_split(). + */ +#define CONFIGURE_HEAP_HANDLER_OVERHEAD \ + _Configure_Align_up( HEAP_ALLOC_BONUS, CPU_HEAP_ALIGNMENT ) + /* * Calculate the RAM size based on the maximum number of objects configured. */ @@ -3106,7 +3115,7 @@ const rtems_libio_helper rtems_fs_init_helper = * This is an internal parameter. */ #define CONFIGURE_EXECUTIVE_RAM_SIZE \ -(( \ +( \ CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \ CONFIGURE_MEMORY_FOR_TASKS( \ CONFIGURE_TASKS, CONFIGURE_TASKS) + \ @@ -3121,8 +3130,9 @@ const rtems_libio_helper rtems_fs_init_helper = CONFIGURE_MEMORY_FOR_MP + \ CONFIGURE_MEMORY_FOR_SMP + \ CONFIGURE_MESSAGE_BUFFER_MEMORY + \ - (CONFIGURE_MEMORY_OVERHEAD * 1024) \ -) & ~0x7) + (CONFIGURE_MEMORY_OVERHEAD * 1024) + \ + CONFIGURE_HEAP_HANDLER_OVERHEAD \ +) /* * Now account for any extra memory that initialization tasks or threads @@ -3253,7 +3263,8 @@ const rtems_libio_helper rtems_fs_init_helper = CONFIGURE_ADA_TASKS_STACK + \ CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK + \ CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS + \ - CONFIGURE_EXTRA_TASK_STACKS \ + CONFIGURE_EXTRA_TASK_STACKS + \ + CONFIGURE_HEAP_HANDLER_OVERHEAD \ ) #ifdef CONFIGURE_INIT -- cgit v1.2.3