From 4e9893b19abbf3bd4633b3b986c011f66bcc1591 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 11 Dec 2007 15:50:53 +0000 Subject: 2007-12-11 Joel Sherrill * bootcard.c, bsplibc.c: Eliminate copies of the Configuration Table. Use the RTEMS provided accessor macros to obtain configuration fields. --- c/src/lib/libbsp/shared/ChangeLog | 6 ++++++ c/src/lib/libbsp/shared/bootcard.c | 33 ++++++++------------------------- c/src/lib/libbsp/shared/bsplibc.c | 4 +--- 3 files changed, 15 insertions(+), 28 deletions(-) (limited to 'c/src/lib') diff --git a/c/src/lib/libbsp/shared/ChangeLog b/c/src/lib/libbsp/shared/ChangeLog index d9cd111ef5..18179196dd 100644 --- a/c/src/lib/libbsp/shared/ChangeLog +++ b/c/src/lib/libbsp/shared/ChangeLog @@ -1,3 +1,9 @@ +2007-12-11 Joel Sherrill + + * 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 * bootcard.c: Move interrupt_stack_size field from CPU Table to diff --git a/c/src/lib/libbsp/shared/bootcard.c b/c/src/lib/libbsp/shared/bootcard.c index 23086106dd..b36e026f1d 100644 --- a/c/src/lib/libbsp/shared/bootcard.c +++ b/c/src/lib/libbsp/shared/bootcard.c @@ -36,16 +36,6 @@ extern void bsp_start( 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 */ @@ -58,6 +48,13 @@ int boot_card(int argc, char **argv, char **envp) static char *envp_pointer = NULL; char **argv_p = &argv_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 @@ -72,20 +69,6 @@ int boot_card(int argc, char **argv, char **envp) if ( 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. */ @@ -96,7 +79,7 @@ int boot_card(int argc, char **argv, char **envp) * 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 diff --git a/c/src/lib/libbsp/shared/bsplibc.c b/c/src/lib/libbsp/shared/bsplibc.c index f5b4f3e68a..8bdc68f40d 100644 --- a/c/src/lib/libbsp/shared/bsplibc.c +++ b/c/src/lib/libbsp/shared/bsplibc.c @@ -9,8 +9,6 @@ #include #include -extern rtems_configuration_table BSP_Configuration; - void bsp_libc_init( void *heap_start, uint32_t heap_size, @@ -31,7 +29,7 @@ void bsp_libc_init( * 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 */ else libc_init(0); /* non-reentrant */ -- cgit v1.2.3