2008-12-15 Joel Sherrill <joel.sherrill@oarcorp.com>

* itron/include/rtems/itron/itronapi.h, libmisc/capture/capture.c,
	libmisc/monitor/mon-config.c, libmisc/monitor/mon-driver.c,
	libmisc/monitor/mon-itask.c, libmisc/monitor/mon-mpci.c,
	posix/include/rtems/posix/config.h,
	posix/include/rtems/posix/posixapi.h,
	rtems/include/rtems/rtems/config.h,
	rtems/include/rtems/rtems/rtemsapi.h, rtems/src/taskinitusers.c,
	sapi/include/confdefs.h, sapi/include/rtems/config.h,
	sapi/include/rtems/init.h, sapi/src/exinit.c, sapi/src/itronapi.c,
	sapi/src/posixapi.c, sapi/src/rtemsapi.c, score/src/isr.c,
	score/src/thread.c, score/src/threadcreateidle.c,
	score/src/threadstackallocate.c, score/src/threadstackfree.c,
	score/src/wkspace.c: Eliminate pointers to API configuration tables
	in the main configuration table. Reference the main configuration
	table and the API configuration tables directly using the confdefs.h
	version rather than obtaining a pointer to it. This eliminated some
	variables, a potential fatal error, some unnecessary default
	configuration structures. Overall, about a 4.5% reduction in the code
	size for minimum and hello on the SPARC.
This commit is contained in:
Joel Sherrill
2008-12-15 19:21:01 +00:00
parent 197170b01c
commit aac75d3b9b
25 changed files with 245 additions and 299 deletions

View File

@@ -1,3 +1,25 @@
2008-12-15 Joel Sherrill <joel.sherrill@oarcorp.com>
* itron/include/rtems/itron/itronapi.h, libmisc/capture/capture.c,
libmisc/monitor/mon-config.c, libmisc/monitor/mon-driver.c,
libmisc/monitor/mon-itask.c, libmisc/monitor/mon-mpci.c,
posix/include/rtems/posix/config.h,
posix/include/rtems/posix/posixapi.h,
rtems/include/rtems/rtems/config.h,
rtems/include/rtems/rtems/rtemsapi.h, rtems/src/taskinitusers.c,
sapi/include/confdefs.h, sapi/include/rtems/config.h,
sapi/include/rtems/init.h, sapi/src/exinit.c, sapi/src/itronapi.c,
sapi/src/posixapi.c, sapi/src/rtemsapi.c, score/src/isr.c,
score/src/thread.c, score/src/threadcreateidle.c,
score/src/threadstackallocate.c, score/src/threadstackfree.c,
score/src/wkspace.c: Eliminate pointers to API configuration tables
in the main configuration table. Reference the main configuration
table and the API configuration tables directly using the confdefs.h
version rather than obtaining a pointer to it. This eliminated some
variables, a potential fatal error, some unnecessary default
configuration structures. Overall, about a 4.5% reduction in the code
size for minimum and hello on the SPARC.
2008-12-15 Joel Sherrill <joel.sherrill@oarcorp.com> 2008-12-15 Joel Sherrill <joel.sherrill@oarcorp.com>
* rtems/include/rtems/rtems/types.h: Fix incorrect type name. * rtems/include/rtems/rtems/types.h: Fix incorrect type name.

View File

