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

* bootcard.c, bsplibc.c: Eliminate copies of the Configuration Table.
	Use the RTEMS provided accessor macros to obtain configuration
	fields.
This commit is contained in:
Joel Sherrill
2007-12-11 15:50:53 +00:00
parent 9cf283a602
commit 4e9893b19a
3 changed files with 15 additions and 28 deletions

View File

@@ -1,3 +1,9 @@
2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
* bootcard.c, bsplibc.c: Eliminate copies of the Configuration Table.
Use the RTEMS provided accessor macros to obtain configuration
fields.
2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com> 2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com>
* bootcard.c: Move interrupt_stack_size field from CPU Table to * bootcard.c: Move interrupt_stack_size field from CPU Table to

View File

@@ -36,16 +36,6 @@
extern void bsp_start( void ); extern void bsp_start( void );
extern void bsp_cleanup( void ); extern void bsp_cleanup( void );
extern rtems_configuration_table Configuration;
extern rtems_configuration_table BSP_Configuration;
rtems_api_configuration_table BSP_RTEMS_Configuration;
#ifdef RTEMS_POSIX_API
posix_api_configuration_table BSP_POSIX_Configuration;
#endif
rtems_interrupt_level bsp_isr_level;
/* /*
* Since there is a forward reference * Since there is a forward reference
*/ */
@@ -58,6 +48,13 @@ int boot_card(int argc, char **argv, char **envp)
static char *envp_pointer = NULL; static char *envp_pointer = NULL;
char **argv_p = &argv_pointer; char **argv_p = &argv_pointer;
char **envp_p = &envp_pointer; char **envp_p = &envp_pointer;
rtems_interrupt_level bsp_isr_level;
/*
* Make sure interrupts are disabled.
*/
rtems_interrupt_disable( bsp_isr_level );
/* /*
* Set things up so c_rtems_main() is called with real pointers for * Set things up so c_rtems_main() is called with real pointers for
@@ -72,20 +69,6 @@ int boot_card(int argc, char **argv, char **envp)
if ( envp ) if ( envp )
envp_p = envp; envp_p = envp;
/*
* Copy the configuration table so we and the BSP wants to change it.
*/
BSP_Configuration = Configuration;
BSP_RTEMS_Configuration = *Configuration.RTEMS_api_configuration;
BSP_Configuration.RTEMS_api_configuration = &BSP_RTEMS_Configuration;
#ifdef RTEMS_POSIX_API
BSP_POSIX_Configuration = *Configuration.POSIX_api_configuration;
BSP_Configuration.POSIX_api_configuration = &BSP_POSIX_Configuration;
#endif
/* /*
* Invoke Board Support Package initialization routine written in C. * Invoke Board Support Package initialization routine written in C.
*/ */
@@ -96,7 +79,7 @@ int boot_card(int argc, char **argv, char **envp)
* Initialize RTEMS but do NOT start multitasking. * Initialize RTEMS but do NOT start multitasking.
*/ */
bsp_isr_level = rtems_initialize_executive_early( &BSP_Configuration ); rtems_initialize_executive_early( &Configuration );
/* /*
* Call c_rtems_main() and eventually let the first task or the real * Call c_rtems_main() and eventually let the first task or the real

View File

@@ -9,8 +9,6 @@
#include <rtems/libio.h> #include <rtems/libio.h>
#include <rtems/libcsupport.h> #include <rtems/libcsupport.h>
extern rtems_configuration_table BSP_Configuration;
void bsp_libc_init( void bsp_libc_init(
void *heap_start, void *heap_start,
uint32_t heap_size, uint32_t heap_size,
@@ -31,7 +29,7 @@ void bsp_libc_init(
* Set up for the libc handling. * Set up for the libc handling.
*/ */
if ( BSP_Configuration.ticks_per_timeslice > 0 ) if ( rtems_configuration_get_ticks_per_timeslice() > 0 )
libc_init(1); /* reentrant if possible */ libc_init(1); /* reentrant if possible */
else else
libc_init(0); /* non-reentrant */ libc_init(0); /* non-reentrant */