From 6f1384cd4ff2518fbbde7fe99f4cbc7112ec14fc Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 21 May 2007 23:19:36 +0000 Subject: Split Classic API data instantiation into individual files. This reduces the size of the BSS section when an optional manageer stub is used. Some tests showed about a 600 byte reduction in BSS size. Also eliminated the variables _RTEMS_tasks_User_initialization_tasks and _RTEMS_tasks_Number_of_initialization_tasks because they were only used in one place after initialized. It was a waste of space. --- cpukit/rtems/Makefile.am | 22 ++++++++++++---------- cpukit/rtems/include/rtems/rtems/barrier.h | 9 +++++++-- cpukit/rtems/include/rtems/rtems/dpmem.h | 10 ++++++++-- cpukit/rtems/include/rtems/rtems/event.h | 9 +++++++-- cpukit/rtems/include/rtems/rtems/message.h | 10 +++++++--- cpukit/rtems/include/rtems/rtems/part.h | 10 ++++++++-- cpukit/rtems/include/rtems/rtems/ratemon.h | 7 ++++++- cpukit/rtems/include/rtems/rtems/region.h | 11 +++++++++-- cpukit/rtems/include/rtems/rtems/sem.h | 8 ++++++-- cpukit/rtems/include/rtems/rtems/tasks.h | 18 ++++++------------ cpukit/rtems/include/rtems/rtems/timer.h | 11 ++++++++--- cpukit/rtems/src/barrierdata.c | 23 +++++++++++++++++++++++ cpukit/rtems/src/dpmem.c | 1 - cpukit/rtems/src/dpmemdata.c | 22 ++++++++++++++++++++++ cpukit/rtems/src/eventdata.c | 22 ++++++++++++++++++++++ cpukit/rtems/src/msgdata.c | 23 +++++++++++++++++++++++ cpukit/rtems/src/partdata.c | 22 ++++++++++++++++++++++ cpukit/rtems/src/ratemondata.c | 22 ++++++++++++++++++++++ cpukit/rtems/src/regiondata.c | 22 ++++++++++++++++++++++ cpukit/rtems/src/rtemstimerdata.c | 22 ++++++++++++++++++++++ cpukit/rtems/src/semdata.c | 22 ++++++++++++++++++++++ cpukit/rtems/src/taskdata.c | 22 ++++++++++++++++++++++ cpukit/rtems/src/taskinitusers.c | 9 +++++++-- cpukit/rtems/src/tasks.c | 16 +++------------- cpukit/sapi/Makefile.am | 3 ++- cpukit/sapi/include/rtems/extension.h | 12 ++++++++---- cpukit/sapi/src/extensiondata.c | 23 +++++++++++++++++++++++ cpukit/sapi/src/rtemsapi.c | 6 +----- testsuites/sptests/spsize/size.c | 2 -- 29 files changed, 350 insertions(+), 69 deletions(-) create mode 100644 cpukit/rtems/src/barrierdata.c create mode 100644 cpukit/rtems/src/dpmemdata.c create mode 100644 cpukit/rtems/src/eventdata.c create mode 100644 cpukit/rtems/src/msgdata.c create mode 100644 cpukit/rtems/src/partdata.c create mode 100644 cpukit/rtems/src/ratemondata.c create mode 100644 cpukit/rtems/src/regiondata.c create mode 100644 cpukit/rtems/src/rtemstimerdata.c create mode 100644 cpukit/rtems/src/semdata.c create mode 100644 cpukit/rtems/src/taskdata.c create mode 100644 cpukit/sapi/src/extensiondata.c diff --git a/cpukit/rtems/Makefile.am b/cpukit/rtems/Makefile.am index 13405c03a4..1062221001 100644 --- a/cpukit/rtems/Makefile.am +++ b/cpukit/rtems/Makefile.am @@ -60,14 +60,15 @@ librtems_a_SOURCES += src/tasks.c src/taskcreate.c src/taskdelete.c \ src/taskissuspended.c src/taskmode.c src/taskrestart.c src/taskresume.c \ src/tasksetnote.c src/tasksetpriority.c src/taskstart.c \ src/tasksuspend.c src/taskwakeafter.c src/taskwakewhen.c \ - src/taskvariableadd.c src/taskvariabledelete.c src/taskvariableget.c + src/taskvariableadd.c src/taskvariabledelete.c src/taskvariableget.c \ + src/taskdata.c ## RATEMON_C_FILES librtems_a_SOURCES += src/ratemon.c src/ratemoncancel.c src/ratemoncreate.c \ src/ratemondelete.c src/ratemongetstatus.c src/ratemongetstatistics.c \ src/ratemonresetstatistics.c src/ratemonresetall.c \ src/ratemonreportstatistics.c src/ratemonident.c \ - src/ratemonperiod.c src/ratemontimeout.c + src/ratemonperiod.c src/ratemontimeout.c src/ratemondata.c ## INTR_C_FILES librtems_a_SOURCES += src/intr.c src/intrbody.c src/intrcatch.c @@ -75,7 +76,7 @@ librtems_a_SOURCES += src/intr.c src/intrbody.c src/intrcatch.c ## BARRIER_C_FILES librtems_a_SOURCES += src/barrier.c src/barriercreate.c src/barrierdelete.c \ src/barrierident.c src/barriertranslatereturncode.c src/barrierrelease.c \ - src/barrierwait.c + src/barrierwait.c src/barrierdata.c ## CLOCK_C_FILES librtems_a_SOURCES += src/rtclock.c src/clockget.c src/clockset.c \ @@ -86,22 +87,23 @@ librtems_a_SOURCES += src/rtclock.c src/clockget.c src/clockset.c \ librtems_a_SOURCES += src/rtemstimer.c src/timercancel.c src/timercreate.c \ src/timerdelete.c src/timerfireafter.c src/timerfirewhen.c \ src/timergetinfo.c src/timerident.c src/timerreset.c src/timerserver.c \ - src/timerserverfireafter.c src/timerserverfirewhen.c + src/timerserverfireafter.c src/timerserverfirewhen.c src/rtemstimerdata.c ## MESSAGE_QUEUE_C_FILES librtems_a_SOURCES += src/msg.c src/msgqallocate.c src/msgqbroadcast.c \ src/msgqcreate.c src/msgqdelete.c src/msgqflush.c \ src/msgqgetnumberpending.c src/msgqident.c src/msgqreceive.c \ - src/msgqsend.c c src/msgqtranslatereturncode.c src/msgqurgent.c + src/msgqsend.c c src/msgqtranslatereturncode.c src/msgqurgent.c \ + src/msgdata.c ## SEMAPHORE_C_FILES librtems_a_SOURCES += src/sem.c src/semcreate.c src/semdelete.c src/semident.c \ src/semobtain.c src/semrelease.c src/semflush.c \ - src/semtranslatereturncode.c + src/semtranslatereturncode.c src/semdata.c ## EVENT_C_FILES librtems_a_SOURCES += src/event.c src/eventreceive.c src/eventseize.c \ - src/eventsend.c src/eventsurrender.c src/eventtimeout.c + src/eventsend.c src/eventsurrender.c src/eventtimeout.c src/eventdata.c ## SIGNAL_C_FILES librtems_a_SOURCES += src/signal.c src/signalcatch.c src/signalsend.c @@ -111,16 +113,16 @@ librtems_a_SOURCES += src/region.c src/regioncreate.c src/regiondelete.c \ src/regionextend.c src/regiongetsegment.c src/regiongetsegmentsize.c \ src/regionident.c src/regionreturnsegment.c src/regiongetinfo.c \ src/regiongetfreeinfo.c src/regionresizesegment.c \ - src/regionprocessqueue.c + src/regionprocessqueue.c src/regiondata.c ## PARTITION_C_FILES librtems_a_SOURCES += src/part.c src/partcreate.c src/partdelete.c \ - src/partgetbuffer.c src/partident.c src/partreturnbuffer.c + src/partgetbuffer.c src/partident.c src/partreturnbuffer.c src/partdata.c ## DPMEM_C_FILES librtems_a_SOURCES += src/dpmem.c src/dpmemcreate.c src/dpmemdelete.c \ src/dpmemexternal2internal.c src/dpmemident.c \ - src/dpmeminternal2external.c + src/dpmeminternal2external.c src/dpmemdata.c librtems_a_SOURCES += src/attr.c src/rtemsidtoname.c diff --git a/cpukit/rtems/include/rtems/rtems/barrier.h b/cpukit/rtems/include/rtems/rtems/barrier.h index f9c8e909ee..a00d2d97aa 100644 --- a/cpukit/rtems/include/rtems/rtems/barrier.h +++ b/cpukit/rtems/include/rtems/rtems/barrier.h @@ -14,7 +14,7 @@ * + wait for a barrier * + signal a barrier * - * COPYRIGHT (c) 1989-2006. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -27,6 +27,10 @@ #ifndef _RTEMS_RTEMS_BARRIER_H #define _RTEMS_RTEMS_BARRIER_H +#ifndef RTEMS_BARRIER_EXTERN +#define RTEMS_BARRIER_EXTERN extern +#endif + #ifdef __cplusplus extern "C" { #endif @@ -34,6 +38,7 @@ extern "C" { #include #include #include +#include #include #include @@ -55,7 +60,7 @@ typedef struct { * this class of objects. */ -RTEMS_EXTERN Objects_Information _Barrier_Information; +RTEMS_BARRIER_EXTERN Objects_Information _Barrier_Information; /** * @brief _Barrier_Manager_initialization diff --git a/cpukit/rtems/include/rtems/rtems/dpmem.h b/cpukit/rtems/include/rtems/rtems/dpmem.h index dc48eec822..37fbc2f445 100644 --- a/cpukit/rtems/include/rtems/rtems/dpmem.h +++ b/cpukit/rtems/include/rtems/rtems/dpmem.h @@ -17,7 +17,7 @@ * + convert internal to external address * * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -30,11 +30,17 @@ #ifndef _RTEMS_RTEMS_DPMEM_H #define _RTEMS_RTEMS_DPMEM_H +#ifndef RTEMS_DPMEM_EXTERN +#define RTEMS_DPMEM_EXTERN extern +#endif + #ifdef __cplusplus extern "C" { #endif #include +#include +#include /* * The following structure defines the port control block. Each port @@ -53,7 +59,7 @@ typedef struct { * The following define the internal Dual Ported Memory information. */ -RTEMS_EXTERN Objects_Information _Dual_ported_memory_Information; +RTEMS_DPMEM_EXTERN Objects_Information _Dual_ported_memory_Information; /* * _Dual_ported_memory_Manager_initialization diff --git a/cpukit/rtems/include/rtems/rtems/event.h b/cpukit/rtems/include/rtems/rtems/event.h index 6de5e76516..4d2b4513fe 100644 --- a/cpukit/rtems/include/rtems/rtems/event.h +++ b/cpukit/rtems/include/rtems/rtems/event.h @@ -13,7 +13,7 @@ * + receive event condition * * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -26,11 +26,16 @@ #ifndef _RTEMS_RTEMS_EVENT_H #define _RTEMS_RTEMS_EVENT_H +#ifndef RTEMS_EVENT_EXTERN +#define RTEMS_EVENT_EXTERN extern +#endif + #ifdef __cplusplus extern "C" { #endif #include +#include #include #include #include @@ -161,7 +166,7 @@ void _Event_Timeout ( * executing thread are received properly. */ -RTEMS_EXTERN volatile Event_Sync_states _Event_Sync_state; +RTEMS_EVENT_EXTERN volatile Event_Sync_states _Event_Sync_state; #if defined(RTEMS_MULTIPROCESSING) #include diff --git a/cpukit/rtems/include/rtems/rtems/message.h b/cpukit/rtems/include/rtems/rtems/message.h index cef04eff8c..9425ddf3af 100644 --- a/cpukit/rtems/include/rtems/rtems/message.h +++ b/cpukit/rtems/include/rtems/rtems/message.h @@ -18,8 +18,7 @@ * + receive message from a queue * + flush all messages on a queue * - * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -32,11 +31,16 @@ #ifndef _RTEMS_RTEMS_MESSAGE_H #define _RTEMS_RTEMS_MESSAGE_H +#ifndef RTEMS_MESSAGE_EXTERN +#define RTEMS_MESSAGE_EXTERN extern +#endif + #ifdef __cplusplus extern "C" { #endif #include +#include #include #include #include @@ -69,7 +73,7 @@ typedef struct { * manage this class of objects. */ -RTEMS_EXTERN Objects_Information _Message_queue_Information; +RTEMS_MESSAGE_EXTERN Objects_Information _Message_queue_Information; /* * _Message_queue_Manager_initialization diff --git a/cpukit/rtems/include/rtems/rtems/part.h b/cpukit/rtems/include/rtems/rtems/part.h index 75a947d881..0e2eb496c4 100644 --- a/cpukit/rtems/include/rtems/rtems/part.h +++ b/cpukit/rtems/include/rtems/rtems/part.h @@ -16,7 +16,7 @@ * + get a buffer from a partition * + return a buffer to a partition * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -29,6 +29,10 @@ #ifndef _RTEMS_RTEMS_PART_H #define _RTEMS_RTEMS_PART_H +#ifndef RTEMS_PART_EXTERN +#define RTEMS_PART_EXTERN extern +#endif + #ifdef __cplusplus extern "C" { #endif @@ -36,6 +40,8 @@ extern "C" { #include #include #include +#include +#include #include /* @@ -57,7 +63,7 @@ typedef struct { * manage this class of objects. */ -RTEMS_EXTERN Objects_Information _Partition_Information; +RTEMS_PART_EXTERN Objects_Information _Partition_Information; /* * _Partition_Manager_initialization diff --git a/cpukit/rtems/include/rtems/rtems/ratemon.h b/cpukit/rtems/include/rtems/rtems/ratemon.h index 3492772e2c..66c2752bf3 100644 --- a/cpukit/rtems/include/rtems/rtems/ratemon.h +++ b/cpukit/rtems/include/rtems/rtems/ratemon.h @@ -28,6 +28,10 @@ #ifndef _RTEMS_RTEMS_RATEMON_H #define _RTEMS_RTEMS_RATEMON_H +#ifndef RTEMS_RATEMON_EXTERN +#define RTEMS_RATEMON_EXTERN extern +#endif + #ifdef __cplusplus extern "C" { #endif @@ -50,6 +54,7 @@ extern "C" { #include #include #include +#include #include @@ -145,7 +150,7 @@ typedef struct { rtems_rate_monotonic_period_statistics Statistics; } Rate_monotonic_Control; -RTEMS_EXTERN Objects_Information _Rate_monotonic_Information; +RTEMS_RATEMON_EXTERN Objects_Information _Rate_monotonic_Information; /* * _Rate_monotonic_Manager_initialization diff --git a/cpukit/rtems/include/rtems/rtems/region.h b/cpukit/rtems/include/rtems/rtems/region.h index 9c8a0cffa9..78cd7796a9 100644 --- a/cpukit/rtems/include/rtems/rtems/region.h +++ b/cpukit/rtems/include/rtems/rtems/region.h @@ -15,7 +15,7 @@ * + get a segment from a region * + return a segment to a region * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -28,6 +28,10 @@ #ifndef _RTEMS_RTEMS_REGION_H #define _RTEMS_RTEMS_REGION_H +#ifndef RTEMS_REGION_EXTERN +#define RTEMS_REGION_EXTERN extern +#endif + #ifdef __cplusplus extern "C" { #endif @@ -39,6 +43,9 @@ extern "C" { #include #include #include +#include +#include +#include #include /* @@ -63,7 +70,7 @@ typedef struct { * manage this class of objects. */ -RTEMS_EXTERN Objects_Information _Region_Information; +RTEMS_REGION_EXTERN Objects_Information _Region_Information; /* * _Region_Manager_initialization diff --git a/cpukit/rtems/include/rtems/rtems/sem.h b/cpukit/rtems/include/rtems/rtems/sem.h index 3c628717c4..a5cb09f3fd 100644 --- a/cpukit/rtems/include/rtems/rtems/sem.h +++ b/cpukit/rtems/include/rtems/rtems/sem.h @@ -16,7 +16,7 @@ * + acquire a semaphore * + release a semaphore * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -29,6 +29,10 @@ #ifndef _RTEMS_RTEMS_SEM_H #define _RTEMS_RTEMS_SEM_H +#ifndef RTEMS_SEM_EXTERN +#define RTEMS_SEM_EXTERN extern +#endif + #ifdef __cplusplus extern "C" { #endif @@ -59,7 +63,7 @@ typedef struct { * this class of objects. */ -RTEMS_EXTERN Objects_Information _Semaphore_Information; +RTEMS_SEM_EXTERN Objects_Information _Semaphore_Information; /* * _Semaphore_Manager_initialization diff --git a/cpukit/rtems/include/rtems/rtems/tasks.h b/cpukit/rtems/include/rtems/rtems/tasks.h index bc59c14921..a8efc5518e 100644 --- a/cpukit/rtems/include/rtems/rtems/tasks.h +++ b/cpukit/rtems/include/rtems/rtems/tasks.h @@ -36,6 +36,10 @@ #ifndef _RTEMS_RTEMS_TASKS_H #define _RTEMS_RTEMS_TASKS_H +#ifndef RTEMS_TASKS_EXTERN +#define RTEMS_TASKS_EXTERN extern +#endif + #ifdef __cplusplus extern "C" { #endif @@ -166,15 +170,7 @@ typedef struct { * manage this class of objects. */ -RTEMS_EXTERN Objects_Information _RTEMS_tasks_Information; - -/* - * These are used to manage the user initialization tasks. - */ - -RTEMS_EXTERN rtems_initialization_tasks_table - *_RTEMS_tasks_User_initialization_tasks; -RTEMS_EXTERN uint32_t _RTEMS_tasks_Number_of_initialization_tasks; +RTEMS_TASKS_EXTERN Objects_Information _RTEMS_tasks_Information; /* * _RTEMS_tasks_Manager_initialization @@ -185,9 +181,7 @@ RTEMS_EXTERN uint32_t _RTEMS_tasks_Number_of_initialization_tasks; */ void _RTEMS_tasks_Manager_initialization( - uint32_t maximum_tasks, - uint32_t number_of_initialization_tasks, - rtems_initialization_tasks_table *user_tasks + uint32_t maximum_tasks ); /* diff --git a/cpukit/rtems/include/rtems/rtems/timer.h b/cpukit/rtems/include/rtems/rtems/timer.h index a246678480..fdb9185d00 100644 --- a/cpukit/rtems/include/rtems/rtems/timer.h +++ b/cpukit/rtems/include/rtems/rtems/timer.h @@ -23,7 +23,7 @@ * + reset a timer * + cancel a time * - * COPYRIGHT (c) 1989-2002. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -36,12 +36,17 @@ #ifndef _RTEMS_RTEMS_TIMER_H #define _RTEMS_RTEMS_TIMER_H +#ifndef RTEMS_TIMER_EXTERN +#define RTEMS_TIMER_EXTERN extern +#endif + #ifdef __cplusplus extern "C" { #endif #include #include +#include #include #include @@ -74,7 +79,7 @@ typedef rtems_timer_service_routine ( *rtems_timer_service_routine_entry )( * this class of objects. */ -RTEMS_EXTERN Objects_Information _Timer_Information; +RTEMS_TIMER_EXTERN Objects_Information _Timer_Information; /* * Pointer to TCB of the Timer Server. This is NULL before the @@ -82,7 +87,7 @@ RTEMS_EXTERN Objects_Information _Timer_Information; * initiated until the server is started. */ -RTEMS_EXTERN Thread_Control *_Timer_Server; +RTEMS_TIMER_EXTERN Thread_Control *_Timer_Server; /* * The following chains contain the list of interval timers that are diff --git a/cpukit/rtems/src/barrierdata.c b/cpukit/rtems/src/barrierdata.c new file mode 100644 index 0000000000..6e4af5a4c8 --- /dev/null +++ b/cpukit/rtems/src/barrierdata.c @@ -0,0 +1,23 @@ +/* + * Barrier Manager -- Instantiate Data + * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +/* instantiate barrier data */ +#define RTEMS_BARRIER_EXTERN + +#include +#include + diff --git a/cpukit/rtems/src/dpmem.c b/cpukit/rtems/src/dpmem.c index 27ded43f5f..6e730e6f75 100644 --- a/cpukit/rtems/src/dpmem.c +++ b/cpukit/rtems/src/dpmem.c @@ -22,7 +22,6 @@ #include #include #include -#include /*PAGE * diff --git a/cpukit/rtems/src/dpmemdata.c b/cpukit/rtems/src/dpmemdata.c new file mode 100644 index 0000000000..cc2285c1f6 --- /dev/null +++ b/cpukit/rtems/src/dpmemdata.c @@ -0,0 +1,22 @@ +/* + * Dual Port Memory Manager -- Instantiate Data + * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +/* instantiate semaphore data */ +#define RTEMS_DPMEM_EXTERN + +#include +#include diff --git a/cpukit/rtems/src/eventdata.c b/cpukit/rtems/src/eventdata.c new file mode 100644 index 0000000000..bc7eb466c1 --- /dev/null +++ b/cpukit/rtems/src/eventdata.c @@ -0,0 +1,22 @@ +/* + * Event Manager -- Instantiate Data + * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +/* instantiate RTEMS event data */ +#define RTEMS_EVENT_EXTERN + +#include +#include diff --git a/cpukit/rtems/src/msgdata.c b/cpukit/rtems/src/msgdata.c new file mode 100644 index 0000000000..70baa35723 --- /dev/null +++ b/cpukit/rtems/src/msgdata.c @@ -0,0 +1,23 @@ +/* + * Barrier Manager -- Instantiate Data + * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +/* instantiate message queue data */ +#define RTEMS_MESSAGE_EXTERN + +#include +#include + diff --git a/cpukit/rtems/src/partdata.c b/cpukit/rtems/src/partdata.c new file mode 100644 index 0000000000..8f6c5b4531 --- /dev/null +++ b/cpukit/rtems/src/partdata.c @@ -0,0 +1,22 @@ +/* + * Partition Manager -- Instantiate Data + * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +/* instantiate RTEMS partition data */ +#define RTEMS_PART_EXTERN + +#include +#include diff --git a/cpukit/rtems/src/ratemondata.c b/cpukit/rtems/src/ratemondata.c new file mode 100644 index 0000000000..efd461fa02 --- /dev/null +++ b/cpukit/rtems/src/ratemondata.c @@ -0,0 +1,22 @@ +/* + * Rate Monotonic Manager -- Instantiate Data + * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +/* instantiate RTEMS period data */ +#define RTEMS_RATEMON_EXTERN + +#include +#include diff --git a/cpukit/rtems/src/regiondata.c b/cpukit/rtems/src/regiondata.c new file mode 100644 index 0000000000..9ecce9e7bb --- /dev/null +++ b/cpukit/rtems/src/regiondata.c @@ -0,0 +1,22 @@ +/* + * Region Manager -- Instantiate Data + * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +/* instantiate RTEMS Region data */ +#define RTEMS_REGION_EXTERN + +#include +#include diff --git a/cpukit/rtems/src/rtemstimerdata.c b/cpukit/rtems/src/rtemstimerdata.c new file mode 100644 index 0000000000..b817c2f788 --- /dev/null +++ b/cpukit/rtems/src/rtemstimerdata.c @@ -0,0 +1,22 @@ +/* + * Timer Manager -- Instantiate Data + * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +/* instantiate RTEMS timer data */ +#define RTEMS_TIMER_EXTERN + +#include +#include diff --git a/cpukit/rtems/src/semdata.c b/cpukit/rtems/src/semdata.c new file mode 100644 index 0000000000..cc4126db15 --- /dev/null +++ b/cpukit/rtems/src/semdata.c @@ -0,0 +1,22 @@ +/* + * Semaphore Manager -- Data Instantiation + * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +/* instantiate semaphore data */ +#define RTEMS_SEM_EXTERN + +#include +#include diff --git a/cpukit/rtems/src/taskdata.c b/cpukit/rtems/src/taskdata.c new file mode 100644 index 0000000000..13c0a1f6e1 --- /dev/null +++ b/cpukit/rtems/src/taskdata.c @@ -0,0 +1,22 @@ +/* + * RTEMS Task Manager -- Instantiate Data + * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +/* instantiate RTEMS Classic API tasks data */ +#define RTEMS_TASKS_EXTERN + +#include +#include diff --git a/cpukit/rtems/src/taskinitusers.c b/cpukit/rtems/src/taskinitusers.c index 3e0ae4b0f2..38e470f408 100644 --- a/cpukit/rtems/src/taskinitusers.c +++ b/cpukit/rtems/src/taskinitusers.c @@ -17,6 +17,7 @@ #endif #include +#include #include #include #include @@ -51,13 +52,17 @@ void _RTEMS_tasks_Initialize_user_tasks_body( void ) rtems_id id; rtems_status_code return_value; rtems_initialization_tasks_table *user_tasks; + rtems_api_configuration_table *api_configuration; + + + api_configuration = _Configuration_Table->RTEMS_api_configuration; /* * NOTE: This is slightly different from the Ada implementation. */ - user_tasks = _RTEMS_tasks_User_initialization_tasks; - maximum = _RTEMS_tasks_Number_of_initialization_tasks; + user_tasks = api_configuration->User_initialization_tasks_table; + maximum = api_configuration->number_of_initialization_tasks; if ( !user_tasks || maximum == 0 ) return; diff --git a/cpukit/rtems/src/tasks.c b/cpukit/rtems/src/tasks.c index 963ec10368..78d50db831 100644 --- a/cpukit/rtems/src/tasks.c +++ b/cpukit/rtems/src/tasks.c @@ -1,8 +1,7 @@ /* - * RTEMS Task Manager + * RTEMS Task Manager -- Initialize Manager * - * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -243,19 +242,10 @@ User_extensions_Control _RTEMS_tasks_User_extensions = { */ void _RTEMS_tasks_Manager_initialization( - uint32_t maximum_tasks, - uint32_t number_of_initialization_tasks, - rtems_initialization_tasks_table *user_tasks + uint32_t maximum_tasks ) { - _RTEMS_tasks_Number_of_initialization_tasks = number_of_initialization_tasks; - _RTEMS_tasks_User_initialization_tasks = user_tasks; - - /* - * There may not be any RTEMS initialization tasks configured. - */ - _Objects_Initialize_information( &_RTEMS_tasks_Information, /* object information table */ OBJECTS_CLASSIC_API, /* object API */ diff --git a/cpukit/sapi/Makefile.am b/cpukit/sapi/Makefile.am index edb845aca2..531d0e779a 100644 --- a/cpukit/sapi/Makefile.am +++ b/cpukit/sapi/Makefile.am @@ -22,7 +22,8 @@ AM_CPPFLAGS += -D__RTEMS_INSIDE__ noinst_LIBRARIES = libsapi.a libsapi_a_SOURCES = src/debug.c src/extension.c src/extensioncreate.c \ src/extensiondelete.c src/extensionident.c src/fatal.c src/exinit.c \ - src/exshutdown.c src/io.c src/itronapi.c src/posixapi.c src/rtemsapi.c + src/exshutdown.c src/io.c src/itronapi.c src/posixapi.c src/rtemsapi.c \ + src/extensiondata.c libsapi_a_CPPFLAGS = $(AM_CPPFLAGS) include $(srcdir)/preinstall.am diff --git a/cpukit/sapi/include/rtems/extension.h b/cpukit/sapi/include/rtems/extension.h index 65ac6ce280..a1f448c98e 100644 --- a/cpukit/sapi/include/rtems/extension.h +++ b/cpukit/sapi/include/rtems/extension.h @@ -13,7 +13,7 @@ * + get ID of user extension set * + delete user extension set * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -26,14 +26,18 @@ #ifndef _RTEMS_EXTENSION_H #define _RTEMS_EXTENSION_H +#ifndef SAPI_EXT_EXTERN +#define SAPI_EXT_EXTERN extern +#endif + #ifdef __cplusplus extern "C" { #endif #include #include -#include /* XXX */ -#include /* XXX */ +#include +#include /* * Extension related types @@ -58,7 +62,7 @@ typedef User_extensions_Table rtems_extensions_table; * this class of objects. */ -SAPI_EXTERN Objects_Information _Extension_Information; +SAPI_EXT_EXTERN Objects_Information _Extension_Information; /* * The following records define the control block used to manage diff --git a/cpukit/sapi/src/extensiondata.c b/cpukit/sapi/src/extensiondata.c new file mode 100644 index 0000000000..6057db5ee6 --- /dev/null +++ b/cpukit/sapi/src/extensiondata.c @@ -0,0 +1,23 @@ +/* + * Extension Manager -- Instantiate Data + * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +/* instantiate extension data */ +#define SAPI_EXT_EXTERN + +#include +#include + diff --git a/cpukit/sapi/src/rtemsapi.c b/cpukit/sapi/src/rtemsapi.c index 23daa0700f..89d7411b5f 100644 --- a/cpukit/sapi/src/rtemsapi.c +++ b/cpukit/sapi/src/rtemsapi.c @@ -72,11 +72,7 @@ void _RTEMS_API_Initialize( _Multiprocessing_Manager_initialization(); #endif - _RTEMS_tasks_Manager_initialization( - api_configuration->maximum_tasks, - api_configuration->number_of_initialization_tasks, - api_configuration->User_initialization_tasks_table - ); + _RTEMS_tasks_Manager_initialization( api_configuration->maximum_tasks ); _Timer_Manager_initialization( api_configuration->maximum_timers ); diff --git a/testsuites/sptests/spsize/size.c b/testsuites/sptests/spsize/size.c index 4540ba9ab5..908a991d58 100644 --- a/testsuites/sptests/spsize/size.c +++ b/testsuites/sptests/spsize/size.c @@ -344,8 +344,6 @@ uninitialized = #endif /*tasks.h*/ (sizeof _RTEMS_tasks_Information) + - (sizeof _RTEMS_tasks_User_initialization_tasks) + - (sizeof _RTEMS_tasks_Number_of_initialization_tasks) + /*thread.h*/ (sizeof _Thread_BSP_context) + (sizeof _Thread_Dispatch_disable_level) + -- cgit v1.2.3