@@ -3,9 +3,7 @@
*/ */
/* /*
* ITRON API Support * COPYRIGHT (c) 1989-2008.
*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -20,15 +18,20 @@
#include <rtems/config.h> #include <rtems/config.h>
/* /**
* _ITRON_API_Initialize * @brief Initialize ITRON API
* *
* Initialize the ITRON API. * This method is used to initialize the ITRON API.
*/ */
void _ITRON_API_Initialize(void);
void _ITRON_API_Initialize( /**
rtems_configuration_table *configuration_table * @brief ITRON API Cofniguration Table
); *
* This is the ITRON API Configuration Table expected to be generated
* by confdefs.h.
*/
extern itron_api_configuration_table Configuration_ITRON_API;
#endif #endif
/* end of include file */ /* end of include file */

View File

@@ -1039,7 +1039,7 @@ rtems_capture_open (uint32_t size, rtems_capture_timestamp timestamp)
/* /*
* Get the tick period from the BSP Configuration Table. * Get the tick period from the BSP Configuration Table.
*/ */
capture_tick_period = _Configuration_Table->microseconds_per_tick; capture_tick_period = Configuration.microseconds_per_tick;
/* /*
* Register the user extension handlers for the CAPture Engine. * Register the user extension handlers for the CAPture Engine.

View File

@@ -33,9 +33,9 @@ rtems_monitor_config_canonical(
) )
{ {
rtems_configuration_table *c = (rtems_configuration_table *) config_void; rtems_configuration_table *c = (rtems_configuration_table *) config_void;
rtems_api_configuration_table *r = c->RTEMS_api_configuration; rtems_api_configuration_table *r = &Configuration_RTEMS_API;
canonical_config->work_space_start = c->work_space_start; canonical_config->work_space_start = NULL; /* no longer in structure */
canonical_config->work_space_size = c->work_space_size; canonical_config->work_space_size = c->work_space_size;
canonical_config->maximum_tasks = r->maximum_tasks; canonical_config->maximum_tasks = r->maximum_tasks;
canonical_config->maximum_timers = r->maximum_timers; canonical_config->maximum_timers = r->maximum_timers;
@@ -63,7 +63,7 @@ rtems_monitor_config_next(
rtems_id *next_id rtems_id *next_id
) )
{ {
rtems_configuration_table *c = _Configuration_Table; rtems_configuration_table *c = &Configuration;
int n = rtems_object_id_get_index(*next_id); int n = rtems_object_id_get_index(*next_id);
if (n >= 1) if (n >= 1)

View File

@@ -67,7 +67,7 @@ rtems_monitor_driver_next(
rtems_id *next_id rtems_id *next_id
) )
{ {
rtems_configuration_table *c = _Configuration_Table; rtems_configuration_table *c = &Configuration;
uint32_t n = rtems_object_id_get_index(*next_id); uint32_t n = rtems_object_id_get_index(*next_id);
if (n >= c->number_of_device_drivers) if (n >= c->number_of_device_drivers)

View File

@@ -43,16 +43,15 @@ rtems_monitor_init_task_next(
rtems_id *next_id rtems_id *next_id
) )
{ {
rtems_configuration_table *c = _Configuration_Table;
rtems_initialization_tasks_table *itask; rtems_initialization_tasks_table *itask;
uint32_t n = rtems_object_id_get_index(*next_id); uint32_t n = rtems_object_id_get_index(*next_id);
if (n >= c->RTEMS_api_configuration->number_of_initialization_tasks) if (n >= Configuration_RTEMS_API.number_of_initialization_tasks)
goto failed; goto failed;
_Thread_Disable_dispatch(); _Thread_Disable_dispatch();
itask = c->RTEMS_api_configuration->User_initialization_tasks_table + n; itask = Configuration_RTEMS_API.User_initialization_tasks_table + n;
/* /*
* dummy up a fake id and name for this item * dummy up a fake id and name for this item

View File

@@ -31,7 +31,7 @@ rtems_monitor_mpci_canonical(
void *config_void void *config_void
) )
{ {
rtems_configuration_table *c = _Configuration_Table; rtems_configuration_table *c = &Configuration;
rtems_multiprocessing_table *m; rtems_multiprocessing_table *m;
rtems_mpci_table *mt; rtems_mpci_table *mt;
@@ -73,7 +73,7 @@ rtems_monitor_mpci_next(
rtems_id *next_id rtems_id *next_id
) )
{ {
rtems_configuration_table *c = _Configuration_Table; rtems_configuration_table *c = &Configuration;
int n = rtems_object_id_get_index(*next_id); int n = rtems_object_id_get_index(*next_id);
if (n >= 1) if (n >= 1)

View File

@@ -1,13 +1,12 @@
/** /**
* @file rtems/posix/config.h * @file rtems/posix/config.h
*/
/* config.h
* *
* This include file contains the table of user defined configuration * This include file contains the table of user defined configuration
* parameters specific for the POSIX API. * parameters specific for the POSIX API.
* */
* COPYRIGHT (c) 1989-1999.
/*
* COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -61,6 +60,14 @@ typedef struct {
posix_initialization_threads_table *User_initialization_threads_table; posix_initialization_threads_table *User_initialization_threads_table;
} posix_api_configuration_table; } posix_api_configuration_table;
/**
* @brief POSIX API Cofniguration Table
*
* This is the POSIX API Configuration Table expected to be generated
* by confdefs.h.
*/
extern posix_api_configuration_table Configuration_POSIX_API;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@@ -3,11 +3,7 @@
*/ */
/* /*
* POSIX API Support * COPYRIGHT (c) 1989-2008.
*
* NOTE:
*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -22,16 +18,13 @@
#include <rtems/config.h> #include <rtems/config.h>
/*PAGE /**
* @brief Initialize POSIX API
* *
* _POSIX_API_Initialize * This method is responsible for initializing each of the POSIX
* * API managers.
* XXX
*/ */
void _POSIX_API_Initialize(void);
void _POSIX_API_Initialize(
rtems_configuration_table *configuration_table
);
#endif #endif
/* end of include file */ /* end of include file */

View File

@@ -116,6 +116,16 @@ typedef struct {
rtems_initialization_tasks_table *User_initialization_tasks_table; rtems_initialization_tasks_table *User_initialization_tasks_table;
} rtems_api_configuration_table; } rtems_api_configuration_table;
/**
* @brief RTEMS API Configuration Table
*
* This is the RTEMS API Configuration Table expected to be generated
* by confdefs.h.
*/
extern rtems_api_configuration_table Configuration_RTEMS_API;
/**@}*/
/** /**
* This macro returns the value of the notepads enabled field * This macro returns the value of the notepads enabled field
* in the Classic API configuration table. * in the Classic API configuration table.

View File

@@ -31,11 +31,7 @@
* routine for each RTEMS manager with the appropriate parameters * routine for each RTEMS manager with the appropriate parameters
* from the configuration_table. * from the configuration_table.
*/ */
void _RTEMS_API_Initialize( void _RTEMS_API_Initialize(void);
rtems_configuration_table *configuration_table
);
/**@}*/
#endif #endif
/* end of include file */ /* end of include file */

View File

@@ -2,7 +2,7 @@
* RTEMS Task Manager * RTEMS Task Manager
* *
* *
* COPYRIGHT (c) 1989-2007. * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -22,6 +22,7 @@
#include <rtems/rtems/support.h> #include <rtems/rtems/support.h>
#include <rtems/rtems/modes.h> #include <rtems/rtems/modes.h>
#include <rtems/score/object.h> #include <rtems/score/object.h>
#include <rtems/rtems/rtemsapi.h>
#include <rtems/score/stack.h> #include <rtems/score/stack.h>
#include <rtems/score/states.h> #include <rtems/score/states.h>
#include <rtems/rtems/tasks.h> #include <rtems/rtems/tasks.h>
@@ -55,7 +56,7 @@ void _RTEMS_tasks_Initialize_user_tasks_body( void )
rtems_api_configuration_table *api_configuration; rtems_api_configuration_table *api_configuration;
api_configuration = _Configuration_Table->RTEMS_api_configuration; api_configuration = &Configuration_RTEMS_API;
/* /*
* NOTE: This is slightly different from the Ada implementation. * NOTE: This is slightly different from the Ada implementation.

View File

@@ -805,10 +805,6 @@ rtems_fs_init_functions_t rtems_fs_init_helper =
#ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE #ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE
#ifndef CONFIGURE_EXECUTIVE_RAM_WORK_AREA
#define CONFIGURE_EXECUTIVE_RAM_WORK_AREA NULL
#endif
#ifndef CONFIGURE_MAXIMUM_TASKS #ifndef CONFIGURE_MAXIMUM_TASKS
#define CONFIGURE_MAXIMUM_TASKS 0 #define CONFIGURE_MAXIMUM_TASKS 0
#endif #endif
@@ -1856,7 +1852,7 @@ rtems_fs_init_functions_t rtems_fs_init_helper =
* This is the primary Configuration Table for this application. * This is the primary Configuration Table for this application.
*/ */
rtems_configuration_table Configuration = { rtems_configuration_table Configuration = {
CONFIGURE_EXECUTIVE_RAM_WORK_AREA, NULL, /* filled in by BSP */
CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */ CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */
CONFIGURE_MAXIMUM_USER_EXTENSIONS, /* maximum dynamic extensions */ CONFIGURE_MAXIMUM_USER_EXTENSIONS, /* maximum dynamic extensions */
CONFIGURE_MICROSECONDS_PER_TICK, /* microseconds per clock tick */ CONFIGURE_MICROSECONDS_PER_TICK, /* microseconds per clock tick */
@@ -1875,17 +1871,6 @@ rtems_fs_init_functions_t rtems_fs_init_helper =
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */ CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */
#endif #endif
&Configuration_RTEMS_API, /* pointer to RTEMS API config */
#ifdef RTEMS_POSIX_API
&Configuration_POSIX_API, /* pointer to POSIX API config */
#else
NULL, /* pointer to POSIX API config */
#endif
#ifdef RTEMS_ITRON_API
&Configuration_ITRON_API /* pointer to ITRON API config */
#else
NULL /* pointer to ITRON API config */
#endif
}; };
#endif #endif

View File

@@ -170,21 +170,20 @@ typedef struct {
rtems_driver_address_table *Device_driver_table; rtems_driver_address_table *Device_driver_table;
uint32_t number_of_initial_extensions; uint32_t number_of_initial_extensions;
rtems_extensions_table *User_extension_table; rtems_extensions_table *User_extension_table;
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
rtems_multiprocessing_table *User_multiprocessing_table; rtems_multiprocessing_table *User_multiprocessing_table;
#endif #endif
rtems_api_configuration_table *RTEMS_api_configuration;
posix_api_configuration_table *POSIX_api_configuration;
itron_api_configuration_table *ITRON_api_configuration;
} rtems_configuration_table; } rtems_configuration_table;
/* /**
* The following are provided strictly for the convenience of * This is the configuration table generated by confdefs.h.
* the user. They are not used in RTEMS itself.
*/ */
extern rtems_configuration_table Configuration;
SAPI_EXTERN rtems_configuration_table *_Configuration_Table;
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
/**
* This points to the multiprocessing configuration table.
*/
SAPI_EXTERN rtems_multiprocessing_table *_Configuration_MP_table; SAPI_EXTERN rtems_multiprocessing_table *_Configuration_MP_table;
#endif #endif
@@ -194,7 +193,7 @@ SAPI_EXTERN rtems_configuration_table *_Configuration_Table;
*/ */
#define rtems_configuration_get_table() \ #define rtems_configuration_get_table() \
(&_Configuration_Table) (&Configuration)
#define rtems_configuration_get_work_space_start() \ #define rtems_configuration_get_work_space_start() \
(Configuration.work_space_start) (Configuration.work_space_start)
@@ -203,21 +202,21 @@ SAPI_EXTERN rtems_configuration_table *_Configuration_Table;
(Configuration.work_space_size) (Configuration.work_space_size)
#define rtems_configuration_get_maximum_extensions() \ #define rtems_configuration_get_maximum_extensions() \
(_Configuration_Table->maximum_extensions) (Configuration.maximum_extensions)
#define rtems_configuration_get_microseconds_per_tick() \ #define rtems_configuration_get_microseconds_per_tick() \
(_Configuration_Table->microseconds_per_tick) (Configuration.microseconds_per_tick)
#define rtems_configuration_get_milliseconds_per_tick() \ #define rtems_configuration_get_milliseconds_per_tick() \
(_Configuration_Table->microseconds_per_tick / 1000) (Configuration.microseconds_per_tick / 1000)
#define rtems_configuration_get_ticks_per_timeslice() \ #define rtems_configuration_get_ticks_per_timeslice() \
(_Configuration_Table->ticks_per_timeslice) (Configuration.ticks_per_timeslice)
#define rtems_configuration_get_idle_task() \ #define rtems_configuration_get_idle_task() \
(_Configuration_Table->idle_task) (Configuration.idle_task)
#define rtems_configuration_get_idle_task_stack_size() \ #define rtems_configuration_get_idle_task_stack_size() \
(_Configuration_Table->idle_task_stack_size) (Configuration.idle_task_stack_size)
/* XXX We need to get this from the generated table /* XXX We need to get this from the generated table
* since BSPs need it before the pointer is set. * since BSPs need it before the pointer is set.
@@ -229,45 +228,45 @@ extern rtems_configuration_table Configuration;
(Configuration.interrupt_stack_size) (Configuration.interrupt_stack_size)
#define rtems_configuration_get_stack_allocate_hook() \ #define rtems_configuration_get_stack_allocate_hook() \
(_Configuration_Table->stack_allocate_hook) (Configuration.stack_allocate_hook)
#define rtems_configuration_get_stack_free_hook() \ #define rtems_configuration_get_stack_free_hook() \
(_Configuration_Table->stack_free_hook) (Configuration.stack_free_hook)
/** /**
* This macro assists in accessing the field which indicates whether * This macro assists in accessing the field which indicates whether
* RTEMS is responsible for zeroing the Executive Workspace. * RTEMS is responsible for zeroing the Executive Workspace.
*/ */
#define rtems_configuration_get_do_zero_of_workspace() \ #define rtems_configuration_get_do_zero_of_workspace() \
(_Configuration_Table->do_zero_of_workspace) (Configuration.do_zero_of_workspace)
#define rtems_configuration_get_number_of_device_drivers() \ #define rtems_configuration_get_number_of_device_drivers() \
(_Configuration_Table->number_of_device_drivers) (Configuration.number_of_device_drivers)
#define rtems_configuration_get_device_driver_table() \ #define rtems_configuration_get_device_driver_table() \
(_Configuration_Table->device_driver_table) (Configuration.device_driver_table)
#define rtems_configuration_get_number_of_initial_extensions() \ #define rtems_configuration_get_number_of_initial_extensions() \
(_Configuration_Table->number_of_initial_extensions) (Configuration.number_of_initial_extensions)
#define rtems_configuration_get_user_extension_table() \ #define rtems_configuration_get_user_extension_table() \
(_Configuration_Table->user_extension_table) (Configuration.user_extension_table)
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
#define rtems_configuration_get_user_multiprocessing_table() \ #define rtems_configuration_get_user_multiprocessing_table() \
(_Configuration_Table->User_multiprocessing_table) (Configuration.User_multiprocessing_table)
#else #else
#define rtems_configuration_get_user_multiprocessing_table() NULL #define rtems_configuration_get_user_multiprocessing_table() NULL
#endif #endif
#define rtems_configuration_get_rtems_api_configuration() \ #define rtems_configuration_get_rtems_api_configuration() \
(_Configuration_Table->RTEMS_api_configuration) (&Configuration_RTEMS_API)
#define rtems_configuration_get_posix_api_configuration() \ #define rtems_configuration_get_posix_api_configuration() \
(_Configuration_Table->POSIX_api_configuration) (&Configuration_POSIX_API)
#define rtems_configuration_get_itron_api_configuration() \ #define rtems_configuration_get_itron_api_configuration() \
(_Configuration_Table->ITRON_api_configuration) (&Configuration_ITRON_API)
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -15,7 +15,7 @@
*/ */
/* /*
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -52,9 +52,7 @@ extern const rtems_multiprocessing_table
* that involves initializing data structures to a state that scheduling * that involves initializing data structures to a state that scheduling
* can occur in a consistent manner. * can occur in a consistent manner.
*/ */
void rtems_initialize_data_structures( void rtems_initialize_data_structures(void);
rtems_configuration_table *configuration_table
);
/** /**
* @brief rtems_initialize_before_drivers * @brief rtems_initialize_before_drivers

View File

@@ -53,17 +53,15 @@
#include <rtems/rtems/rtemsapi.h> #include <rtems/rtems/rtemsapi.h>
#ifdef RTEMS_POSIX_API #ifdef RTEMS_POSIX_API
#include <rtems/posix/posixapi.h> #include <rtems/posix/posixapi.h>
#endif #endif
#ifdef RTEMS_ITRON_API #ifdef RTEMS_ITRON_API
#include <rtems/itron/itronapi.h> #include <rtems/itron/itronapi.h>
#endif #endif
Objects_Information *_Internal_Objects[ OBJECTS_INTERNAL_CLASSES_LAST + 1 ]; Objects_Information *_Internal_Objects[ OBJECTS_INTERNAL_CLASSES_LAST + 1 ];
void rtems_initialize_data_structures( void rtems_initialize_data_structures(void)
rtems_configuration_table *configuration_table
)
{ {
rtems_interrupt_level bsp_level; rtems_interrupt_level bsp_level;
@@ -74,33 +72,18 @@ void rtems_initialize_data_structures(
*/ */
_ISR_Disable( bsp_level ); _ISR_Disable( bsp_level );
/*
* Make sure the parameters were not NULL.
*/
if ( configuration_table == NULL )
_Internal_error_Occurred(
INTERNAL_ERROR_CORE,
TRUE,
INTERNAL_ERROR_NO_CONFIGURATION_TABLE
);
/*
* Provide pointers just for later convenience.
*/
_Configuration_Table = configuration_table;
/* /*
* Initialize any target architecture specific support as early as possible * Initialize any target architecture specific support as early as possible
*/ */
_CPU_Initialize( _Thread_Dispatch ); _CPU_Initialize( _Thread_Dispatch );
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
/* /*
* Initialize the system state based on whether this is an MP system. * Initialize the system state based on whether this is an MP system.
* In an MP configuration, internally we view single processor * In an MP configuration, internally we view single processor
* systems as a very restricted multiprocessor system. * systems as a very restricted multiprocessor system.
*/ */
_Configuration_MP_table = configuration_table->User_multiprocessing_table; _Configuration_MP_table = Configuration.User_multiprocessing_table;
if ( _Configuration_MP_table == NULL ) { if ( _Configuration_MP_table == NULL ) {
_Configuration_MP_table = _Configuration_MP_table =
@@ -109,12 +92,12 @@ void rtems_initialize_data_structures(
} else { } else {
_System_state_Handler_initialization( TRUE ); _System_state_Handler_initialization( TRUE );
} }
#else #else
_System_state_Handler_initialization( FALSE ); _System_state_Handler_initialization( FALSE );
#endif #endif
/* /*
* Do this as early as possible to insure no debugging output * Do this as early as possible to ensure no debugging output
* is even attempted to be printed. * is even attempted to be printed.
*/ */
@@ -129,23 +112,23 @@ void rtems_initialize_data_structures(
* from the Workspace because it is not initialized. * from the Workspace because it is not initialized.
*/ */
_Workspace_Handler_initialization( _Workspace_Handler_initialization(
(void *)configuration_table->work_space_start, Configuration.work_space_start,
configuration_table->work_space_size Configuration.work_space_size
); );
_User_extensions_Handler_initialization( _User_extensions_Handler_initialization(
configuration_table->number_of_initial_extensions, Configuration.number_of_initial_extensions,
configuration_table->User_extension_table Configuration.User_extension_table
); );
_ISR_Handler_initialization(); _ISR_Handler_initialization();
_Objects_Handler_initialization( _Objects_Handler_initialization(
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
_Configuration_MP_table->node, _Configuration_MP_table->node,
_Configuration_MP_table->maximum_nodes, _Configuration_MP_table->maximum_nodes,
_Configuration_MP_table->maximum_global_objects _Configuration_MP_table->maximum_global_objects
#endif #endif
); );
_Objects_Information_table[OBJECTS_INTERNAL_API] = _Internal_Objects; _Objects_Information_table[OBJECTS_INTERNAL_API] = _Internal_Objects;
@@ -160,43 +143,43 @@ void rtems_initialize_data_structures(
_Watchdog_Handler_initialization(); _Watchdog_Handler_initialization();
_TOD_Handler_initialization( configuration_table->microseconds_per_tick ); _TOD_Handler_initialization( Configuration.microseconds_per_tick );
_Thread_Handler_initialization( _Thread_Handler_initialization(
configuration_table->ticks_per_timeslice, Configuration.ticks_per_timeslice,
configuration_table->maximum_extensions Configuration.maximum_extensions
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
, ,
_Configuration_MP_table->maximum_proxies _Configuration_MP_table->maximum_proxies
#endif #endif
); );
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
_MPCI_Handler_initialization( _MPCI_Handler_initialization(
_Configuration_MP_table->User_mpci_table, _Configuration_MP_table->User_mpci_table,
RTEMS_TIMEOUT RTEMS_TIMEOUT
); );
#endif #endif
/* MANAGERS */ /* MANAGERS */
_RTEMS_API_Initialize( configuration_table ); _RTEMS_API_Initialize();
_Extension_Manager_initialization( configuration_table->maximum_extensions ); _Extension_Manager_initialization( Configuration.maximum_extensions );
_IO_Manager_initialization( _IO_Manager_initialization(
configuration_table->Device_driver_table, Configuration.Device_driver_table,
configuration_table->number_of_device_drivers, Configuration.number_of_device_drivers,
configuration_table->maximum_drivers Configuration.maximum_drivers
); );
#ifdef RTEMS_POSIX_API #ifdef RTEMS_POSIX_API
_POSIX_API_Initialize( configuration_table ); _POSIX_API_Initialize();
#endif #endif
#ifdef RTEMS_ITRON_API #ifdef RTEMS_ITRON_API
_ITRON_API_Initialize( configuration_table ); _ITRON_API_Initialize();
#endif #endif
_System_state_Set( SYSTEM_STATE_BEFORE_MULTITASKING ); _System_state_Set( SYSTEM_STATE_BEFORE_MULTITASKING );
@@ -218,9 +201,9 @@ void rtems_initialize_data_structures(
void rtems_initialize_before_drivers(void) void rtems_initialize_before_drivers(void)
{ {
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
_MPCI_Create_server(); _MPCI_Create_server();
#endif #endif
/* /*
* Run the API and BSPs predriver hook. * Run the API and BSPs predriver hook.
@@ -240,14 +223,14 @@ void rtems_initialize_device_drivers(void)
_IO_Initialize_all_drivers(); _IO_Initialize_all_drivers();
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
if ( _System_state_Is_multiprocessing ) { if ( _System_state_Is_multiprocessing ) {
_MPCI_Initialization(); _MPCI_Initialization();
_MPCI_Internal_packets_Send_process_packet( _MPCI_Internal_packets_Send_process_packet(
MPCI_PACKETS_SYSTEM_VERIFY MPCI_PACKETS_SYSTEM_VERIFY
); );
} }
#endif #endif
/* /*
* Run the APIs and BSPs postdriver hooks. * Run the APIs and BSPs postdriver hooks.

View File

@@ -3,7 +3,7 @@
* *
* NOTE: * NOTE:
* *
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -37,6 +37,7 @@
#include <rtems/itron/eventflags.h> #include <rtems/itron/eventflags.h>
#include <rtems/itron/fmempool.h> #include <rtems/itron/fmempool.h>
#include <rtems/itron/itronapi.h>
#include <rtems/itron/mbox.h> #include <rtems/itron/mbox.h>
#include <rtems/itron/msgbuffer.h> #include <rtems/itron/msgbuffer.h>
#include <rtems/itron/port.h> #include <rtems/itron/port.h>
@@ -51,72 +52,45 @@
* XXX * XXX
*/ */
const itron_api_configuration_table _ITRON_Default_configuration = {
0, /* maximum_tasks */
0, /* maximum_semaphores */
0, /* maximum_eventflags */
0, /* maximum_mailboxes */
0, /* maximum_message_buffers */
0, /* maximum_ports */
0, /* maximum_memory_pools */
0, /* maximum_fixed_memory_pools */
0, /* number_of_initialization_tasks */
NULL /* User_initialization_tasks_table */
};
Objects_Information *_ITRON_Objects[ OBJECTS_ITRON_CLASSES_LAST + 1 ]; Objects_Information *_ITRON_Objects[ OBJECTS_ITRON_CLASSES_LAST + 1 ];
void _ITRON_API_Initialize( void _ITRON_API_Initialize(void)
rtems_configuration_table *configuration_table
)
{ {
const itron_api_configuration_table *api_configuration; const itron_api_configuration_table *api;
/* XXX need to assert here based on size assumptions */ /* XXX need to assert here based on size assumptions */
assert( sizeof(ID) == sizeof(Objects_Id) ); assert( sizeof(ID) == sizeof(Objects_Id) );
api_configuration = configuration_table->ITRON_api_configuration; /*
if ( !api_configuration ) * Install our API Object Management Table and initialize the
api_configuration = &_ITRON_Default_configuration; * various managers.
*/
api = &Configuration_ITRON_API;
_Objects_Information_table[OBJECTS_ITRON_API] = _ITRON_Objects; _Objects_Information_table[OBJECTS_ITRON_API] = _ITRON_Objects;
_ITRON_Task_Manager_initialization( _ITRON_Task_Manager_initialization(
api_configuration->maximum_tasks, api->maximum_tasks,
api_configuration->number_of_initialization_tasks, api->number_of_initialization_tasks,
api_configuration->User_initialization_tasks_table api->User_initialization_tasks_table
); );
_ITRON_Semaphore_Manager_initialization( _ITRON_Semaphore_Manager_initialization( api->maximum_semaphores );
api_configuration->maximum_semaphores
);
_ITRON_Eventflags_Manager_initialization( _ITRON_Eventflags_Manager_initialization( api->maximum_eventflags );
api_configuration->maximum_eventflags
);
_ITRON_Fixed_memory_pool_Manager_initialization( _ITRON_Fixed_memory_pool_Manager_initialization(
api_configuration->maximum_fixed_memory_pools api->maximum_fixed_memory_pools
); );
_ITRON_Mailbox_Manager_initialization( _ITRON_Mailbox_Manager_initialization( api->maximum_mailboxes );
api_configuration->maximum_mailboxes
);
_ITRON_Message_buffer_Manager_initialization( _ITRON_Message_buffer_Manager_initialization( api->maximum_message_buffers );
api_configuration->maximum_message_buffers
);
_ITRON_Port_Manager_initialization(
api_configuration->maximum_ports
);
_ITRON_Variable_memory_pool_Manager_initialization(
api_configuration->maximum_memory_pools
);
_ITRON_Port_Manager_initialization( api->maximum_ports );
_ITRON_Variable_memory_pool_Manager_initialization(api->maximum_memory_pools);
} }
#endif #endif

View File

@@ -3,7 +3,7 @@
* *
* NOTE: * NOTE:
* *
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -39,6 +39,7 @@
#include <rtems/posix/key.h> #include <rtems/posix/key.h>
#include <rtems/posix/mqueue.h> #include <rtems/posix/mqueue.h>
#include <rtems/posix/mutex.h> #include <rtems/posix/mutex.h>
#include <rtems/posix/posixapi.h>
#include <rtems/posix/priority.h> #include <rtems/posix/priority.h>
#include <rtems/posix/psignal.h> #include <rtems/posix/psignal.h>
#include <rtems/posix/pthread.h> #include <rtems/posix/pthread.h>
@@ -55,76 +56,51 @@
* XXX * XXX
*/ */
const posix_api_configuration_table _POSIX_Default_configuration = {
0, /* maximum_threads */
0, /* maximum_mutexes */
0, /* maximum_condition_variables */
0, /* maximum_keys */
0, /* maximum_timers */
0, /* maximum_queued_signals */
0, /* number_of_initialization_threads */
0, /* maximum_message_queues */
0, /* maximum_semaphores */
0, /* maximum_barriers */
0, /* maximum_spinlocks */
0, /* maximum_rwlocks */
NULL /* User_initialization_threads_table */
};
Objects_Information *_POSIX_Objects[ OBJECTS_POSIX_CLASSES_LAST + 1 ]; Objects_Information *_POSIX_Objects[ OBJECTS_POSIX_CLASSES_LAST + 1 ];
void _POSIX_API_Initialize(void)
void _POSIX_API_Initialize(
rtems_configuration_table *configuration_table
)
{ {
const posix_api_configuration_table *api_configuration; const posix_api_configuration_table *api;
/* XXX need to assert here based on size assumptions */ /* XXX need to assert here based on size assumptions */
assert( sizeof(pthread_t) == sizeof(Objects_Id) ); assert( sizeof(pthread_t) == sizeof(Objects_Id) );
api_configuration = configuration_table->POSIX_api_configuration; /*
if ( !api_configuration ) * Install our API Object Management Table and initialize the
api_configuration = &_POSIX_Default_configuration; * various managers.
*/
api = &Configuration_POSIX_API;
_Objects_Information_table[OBJECTS_POSIX_API] = _POSIX_Objects; _Objects_Information_table[OBJECTS_POSIX_API] = _POSIX_Objects;
_POSIX_signals_Manager_Initialization( _POSIX_signals_Manager_Initialization( api->maximum_queued_signals );
api_configuration->maximum_queued_signals
);
_POSIX_Threads_Manager_initialization( _POSIX_Threads_Manager_initialization(
api_configuration->maximum_threads, api->maximum_threads,
api_configuration->number_of_initialization_threads, api->number_of_initialization_threads,
api_configuration->User_initialization_threads_table api->User_initialization_threads_table
); );
_POSIX_Condition_variables_Manager_initialization( _POSIX_Condition_variables_Manager_initialization(
api_configuration->maximum_condition_variables api->maximum_condition_variables
); );
_POSIX_Key_Manager_initialization( api_configuration->maximum_keys ); _POSIX_Key_Manager_initialization( api->maximum_keys );
_POSIX_Mutex_Manager_initialization( _POSIX_Mutex_Manager_initialization( api->maximum_mutexes );
api_configuration->maximum_mutexes
);
_POSIX_Message_queue_Manager_initialization( _POSIX_Message_queue_Manager_initialization( api->maximum_message_queues );
api_configuration->maximum_message_queues
);
_POSIX_Semaphore_Manager_initialization( _POSIX_Semaphore_Manager_initialization( api->maximum_semaphores );
api_configuration->maximum_semaphores
);
_POSIX_Timer_Manager_initialization( api_configuration->maximum_timers ); _POSIX_Timer_Manager_initialization( api->maximum_timers );
_POSIX_Barrier_Manager_initialization( api_configuration->maximum_barriers ); _POSIX_Barrier_Manager_initialization( api->maximum_barriers );
_POSIX_RWLock_Manager_initialization( api_configuration->maximum_rwlocks ); _POSIX_RWLock_Manager_initialization( api->maximum_rwlocks );
_POSIX_Spinlock_Manager_initialization(api_configuration->maximum_spinlocks); _POSIX_Spinlock_Manager_initialization(api->maximum_spinlocks);
} }
#endif #endif

View File

@@ -3,7 +3,7 @@
* *
* NOTE: * NOTE:
* *
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -54,13 +54,15 @@ Objects_Information *_RTEMS_Objects[ OBJECTS_RTEMS_CLASSES_LAST + 1 ];
* XXX * XXX
*/ */
void _RTEMS_API_Initialize( void _RTEMS_API_Initialize(void)
rtems_configuration_table *configuration_table
)
{ {
rtems_api_configuration_table *api_configuration; rtems_api_configuration_table *api;
api_configuration = configuration_table->RTEMS_api_configuration; /*
* Install our API Object Management Table and initialize the
* various managers.
*/
api = &Configuration_RTEMS_API;
_Objects_Information_table[OBJECTS_CLASSIC_API] = _RTEMS_Objects; _Objects_Information_table[OBJECTS_CLASSIC_API] = _RTEMS_Objects;
@@ -72,29 +74,27 @@ void _RTEMS_API_Initialize(
_Multiprocessing_Manager_initialization(); _Multiprocessing_Manager_initialization();
#endif #endif
_RTEMS_tasks_Manager_initialization( api_configuration->maximum_tasks ); _RTEMS_tasks_Manager_initialization( api->maximum_tasks );
_Timer_Manager_initialization( api_configuration->maximum_timers ); _Timer_Manager_initialization( api->maximum_timers );
_Signal_Manager_initialization(); _Signal_Manager_initialization();
_Event_Manager_initialization(); _Event_Manager_initialization();
_Message_queue_Manager_initialization( _Message_queue_Manager_initialization( api->maximum_message_queues );
api_configuration->maximum_message_queues
);
_Semaphore_Manager_initialization( api_configuration->maximum_semaphores ); _Semaphore_Manager_initialization( api->maximum_semaphores );
_Partition_Manager_initialization( api_configuration->maximum_partitions ); _Partition_Manager_initialization( api->maximum_partitions );
_Region_Manager_initialization( api_configuration->maximum_regions ); _Region_Manager_initialization( api->maximum_regions );
_Dual_ported_memory_Manager_initialization( api_configuration->maximum_ports); _Dual_ported_memory_Manager_initialization( api->maximum_ports);
_Rate_monotonic_Manager_initialization( api_configuration->maximum_periods ); _Rate_monotonic_Manager_initialization( api->maximum_periods );
_Barrier_Manager_initialization( api_configuration->maximum_barriers ); _Barrier_Manager_initialization( api->maximum_barriers );
} }
/* end of file */ /* end of file */

View File

@@ -2,7 +2,7 @@
* ISR Handler * ISR Handler
* *
* *
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -48,7 +48,7 @@ void _ISR_Handler_initialization( void )
#if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE ) #if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )
if ( !_Stack_Is_enough(_Configuration_Table->interrupt_stack_size) ) if ( !_Stack_Is_enough(Configuration.interrupt_stack_size) )
_Internal_error_Occurred( _Internal_error_Occurred(
INTERNAL_ERROR_CORE, INTERNAL_ERROR_CORE,
TRUE, TRUE,
@@ -56,12 +56,12 @@ void _ISR_Handler_initialization( void )
); );
_CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error( _CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error(
_Configuration_Table->interrupt_stack_size Configuration.interrupt_stack_size
); );
_CPU_Interrupt_stack_high = _Addresses_Add_offset( _CPU_Interrupt_stack_high = _Addresses_Add_offset(
_CPU_Interrupt_stack_low, _CPU_Interrupt_stack_low,
_Configuration_Table->interrupt_stack_size Configuration.interrupt_stack_size
); );
#endif #endif

View File

@@ -2,7 +2,7 @@
* Thread Handler * Thread Handler
* *
* *
* COPYRIGHT (c) 1989-2007. * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -59,8 +59,8 @@ void _Thread_Handler_initialization(
* BOTH stacks hooks must be set or both must be NULL. * BOTH stacks hooks must be set or both must be NULL.
* Do not allow mixture. * Do not allow mixture.
*/ */
if ( !( (!_Configuration_Table->stack_allocate_hook) if ( !( (!Configuration.stack_allocate_hook)
== (!_Configuration_Table->stack_free_hook) ) ) == (!Configuration.stack_free_hook) ) )
_Internal_error_Occurred( _Internal_error_Occurred(
INTERNAL_ERROR_CORE, INTERNAL_ERROR_CORE,
TRUE, TRUE,

View File

@@ -60,7 +60,7 @@ void _Thread_Create_idle( void )
&_Thread_Internal_information, &_Thread_Internal_information,
_Thread_Idle, _Thread_Idle,
NULL, /* allocate the stack */ NULL, /* allocate the stack */
_Stack_Ensure_minimum( _Configuration_Table->idle_task_stack_size ), _Stack_Ensure_minimum( Configuration.idle_task_stack_size ),
CPU_IDLE_TASK_IS_FP, CPU_IDLE_TASK_IS_FP,
PRIORITY_MAXIMUM, PRIORITY_MAXIMUM,
TRUE, /* preemptable */ TRUE, /* preemptable */
@@ -82,7 +82,7 @@ void _Thread_Create_idle( void )
_Thread_Start( _Thread_Start(
_Thread_Idle, _Thread_Idle,
THREAD_START_NUMERIC, THREAD_START_NUMERIC,
_Configuration_Table->idle_task, Configuration.idle_task,
NULL, NULL,
0 0
); );

View File

@@ -2,7 +2,7 @@
* Thread Handler * Thread Handler
* *
* *
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -57,8 +57,8 @@ size_t _Thread_Stack_Allocate(
* routine can call the correct deallocation routine. * routine can call the correct deallocation routine.
*/ */
if ( _Configuration_Table->stack_allocate_hook ) { if ( Configuration.stack_allocate_hook ) {
stack_addr = (*_Configuration_Table->stack_allocate_hook)( the_stack_size ); stack_addr = (*Configuration.stack_allocate_hook)( the_stack_size );
} else { } else {
/* /*

View File

@@ -2,7 +2,7 @@
* Thread Handler * Thread Handler
* *
* *
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -54,8 +54,8 @@ void _Thread_Stack_Free(
* routine properly matches the allocation of the stack. * routine properly matches the allocation of the stack.
*/ */
if ( _Configuration_Table->stack_free_hook ) if ( Configuration.stack_free_hook )
(*_Configuration_Table->stack_free_hook)( (*Configuration.stack_free_hook)(
the_thread->Start.Initial_stack.area the_thread->Start.Initial_stack.area
); );
else else

View File

@@ -1,7 +1,7 @@
/* /*
* Workspace Handler * Workspace Handler
* *
* COPYRIGHT (c) 1989-2007. * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -39,7 +39,7 @@ void _Workspace_Handler_initialization(
INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS
); );
if ( _Configuration_Table->do_zero_of_workspace ) if ( Configuration.do_zero_of_workspace )
memset( starting_address, 0, size ); memset( starting_address, 0, size );
memory_available = _Heap_Initialize( memory_available = _Heap_Initialize(