From 7042065c29bbd42e5dd01f1b161a62bf57730d55 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 23 May 2007 22:09:28 +0000 Subject: [PATCH] 2007-05-23 Joel Sherrill * sapi/include/confdefs.h: Add CONFIGURE_MESSAGE_BUFFER_MEMORY so there is less dependence on CONFIGURE_MEMORY_OVERHEAD. Do not arbitrarily add 1 to CONFIGURE_MEMORY_OVERHEAD so we do not waste a kilobyte for unused Workspace. Round the workspace required size to an 8 byte boundary instead of a 0x400 byte one. We may end up needing to add 8 bytes again to account for the alignment rounding. --- cpukit/ChangeLog | 9 +++++++++ cpukit/sapi/include/confdefs.h | 28 ++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index e31c748b96..0f96dd7d0f 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,12 @@ +2007-05-23 Joel Sherrill + + * sapi/include/confdefs.h: Add CONFIGURE_MESSAGE_BUFFER_MEMORY so there + is less dependence on CONFIGURE_MEMORY_OVERHEAD. Do not arbitrarily + add 1 to CONFIGURE_MEMORY_OVERHEAD so we do not waste a kilobyte for + unused Workspace. Round the workspace required size to an 8 byte + boundary instead of a 0x400 byte one. We may end up needing to add 8 + bytes again to account for the alignment rounding. + 2007-05-23 Joel Sherrill Yu Chen diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index b32d9a84ac..900e3af759 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -1001,14 +1001,29 @@ itron_initialization_tasks_table ITRON_Initialization_tasks[] = { #endif -#ifndef CONFIGURE_MEMORY_OVERHEAD -#define CONFIGURE_MEMORY_OVERHEAD 0 -#endif - +/* + * This is so we can account for tasks with stacks greater than minimum + * size. This is in bytes. + */ #ifndef CONFIGURE_EXTRA_TASK_STACKS #define CONFIGURE_EXTRA_TASK_STACKS 0 #endif +/* + * Account for pending message buffers in bytes. + */ +#ifndef CONFIGURE_MESSAGE_BUFFER_MEMORY +#define CONFIGURE_MESSAGE_BUFFER_MEMORY 0 +#endif + +/* + * Catch all for extra memory in case something broken and underestimates. + * Historically this was used for message buffers. + */ +#ifndef CONFIGURE_MEMORY_OVERHEAD +#define CONFIGURE_MEMORY_OVERHEAD 0 +#endif + #define CONFIGURE_API_MUTEX_MEMORY \ ( (1) * \ ( sizeof(API_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) \ @@ -1067,9 +1082,10 @@ itron_initialization_tasks_table ITRON_Initialization_tasks[] = { CONFIGURE_MEMORY_FOR_DEVICES(CONFIGURE_MAXIMUM_DEVICES) + \ CONFIGURE_MEMORY_FOR_MP + \ CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \ - (((CONFIGURE_MEMORY_OVERHEAD)+1) * 1024) + \ + CONFIGURE_MESSAGE_BUFFER_MEMORY + \ + (CONFIGURE_MEMORY_OVERHEAD * 1024) + \ (CONFIGURE_EXTRA_TASK_STACKS) + (CONFIGURE_ADA_TASKS_STACK) \ -) & 0xfffffc00) +) & ~0x7) #endif #ifdef CONFIGURE_GNAT_RTEMS