2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com>

* sapi/include/confdefs.h, sapi/include/rtems/config.h,
	sapi/include/rtems/init.h, sapi/src/exinit.c,
	score/include/rtems/system.h, score/src/isr.c: Move
	interrupt_stack_size field from CPU Table to Configuration Table.
	Eliminate CPU Table from all ports. Delete references to CPU Table in
	all forms.
This commit is contained in:
Joel Sherrill
2007-12-04 22:19:19 +00:00
parent ee29de05bc
commit 6aa25dac92
7 changed files with 57 additions and 67 deletions

View File

@@ -1,3 +1,12 @@
2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com>
* sapi/include/confdefs.h, sapi/include/rtems/config.h,
sapi/include/rtems/init.h, sapi/src/exinit.c,
score/include/rtems/system.h, score/src/isr.c: Move
interrupt_stack_size field from CPU Table to Configuration Table.
Eliminate CPU Table from all ports. Delete references to CPU Table in
all forms.
2007-12-04 Joel Sherrill <joel.sherrill@oarcorp.com>
* sapi/include/rtems/config.h: Add accessory macros for Configuration

View File

@@ -162,21 +162,6 @@ extern int rtems_telnetd_maximum_ptys;
#define CONFIGURE_STACK_CHECKER_EXTENSION 0
#endif
/*
* Interrupt Stack Space
*
* NOTE: There is currently no way for the application to override
* the interrupt stack size set by the BSP.
*/
#if (CPU_ALLOCATE_INTERRUPT_STACK == 0)
#undef CONFIGURE_INTERRUPT_STACK_MEMORY
#define CONFIGURE_INTERRUPT_STACK_MEMORY 0
#else
#ifndef CONFIGURE_INTERRUPT_STACK_MEMORY
#define CONFIGURE_INTERRUPT_STACK_MEMORY RTEMS_MINIMUM_STACK_SIZE
#endif
#endif
/*
* Idle task body configuration
@@ -208,6 +193,28 @@ extern int rtems_telnetd_maximum_ptys;
#endif
#endif
/*
* Interrupt stack size configuration
*
* By default, the interrupt stack will be of minimum size.
* The BSP or application may override this value.
*/
#ifndef CONFIGURE_INTERRUPT_STACK_SIZE
#ifdef BSP_INTERRUPT_STACK_SIZE
#define CONFIGURE_INTERRUPT_STACK_SIZE BSP_INTERRUPT_STACK_SIZE
#else
#define CONFIGURE_INTERRUPT_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
#endif
#endif
/* XXX try to get to the point where all BSP support allocating the
* XXX memory from the Workspace
*/
#if (CPU_ALLOCATE_INTERRUPT_STACK == 0)
#undef CONFIGURE_INTERRUPT_STACK_SIZE
#define CONFIGURE_INTERRUPT_STACK_SIZE 0
#endif
/*
* Task stack allocator configuration
*/
@@ -1098,7 +1105,7 @@ itron_initialization_tasks_table ITRON_Initialization_tasks[] = {
( CONFIGURE_MEMORY_FOR_TASKS(1) + /* IDLE */ \
((PRIORITY_MAXIMUM+1) * sizeof(Chain_Control)) + /* Ready chains */ \
256 + /* name/ptr table overhead */ \
CONFIGURE_INTERRUPT_STACK_MEMORY + /* interrupt stack */ \
CONFIGURE_INTERRUPT_STACK_SIZE + /* interrupt stack */ \
CONFIGURE_API_MUTEX_MEMORY /* allocation mutex */ \
)
@@ -1246,6 +1253,7 @@ rtems_configuration_table Configuration = {
CONFIGURE_TICKS_PER_TIMESLICE, /* ticks per timeslice quantum */
CONFIGURE_IDLE_TASK_BODY, /* user's IDLE task */
CONFIGURE_IDLE_TASK_STACK_SIZE, /* IDLE task stack size */
CONFIGURE_INTERRUPT_STACK_SIZE, /* interrupt stack size */
CONFIGURE_TASK_STACK_ALLOCATOR, /* stack allocator */
CONFIGURE_TASK_STACK_DEALLOCATOR, /* stack deallocator */
CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY, /* true to clear memory */

View File

@@ -121,6 +121,12 @@ typedef struct {
*/
uint32_t idle_task_stack_size;
/** This field specifies the size of the interrupt stack. If less than or
* equal to the minimum stack size, then the interrupt stack will be of
* minimum stack size.
*/
uint32_t interrupt_stack_size;
/** The BSP may want to provide it's own stack allocation routines.
* In this case, the BSP will provide this stack allocation hook.
*/
@@ -192,6 +198,9 @@ SAPI_EXTERN rtems_configuration_table *_Configuration_Table;
#define rtems_configuration_get_idle_task_stack_size() \
(_Configuration_Table->idle_task_stack_size)
#define rtems_configuration_get_interrupt_stack_size() \
(_Configuration_Table->interrupt_stack_size)
#define rtems_configuration_get_stack_allocate_hook() \
(_Configuration_Table->stack_allocate_hook)
@@ -220,8 +229,12 @@ SAPI_EXTERN rtems_configuration_table *_Configuration_Table;
#define rtems_configuration_get_user_extension_table() \
(_Configuration_Table->user_extension_table)
#if defined(RTEMS_MULTIPROCESSING)
#define rtems_configuration_get_user_multiprocessing_table() \
(_Configuration_Table->User_multiprocessing_table)
#else
#define rtems_configuration_get_user_multiprocessing_table() NULL
#endif
#define rtems_configuration_get_rtems_api_configuration() \
(_Configuration_Table->RTEMS_api_configuration)

View File

@@ -57,8 +57,7 @@ extern const rtems_multiprocessing_table
*/
rtems_interrupt_level rtems_initialize_executive_early(
rtems_configuration_table *configuration_table,
rtems_cpu_table *cpu_table
rtems_configuration_table *configuration_table
);
/*

View File

@@ -62,8 +62,7 @@
Objects_Information *_Internal_Objects[ OBJECTS_INTERNAL_CLASSES_LAST + 1 ];
rtems_interrupt_level rtems_initialize_executive_early(
rtems_configuration_table *configuration_table,
rtems_cpu_table *cpu_table
rtems_configuration_table *configuration_table
)
{
rtems_interrupt_level bsp_level;
@@ -85,18 +84,6 @@ rtems_interrupt_level rtems_initialize_executive_early(
INTERNAL_ERROR_NO_CONFIGURATION_TABLE
);
if ( cpu_table == NULL )
_Internal_error_Occurred(
INTERNAL_ERROR_CORE,
TRUE,
INTERNAL_ERROR_NO_CPU_TABLE
);
/*
* Grab our own copy of the user's CPU table.
*/
_CPU_Table = *cpu_table;
/*
* Provide pointers just for later convenience.
*/
@@ -105,7 +92,7 @@ rtems_interrupt_level rtems_initialize_executive_early(
/*
* Initialize any target architecture specific support as early as possible
*/
_CPU_Initialize( cpu_table, _Thread_Dispatch );
_CPU_Initialize( _Thread_Dispatch );
#if defined(RTEMS_MULTIPROCESSING)
/*

View File

@@ -187,34 +187,6 @@ extern const char _RTEMS_version[];
*/
extern const char _Copyright_Notice[];
/**
* The following defines the CPU dependent information table.
*/
SCORE_EXTERN rtems_cpu_table _CPU_Table;
/*
* Macros to access CPU Table fields required by ALL ports.
*/
/** This macro assists in accessing the CPU Specific Configuration Table. */
#define rtems_cpu_configuration_get_table() (&_CPU_Table)
/** This macro assists in accessing the pretasking BSP hook. */
#define rtems_cpu_configuration_get_pretasking_hook() \
(_CPU_Table.pretasking_hook)
/** This macro assists in accessing the predriver BSP hook. */
#define rtems_cpu_configuration_get_predriver_hook() \
(_CPU_Table.predriver_hook)
/** This macro assists in accessing the postdriver BSP hook. */
#define rtems_cpu_configuration_get_postdriver_hook() \
(_CPU_Table.postdriver_hook)
/** This macro assists in accessing the interrupt stack size. */
#define rtems_cpu_configuration_get_interrupt_stack_size() \
(_CPU_Table.interrupt_stack_size)
/** This macro defines the maximum length of a Classic API name. */
#define RTEMS_MAXIMUM_NAME_LENGTH sizeof(rtems_name)

View File

@@ -21,6 +21,7 @@
#include <rtems/score/stack.h>
#include <rtems/score/interr.h>
#include <rtems/score/wkspace.h>
#include <rtems/config.h>
/* _ISR_Handler_initialization
*
@@ -45,19 +46,20 @@ void _ISR_Handler_initialization( void )
#if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )
if ( _CPU_Table.interrupt_stack_size < STACK_MINIMUM_SIZE )
if ( _Configuration_Table->interrupt_stack_size < STACK_MINIMUM_SIZE )
_Internal_error_Occurred(
INTERNAL_ERROR_CORE,
TRUE,
INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL
);
_CPU_Interrupt_stack_low =
_Workspace_Allocate_or_fatal_error( _CPU_Table.interrupt_stack_size );
_CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error(
_Configuration_Table->interrupt_stack_size
);
_CPU_Interrupt_stack_high = _Addresses_Add_offset(
_CPU_Interrupt_stack_low,
_CPU_Table.interrupt_stack_size
_Configuration_Table->interrupt_stack_size
);
#endif