diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-06-05 22:10:43 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-06-05 22:10:43 +0000 |
commit | b360885dfd245326605a549b6310a23ab5457f06 (patch) | |
tree | 45b2f5b324aaac330a0198ac23b30c8941de139c /c | |
parent | 2009-06-05 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-b360885dfd245326605a549b6310a23ab5457f06.tar.bz2 |
2009-06-05 Joel Sherrill <joel.sherrill@OARcorp.com>
* preinstall.am, pxa255/clock/clock.c, pxa255/ffuart/ffuart.c,
pxa255/irq/bsp_irq_init.c, pxa255/timer/timer.c: Fix typos and update
timer.
Diffstat (limited to 'c')
-rw-r--r-- | c/src/lib/libcpu/arm/ChangeLog | 6 | ||||
-rw-r--r-- | c/src/lib/libcpu/arm/preinstall.am | 2 | ||||
-rwxr-xr-x | c/src/lib/libcpu/arm/pxa255/clock/clock.c | 35 | ||||
-rwxr-xr-x | c/src/lib/libcpu/arm/pxa255/ffuart/ffuart.c | 1 | ||||
-rwxr-xr-x | c/src/lib/libcpu/arm/pxa255/irq/bsp_irq_init.c | 24 | ||||
-rwxr-xr-x | c/src/lib/libcpu/arm/pxa255/timer/timer.c | 45 |
6 files changed, 50 insertions, 63 deletions
diff --git a/c/src/lib/libcpu/arm/ChangeLog b/c/src/lib/libcpu/arm/ChangeLog index e07b386f2a..40d2f5735b 100644 --- a/c/src/lib/libcpu/arm/ChangeLog +++ b/c/src/lib/libcpu/arm/ChangeLog @@ -1,3 +1,9 @@ +2009-06-05 Joel Sherrill <joel.sherrill@OARcorp.com> + + * preinstall.am, pxa255/clock/clock.c, pxa255/ffuart/ffuart.c, + pxa255/irq/bsp_irq_init.c, pxa255/timer/timer.c: Fix typos and update + timer. + 2009-06-05 Joel Sherrill <joel.sherrill@oarcorp.com> * pxa255/clock/clock.c: Add ON_SKYEYE option to enable fast idle mode. diff --git a/c/src/lib/libcpu/arm/preinstall.am b/c/src/lib/libcpu/arm/preinstall.am index 3fab40ed38..3d156cad74 100644 --- a/c/src/lib/libcpu/arm/preinstall.am +++ b/c/src/lib/libcpu/arm/preinstall.am @@ -28,7 +28,6 @@ $(PROJECT_INCLUDE)/libcpu/mmu.h: shared/include/mmu.h $(PROJECT_INCLUDE)/libcpu/ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libcpu/mmu.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/libcpu/mmu.h endif - if pxa255 $(PROJECT_INCLUDE)/pxa255.h: pxa255/include/pxa255.h $(PROJECT_INCLUDE)/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/pxa255.h @@ -42,7 +41,6 @@ $(PROJECT_INCLUDE)/irq.h: pxa255/irq/irq.h $(PROJECT_INCLUDE)/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/irq.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/irq.h endif - if at91rm9200 $(PROJECT_INCLUDE)/at91rm9200.h: at91rm9200/include/at91rm9200.h $(PROJECT_INCLUDE)/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/at91rm9200.h diff --git a/c/src/lib/libcpu/arm/pxa255/clock/clock.c b/c/src/lib/libcpu/arm/pxa255/clock/clock.c index d0fe9ecab4..0bb96a00a3 100755 --- a/c/src/lib/libcpu/arm/pxa255/clock/clock.c +++ b/c/src/lib/libcpu/arm/pxa255/clock/clock.c @@ -34,18 +34,15 @@ static unsigned long period_num; */ static void clock_isr_on(const rtems_irq_connect_data *unused) { - /*Clear the interrupt bit */ XSCALE_OS_TIMER_TSR = 0x1; - - + /* enable timer interrupt */ XSCALE_OS_TIMER_IER |= 0x1; period_num = TIMER_RATE*(Configuration.microseconds_per_tick/10000); XSCALE_OS_TIMER_MR0 = XSCALE_OS_TIMER_TCR + period_num; - } /** @@ -77,13 +74,15 @@ static int clock_isr_is_on(const rtems_irq_connect_data *irq) rtems_isr Clock_isr(rtems_vector_number vector); /* Replace the first value with the clock's interrupt name. */ -rtems_irq_connect_data clock_isr_data = {XSCALE_IRQ_OS_TIMER, - (rtems_irq_hdl)Clock_isr, - clock_isr_on, - clock_isr_off, - clock_isr_is_on, - 3, /* unused for ARM cpus */ - 0 }; /* unused for ARM cpus */ +rtems_irq_connect_data clock_isr_data = { + XSCALE_IRQ_OS_TIMER, + (rtems_irq_hdl)Clock_isr, + clock_isr_on, + clock_isr_off, + clock_isr_is_on, + 3, /* unused for ARM cpus */ + 0 /* unused for ARM cpus */ +}; #define Clock_driver_support_install_isr( _new, _old ) \ @@ -91,10 +90,7 @@ rtems_irq_connect_data clock_isr_data = {XSCALE_IRQ_OS_TIMER, void Clock_driver_support_initialize_hardware(void) { - - period_num = TIMER_RATE*(Configuration.microseconds_per_tick/10000); - } @@ -102,15 +98,16 @@ void Clock_driver_support_initialize_hardware(void) #define Clock_driver_support_at_tick() \ do { \ - ;\ - XSCALE_OS_TIMER_TSR = 0x1;/* read the status to clear the int */ \ - XSCALE_OS_TIMER_MR0 = XSCALE_OS_TIMER_TCR + period_num;/*Add the match register*/ \ - ;\ + /* read the status to clear the int */ \ + XSCALE_OS_TIMER_TSR = 0x1; \ + \ + /*Add the match register*/ \ + XSCALE_OS_TIMER_MR0 = XSCALE_OS_TIMER_TCR + period_num; \ } while (0) void Clock_driver_support_shutdown_hardware( void ) { - BSP_remove_rtems_irq_handler(&clock_isr_data); + BSP_remove_rtems_irq_handler(&clock_isr_data); } #include "../../../../libbsp/shared/clockdrv_shell.h" diff --git a/c/src/lib/libcpu/arm/pxa255/ffuart/ffuart.c b/c/src/lib/libcpu/arm/pxa255/ffuart/ffuart.c index 7bbac0ba96..7df7aaf6c2 100755 --- a/c/src/lib/libcpu/arm/pxa255/ffuart/ffuart.c +++ b/c/src/lib/libcpu/arm/pxa255/ffuart/ffuart.c @@ -8,7 +8,6 @@ * * $Id$ */ - */ #include <bsp.h> #include <rtems/libio.h> diff --git a/c/src/lib/libcpu/arm/pxa255/irq/bsp_irq_init.c b/c/src/lib/libcpu/arm/pxa255/irq/bsp_irq_init.c index dcbc095975..1d7100255b 100755 --- a/c/src/lib/libcpu/arm/pxa255/irq/bsp_irq_init.c +++ b/c/src/lib/libcpu/arm/pxa255/irq/bsp_irq_init.c @@ -13,25 +13,27 @@ #include <bsp.h> #include <pxa255.h> -extern void default_int_handler(); +extern void default_int_handler(void); void (*IRQ_table[PRIMARY_IRQS])(uint32_t vector); + /* * Interrupt system initialization. Disable interrupts, clear * any that are pending. */ -void BSP_rtems_irq_mngt_init() +void BSP_rtems_irq_mngt_init(void) { - int i; + int i; + + /* Initialize the vector table contents with default handler */ + for (i=0; i<PRIMARY_IRQS; i++) { + IRQ_table[i] = default_int_handler; + } - /* Initialize the vector table contents with default handler */ - for (i=0; i<PRIMARY_IRQS; i++) { - IRQ_table[i] = default_int_handler; - } + /* disable all interrupts */ + XSCALE_INT_ICMR = 0x0; - /* disable all interrupts */ - XSCALE_INT_ICMR = 0x0; - /*Direct the interrupt to IRQ*/ - XSCALE_INT_ICLR = 0x0; + /* Direct the interrupt to IRQ*/ + XSCALE_INT_ICLR = 0x0; } diff --git a/c/src/lib/libcpu/arm/pxa255/timer/timer.c b/c/src/lib/libcpu/arm/pxa255/timer/timer.c index 2e531715c3..d4162818fa 100755 --- a/c/src/lib/libcpu/arm/pxa255/timer/timer.c +++ b/c/src/lib/libcpu/arm/pxa255/timer/timer.c @@ -1,5 +1,5 @@ /* - *PXA255 timer by Yang Xi <hiyangxi@gmail.com> + * PXA255 timer by Yang Xi <hiyangxi@gmail.com> * Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com> * * Notes: @@ -17,28 +17,25 @@ * * $Id$ */ - * $Id$ - */ #include <rtems.h> #include <bsp.h> #include <pxa255.h> uint32_t tstart; -bool Timer_driver_Find_average_overhead; static uint32_t tick_time; +bool benchmark_timer_find_average_overhead; + +bool benchmark_timer_is_initialized = false; + /* * Use the timer count register to measure. * The frequency of it is 3.4864MHZ - *The longest period we are able to capture is 4G/3.4864MHZ - * - * + * The longest period we are able to capture is 4G/3.4864MHZ */ -void Timer_initialize( void ) +void benchmark_timer_initialize(void) { - tick_time = XSCALE_OS_TIMER_TCR; - } /* @@ -56,7 +53,7 @@ void Timer_initialize( void ) /* This value is in microseconds. */ #define LEAST_VALID 1 /* Don't trust a clicks value lower than this */ -int Read_timer( void ) +int benchmark_timer_read(void) { uint32_t total; @@ -64,32 +61,20 @@ int Read_timer( void ) if(total>=tick_time) total -= tick_time; else - total += 0xffffffff-tick_time; /*Round up but not overflow*/ + total += 0xffffffff - tick_time; /*Round up but not overflow*/ - if ( Timer_driver_Find_average_overhead == 1 ) + if ( benchmark_timer_find_average_overhead == true ) return total; /*Counter cycles*/ - else { - if ( total < LEAST_VALID ) - return 0; /* below timer resolution */ - return total; - } -} - -/* - * Empty function call used in loops to measure basic cost of looping - * in Timing Test Suite. - */ + if ( total < LEAST_VALID ) + return 0; /* below timer resolution */ -rtems_status_code Empty_function( void ) -{ - return RTEMS_SUCCESSFUL; + return total; } -void Set_find_average_overhead( +void benchmark_timer_disable_subtracting_average_overhead( bool find_flag ) { - Timer_driver_Find_average_overhead = find_flag; + benchmark_timer_find_average_overhead = find_flag; } - |