summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/tasks.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-06-16 15:54:21 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-06-16 15:54:21 +0000
commit4cb19041d7d78d9ae29f878871e4d2b89b9abc22 (patch)
tree3efcf5818a29323bf55577ffbb324cd301249519 /cpukit/rtems/src/tasks.c
parent2008-06-13 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-4cb19041d7d78d9ae29f878871e4d2b89b9abc22.tar.bz2
2008-06-16 Joel Sherrill <joel.sherrill@oarcorp.com>
* 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.
Diffstat (limited to 'cpukit/rtems/src/tasks.c')
-rw-r--r--cpukit/rtems/src/tasks.c18
1 files changed, 15 insertions, 3 deletions
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 <rtems/system.h>
+#include <rtems/config.h>
#include <rtems/rtems/status.h>
#include <rtems/rtems/support.h>
#include <rtems/rtems/modes.h>
@@ -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;
}