From 4cb19041d7d78d9ae29f878871e4d2b89b9abc22 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 16 Jun 2008 15:54:21 +0000 Subject: 2008-06-16 Joel Sherrill * rtems/include/rtems/rtems/config.h, rtems/include/rtems/rtems/tasks.h, rtems/src/taskgetnote.c, rtems/src/tasks.c, rtems/src/tasksetnote.c, sapi/include/confdefs.h: Add CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS. --- cpukit/rtems/src/tasks.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'cpukit/rtems/src/tasks.c') diff --git a/cpukit/rtems/src/tasks.c b/cpukit/rtems/src/tasks.c index afde09a704..442f5e6954 100644 --- a/cpukit/rtems/src/tasks.c +++ b/cpukit/rtems/src/tasks.c @@ -16,6 +16,7 @@ #endif #include +#include #include #include #include @@ -49,8 +50,17 @@ boolean _RTEMS_tasks_Create_extension( { RTEMS_API_Control *api; int i; + size_t to_allocate; - api = _Workspace_Allocate( sizeof( RTEMS_API_Control ) ); + /* + * Notepads must be the last entry in the structure and they + * can be left off if disabled in the configuration. + */ + to_allocate = sizeof( RTEMS_API_Control ); + if ( !rtems_configuration_get_notepads_enabled() ) + to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); + + api = _Workspace_Allocate( to_allocate ); if ( !api ) return FALSE; @@ -61,8 +71,10 @@ boolean _RTEMS_tasks_Create_extension( _ASR_Initialize( &api->Signal ); created->task_variables = NULL; - for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) - api->Notepads[i] = 0; + if ( rtems_configuration_get_notepads_enabled() ) { + for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) + api->Notepads[i] = 0; + } return TRUE; } -- cgit v1.2.3