From 62577f9317f88c809ad67aed898b50ce3de2eebe Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 28 Nov 2007 21:44:29 +0000 Subject: [PATCH] 2007-11-28 Joel Sherrill * clock/clock.c, startup/bspstart.c: Eliminate PowerPC specific elements from the CPU Table. They have been replaced with variables named bsp_XXX as needed. --- c/src/lib/libbsp/powerpc/gen5200/ChangeLog | 6 ++++++ c/src/lib/libbsp/powerpc/gen5200/clock/clock.c | 8 +++++--- c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c | 9 +++++++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/c/src/lib/libbsp/powerpc/gen5200/ChangeLog b/c/src/lib/libbsp/powerpc/gen5200/ChangeLog index 00dfae67a4..0d29d9b386 100644 --- a/c/src/lib/libbsp/powerpc/gen5200/ChangeLog +++ b/c/src/lib/libbsp/powerpc/gen5200/ChangeLog @@ -1,3 +1,9 @@ +2007-11-28 Joel Sherrill + + * clock/clock.c, startup/bspstart.c: Eliminate PowerPC specific + elements from the CPU Table. They have been replaced with variables + named bsp_XXX as needed. + 2007-10-31 Joel Sherrill * include/mpc5200.h: Fix typo. diff --git a/c/src/lib/libbsp/powerpc/gen5200/clock/clock.c b/c/src/lib/libbsp/powerpc/gen5200/clock/clock.c index 2a638c0072..e315a3d357 100644 --- a/c/src/lib/libbsp/powerpc/gen5200/clock/clock.c +++ b/c/src/lib/libbsp/powerpc/gen5200/clock/clock.c @@ -71,7 +71,7 @@ /* for these modifications: */ /* COPYRIGHT (c) 1997 by IMD, Puchheim, Germany. */ /* */ -/* COPYRIGHT (c) 1989-1999. */ +/* COPYRIGHT (c) 1989-2007. /* On-Line Applications Research Corporation (OAR). */ /* */ /* The license and distribution terms for this file may be */ @@ -221,11 +221,12 @@ uint32_t mpc5200_check_gpt_status(uint32_t gpt_no) void clockOn(const rtems_irq_connect_data* irq) { uint32_t gpt_no; + extern uint32_t bsp_clicks_per_usec; gpt_no = BSP_SIU_IRQ_TMR0 - (irq->name); counter_value = rtems_configuration_get_microseconds_per_tick() * - rtems_cpu_configuration_get_clicks_per_usec(); + bsp_clicks_per_usec; mpc5200_set_gpt_count(counter_value, (uint32_t)gpt_no); mpc5200_enable_gpt_int((uint32_t)gpt_no); @@ -341,8 +342,9 @@ int BSP_connect_clock_handler (uint32_t gpt_no) /* This driver does this in clockOn called at connection time */ #define Clock_driver_support_initialize_hardware() \ do { \ + extern uint32_t bsp_clicks_per_usec; \ counter_value = rtems_configuration_get_microseconds_per_tick() * \ - rtems_cpu_configuration_get_clicks_per_usec(); \ + bsp_clicks_per_usec; \ mpc5200_init_gpt(GPT); \ mpc5200_set_gpt_count(counter_value, GPT); \ } while (0) diff --git a/c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c b/c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c index 380bf42110..cf423547aa 100644 --- a/c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c +++ b/c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c @@ -65,7 +65,7 @@ /* conditions. */ /* The mmu is unused at this time. */ /* */ -/* COPYRIGHT (c) 1989-1999. */ +/* COPYRIGHT (c) 1989-2007. /* On-Line Applications Research Corporation (OAR). */ /* */ /* The license and distribution terms for this file may be */ @@ -132,6 +132,10 @@ rtems_configuration_table BSP_Configuration; rtems_cpu_table Cpu_table; char *rtems_progname; +/* + * Driver configuration parameters + */ +uint32_t bsp_clicks_per_usec; /* * Use the shared implementations of the following routines. @@ -290,12 +294,13 @@ void bsp_start(void) Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ Cpu_table.predriver_hook = bsp_predriver_hook; /* init PCI / RTC ... */ Cpu_table.postdriver_hook = bsp_postdriver_hook; - Cpu_table.clicks_per_usec = (IPB_CLOCK/1000000); Cpu_table.exceptions_in_RAM = TRUE; if( Cpu_table.interrupt_stack_size < 4*1024 ) Cpu_table.interrupt_stack_size = 4 * 1024; + bsp_clicks_per_usec = (IPB_CLOCK/1000000); + /* * Install our own set of exception vectors */