diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-12-04 22:19:19 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-12-04 22:19:19 +0000 |
commit | 6aa25dac92e92c95e3c133e0bc330bd3f4b7e9dd (patch) | |
tree | 96ef3d0f465b080c486145f027544cefefe68e89 | |
parent | 2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-6aa25dac92e92c95e3c133e0bc330bd3f4b7e9dd.tar.bz2 |
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.
-rw-r--r-- | cpukit/ChangeLog | 9 | ||||
-rw-r--r-- | cpukit/sapi/include/confdefs.h | 40 | ||||
-rw-r--r-- | cpukit/sapi/include/rtems/config.h | 17 | ||||
-rw-r--r-- | cpukit/sapi/include/rtems/init.h | 3 | ||||
-rw-r--r-- | cpukit/sapi/src/exinit.c | 17 | ||||
-rw-r--r-- | cpukit/score/include/rtems/system.h | 28 | ||||
-rw-r--r-- | cpukit/score/src/isr.c | 10 |
7 files changed, 57 insertions, 67 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index da97c082b7..88fba725fa 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -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 diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index 4f7cb1887a..35ca7038a7 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -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 @@ -209,6 +194,28 @@ extern int rtems_telnetd_maximum_ptys; #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 */ diff --git a/cpukit/sapi/include/rtems/config.h b/cpukit/sapi/include/rtems/config.h index 6dd52f08eb..b5b804ac7c 100644 --- a/cpukit/sapi/include/rtems/config.h +++ b/cpukit/sapi/include/rtems/config.h @@ -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) -#define rtems_configuration_get_user_multiprocessing_table() \ - (_Configuration_Table->User_multiprocessing_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) diff --git a/cpukit/sapi/include/rtems/init.h b/cpukit/sapi/include/rtems/init.h index a0f854d992..a3e604fc80 100644 --- a/cpukit/sapi/include/rtems/init.h +++ b/cpukit/sapi/include/rtems/init.h @@ -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 ); /* diff --git a/cpukit/sapi/src/exinit.c b/cpukit/sapi/src/exinit.c index c25c5ec173..db2fdb26e2 100644 --- a/cpukit/sapi/src/exinit.c +++ b/cpukit/sapi/src/exinit.c @@ -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) /* diff --git a/cpukit/score/include/rtems/system.h b/cpukit/score/include/rtems/system.h index aba744380c..a90c0aebda 100644 --- a/cpukit/score/include/rtems/system.h +++ b/cpukit/score/include/rtems/system.h @@ -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) diff --git a/cpukit/score/src/isr.c b/cpukit/score/src/isr.c index af7ebbfba7..5c880df305 100644 --- a/cpukit/score/src/isr.c +++ b/cpukit/score/src/isr.c @@ -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 |