From c5dedd7d762f48e940ecc0bd17dd2173d59a92e1 Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Mon, 29 Jun 2009 14:29:57 +0000 Subject: Remove the TIMER_* macros and declare target-specific functions in timer.h git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21559 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/timer-as3525.c | 6 +++--- firmware/target/arm/as3525/timer-target.h | 13 ------------- .../target/arm/at91sam/lyre_proto1/timer-lyre_proto1.c | 6 +++--- firmware/target/arm/at91sam/lyre_proto1/timer-target.h | 13 ------------- firmware/target/arm/imx31/gigabeat-s/timer-imx31.c | 6 +++--- firmware/target/arm/imx31/gigabeat-s/timer-target.h | 13 ------------- firmware/target/arm/pnx0101/timer-pnx0101.c | 6 +++--- firmware/target/arm/pnx0101/timer-target.h | 13 ------------- firmware/target/arm/s3c2440/gigabeat-fx/timer-meg-fx.c | 6 +++--- firmware/target/arm/s3c2440/gigabeat-fx/timer-target.h | 13 ------------- firmware/target/arm/tcc77x/timer-target.h | 13 ------------- firmware/target/arm/tcc77x/timer-tcc77x.c | 6 +++--- firmware/target/arm/tcc780x/timer-target.h | 13 ------------- firmware/target/arm/tcc780x/timer-tcc780x.c | 6 +++--- firmware/target/arm/timer-pp.c | 6 +++--- firmware/target/arm/timer-target.h | 18 ------------------ firmware/target/arm/tms320dm320/timer-dm320.c | 6 +++--- firmware/target/arm/tms320dm320/timer-target.h | 13 ------------- 18 files changed, 27 insertions(+), 149 deletions(-) (limited to 'firmware/target/arm') diff --git a/firmware/target/arm/as3525/timer-as3525.c b/firmware/target/arm/as3525/timer-as3525.c index 50f0e73158..673e3b8f47 100644 --- a/firmware/target/arm/as3525/timer-as3525.c +++ b/firmware/target/arm/as3525/timer-as3525.c @@ -31,7 +31,7 @@ void INT_TIMER1(void) TIMER1_INTCLR = 0; /* clear interrupt */ } -bool __timer_set(long cycles, bool start) +bool timer_set(long cycles, bool start) { if (start) { @@ -53,14 +53,14 @@ bool __timer_set(long cycles, bool start) return true; } -bool __timer_start(void) +bool timer_start(void) { CGU_PERI |= CGU_TIMER1_CLOCK_ENABLE; /* enable peripheral */ VIC_INT_ENABLE |= INTERRUPT_TIMER1; return true; } -void __timer_stop(void) +void timer_stop(void) { TIMER1_CONTROL &= 0x10; /* disable timer 1 (don't modify bit 4) */ VIC_INT_EN_CLEAR = INTERRUPT_TIMER1; /* disable interrupt */ diff --git a/firmware/target/arm/as3525/timer-target.h b/firmware/target/arm/as3525/timer-target.h index b1bdfed78f..f6b4fae370 100644 --- a/firmware/target/arm/as3525/timer-target.h +++ b/firmware/target/arm/as3525/timer-target.h @@ -21,19 +21,6 @@ #ifndef TIMER_TARGET_H #define TIMER_TARGET_H -bool __timer_set(long cycles, bool set); -bool __timer_start(void); -void __timer_stop(void); - #define TIMER_FREQ (24000000 / 16) -#define __TIMER_SET(cycles, set) \ - __timer_set(cycles, set) - -#define __TIMER_START() \ - __timer_start() - -#define __TIMER_STOP(...) \ - __timer_stop() - #endif /* TIMER_TARGET_H */ diff --git a/firmware/target/arm/at91sam/lyre_proto1/timer-lyre_proto1.c b/firmware/target/arm/at91sam/lyre_proto1/timer-lyre_proto1.c index ef5c91169d..1b620e9c4f 100644 --- a/firmware/target/arm/at91sam/lyre_proto1/timer-lyre_proto1.c +++ b/firmware/target/arm/at91sam/lyre_proto1/timer-lyre_proto1.c @@ -48,7 +48,7 @@ void pitc_handler(void) } } -bool __timer_set(long cycles, bool start) +bool timer_set(long cycles, bool start) { if (cycles < 1000) /* Max value on PITC?? */ { @@ -67,7 +67,7 @@ bool __timer_set(long cycles, bool start) return false; } -bool __timer_start(void) +bool timer_start(void) { bool retval = true; volatile unsigned long pimr = 0; @@ -101,7 +101,7 @@ bool __timer_start(void) return retval; } -void __timer_stop(void) +void timer_stop(void) { volatile unsigned long pimr = 0; diff --git a/firmware/target/arm/at91sam/lyre_proto1/timer-target.h b/firmware/target/arm/at91sam/lyre_proto1/timer-target.h index b8298d3d77..d0773130bf 100644 --- a/firmware/target/arm/at91sam/lyre_proto1/timer-target.h +++ b/firmware/target/arm/at91sam/lyre_proto1/timer-target.h @@ -25,17 +25,4 @@ /* timer is based on PCLK and minimum division is 2 */ #define TIMER_FREQ (49156800/2) -bool __timer_set(long cycles, bool set); -bool __timer_start(void); -void __timer_stop(void); - -#define __TIMER_SET(cycles, set) \ - __timer_set(cycles, set) - -#define __TIMER_START() \ - __timer_start() - -#define __TIMER_STOP(...) \ - __timer_stop() - #endif /* TIMER_TARGET_H */ diff --git a/firmware/target/arm/imx31/gigabeat-s/timer-imx31.c b/firmware/target/arm/imx31/gigabeat-s/timer-imx31.c index 5e53e4a55e..f3f78a1ee1 100644 --- a/firmware/target/arm/imx31/gigabeat-s/timer-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/timer-imx31.c @@ -52,7 +52,7 @@ static void stop_timer(bool clock_off) } } -bool _timer_set(long cycles, bool start) +bool timer_set(long cycles, bool start) { /* Maximum cycle count expressible in the cycles parameter is 2^31-1 * and the modulus counter is capable of 2^32-1 and as a result there is @@ -86,7 +86,7 @@ bool _timer_set(long cycles, bool start) return true; } -bool _timer_start(void) +bool timer_start(void) { int oldstatus = disable_interrupt_save(IRQ_FIQ_STATUS); @@ -104,7 +104,7 @@ bool _timer_start(void) return true; } -void _timer_stop(void) +void timer_stop(void) { int oldstatus = disable_interrupt_save(IRQ_FIQ_STATUS); /* Halt timer if running - stop module clock */ diff --git a/firmware/target/arm/imx31/gigabeat-s/timer-target.h b/firmware/target/arm/imx31/gigabeat-s/timer-target.h index f019a45519..9d5520aa6d 100644 --- a/firmware/target/arm/imx31/gigabeat-s/timer-target.h +++ b/firmware/target/arm/imx31/gigabeat-s/timer-target.h @@ -24,17 +24,4 @@ /* timer is based on ipg_clk */ #define TIMER_FREQ (66000000) -bool _timer_set(long cycles, bool set); -bool _timer_start(void); -void _timer_stop(void); - -#define __TIMER_SET(cycles, set) \ - _timer_set(cycles, set) - -#define __TIMER_START() \ - _timer_start() - -#define __TIMER_STOP(...) \ - _timer_stop() - #endif /* TIMER_TARGET_H */ diff --git a/firmware/target/arm/pnx0101/timer-pnx0101.c b/firmware/target/arm/pnx0101/timer-pnx0101.c index 6e685aa20f..d54cfe84d5 100644 --- a/firmware/target/arm/pnx0101/timer-pnx0101.c +++ b/firmware/target/arm/pnx0101/timer-pnx0101.c @@ -43,7 +43,7 @@ void TIMER1_ISR(void) TIMER1.clr = 1; /* clear the interrupt */ } -bool __timer_set(long cycles, bool start) +bool timer_set(long cycles, bool start) { if (start) { @@ -68,14 +68,14 @@ bool __timer_set(long cycles, bool start) return true; } -bool __timer_start(void) +bool timer_start(void) { irq_set_int_handler(IRQ_TIMER1, TIMER1_ISR); irq_enable_int(IRQ_TIMER1); return true; } -void __timer_stop(void) +void timer_stop(void) { TIMER1.ctrl &= ~0x80; /* disable timer 1 */ irq_disable_int(IRQ_TIMER1); diff --git a/firmware/target/arm/pnx0101/timer-target.h b/firmware/target/arm/pnx0101/timer-target.h index 853da07838..3bfdb8986d 100644 --- a/firmware/target/arm/pnx0101/timer-target.h +++ b/firmware/target/arm/pnx0101/timer-target.h @@ -21,19 +21,6 @@ #ifndef TIMER_TARGET_H #define TIMER_TARGET_H -bool __timer_set(long cycles, bool start); -bool __timer_start(void); -void __timer_stop(void); - #define TIMER_FREQ 3000000 -#define __TIMER_SET(cycles, set) \ - __timer_set(cycles, set) - -#define __TIMER_START() \ - __timer_start() - -#define __TIMER_STOP(...) \ - __timer_stop() - #endif /* TIMER_TARGET_H */ diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/timer-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/timer-meg-fx.c index 884b0803a2..4565f79751 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/timer-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/timer-meg-fx.c @@ -48,7 +48,7 @@ static void stop_timer(void) INTPND = TIMER0_MASK; } -bool __timer_set(long cycles, bool start) +bool timer_set(long cycles, bool start) { bool retval = false; @@ -87,7 +87,7 @@ bool __timer_set(long cycles, bool start) return retval; } -bool __timer_start(void) +bool timer_start(void) { bool retval = true; @@ -122,7 +122,7 @@ bool __timer_start(void) return retval; } -void __timer_stop(void) +void timer_stop(void) { int oldstatus = disable_interrupt_save(IRQ_FIQ_STATUS); stop_timer(); diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/timer-target.h b/firmware/target/arm/s3c2440/gigabeat-fx/timer-target.h index 700833486d..215477a806 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/timer-target.h +++ b/firmware/target/arm/s3c2440/gigabeat-fx/timer-target.h @@ -25,17 +25,4 @@ #define TIMER_FREQ (49156800/2) #define TIMER234_PRESCALE 21 -bool __timer_set(long cycles, bool set); -bool __timer_start(void); -void __timer_stop(void); - -#define __TIMER_SET(cycles, set) \ - __timer_set(cycles, set) - -#define __TIMER_START() \ - __timer_start() - -#define __TIMER_STOP(...) \ - __timer_stop() - #endif /* TIMER_TARGET_H */ diff --git a/firmware/target/arm/tcc77x/timer-target.h b/firmware/target/arm/tcc77x/timer-target.h index ace31ac886..a4d869067a 100644 --- a/firmware/target/arm/tcc77x/timer-target.h +++ b/firmware/target/arm/tcc77x/timer-target.h @@ -24,17 +24,4 @@ /* timers are based on XIN (12Mhz) */ #define TIMER_FREQ (12000000) -bool __timer_set(long cycles, bool set); -bool __timer_start(void); -void __timer_stop(void); - -#define __TIMER_SET(cycles, set) \ - __timer_set(cycles, set) - -#define __TIMER_START() \ - __timer_start() - -#define __TIMER_STOP(...) \ - __timer_stop() - #endif /* TIMER_TARGET_H */ diff --git a/firmware/target/arm/tcc77x/timer-tcc77x.c b/firmware/target/arm/tcc77x/timer-tcc77x.c index ddf44454c2..6e8764d9ce 100644 --- a/firmware/target/arm/tcc77x/timer-tcc77x.c +++ b/firmware/target/arm/tcc77x/timer-tcc77x.c @@ -28,7 +28,7 @@ /* Use the TC32 counter [sourced by Xin:12Mhz] for this timer, as it's the only one that allows a 32-bit counter (Timer0-5 are 16/20 bit only). */ -bool __timer_set(long cycles, bool start) +bool timer_set(long cycles, bool start) { #warning function not implemented @@ -37,14 +37,14 @@ bool __timer_set(long cycles, bool start) return false; } -bool __timer_start(void) +bool timer_start(void) { #warning function not implemented return false; } -void __timer_stop(void) +void timer_stop(void) { #warning function not implemented } diff --git a/firmware/target/arm/tcc780x/timer-target.h b/firmware/target/arm/tcc780x/timer-target.h index d6a8c4b0aa..91a623a713 100644 --- a/firmware/target/arm/tcc780x/timer-target.h +++ b/firmware/target/arm/tcc780x/timer-target.h @@ -24,17 +24,4 @@ /* Timer is based on PCK_TCT (set to 2Mhz in system.c) */ #define TIMER_FREQ (2000000) -bool __timer_set(long cycles, bool set); -bool __timer_start(void); -void __timer_stop(void); - -#define __TIMER_SET(cycles, set) \ - __timer_set(cycles, set) - -#define __TIMER_START() \ - __timer_start() - -#define __TIMER_STOP(...) \ - __timer_stop() - #endif /* TIMER_TARGET_H */ diff --git a/firmware/target/arm/tcc780x/timer-tcc780x.c b/firmware/target/arm/tcc780x/timer-tcc780x.c index ddd3b1d694..74502ae369 100644 --- a/firmware/target/arm/tcc780x/timer-tcc780x.c +++ b/firmware/target/arm/tcc780x/timer-tcc780x.c @@ -27,7 +27,7 @@ static const int prescale_shifts[] = {1, 2, 3, 4, 5, 10, 12}; -bool __timer_set(long cycles, bool start) +bool timer_set(long cycles, bool start) { bool found = false; @@ -62,7 +62,7 @@ bool __timer_set(long cycles, bool start) return true; } -bool __timer_start(void) +bool timer_start(void) { int oldstatus = disable_interrupt_save(IRQ_STATUS); @@ -73,7 +73,7 @@ bool __timer_start(void) return true; } -void __timer_stop(void) +void timer_stop(void) { int oldstatus = disable_interrupt_save(IRQ_STATUS); diff --git a/firmware/target/arm/timer-pp.c b/firmware/target/arm/timer-pp.c index 01c691f79e..a8879b1824 100644 --- a/firmware/target/arm/timer-pp.c +++ b/firmware/target/arm/timer-pp.c @@ -44,7 +44,7 @@ void TIMER2(void) } } -bool __timer_set(long cycles, bool start) +bool timer_set(long cycles, bool start) { if (cycles > 0x20000000 || cycles < 2) return false; @@ -67,7 +67,7 @@ bool __timer_set(long cycles, bool start) return true; } -bool __timer_start(IF_COP_VOID(int core)) +bool timer_start(IF_COP_VOID(int core)) { /* unmask interrupt source */ #if NUM_CORES > 1 @@ -79,7 +79,7 @@ bool __timer_start(IF_COP_VOID(int core)) return true; } -void __timer_stop(void) +void timer_stop(void) { TIMER2_CFG = 0; /* stop timer 2 */ CPU_INT_DIS = TIMER2_MASK; diff --git a/firmware/target/arm/timer-target.h b/firmware/target/arm/timer-target.h index 7b7fdabdce..65867ab64b 100644 --- a/firmware/target/arm/timer-target.h +++ b/firmware/target/arm/timer-target.h @@ -28,25 +28,7 @@ #error "PP specific header" #endif -bool __timer_set(long cycles, bool start); -bool __timer_start(IF_COP_VOID(int core)); -void __timer_stop(void); - /* Portalplayer chips use a microsecond timer. */ #define TIMER_FREQ 1000000 -#define __TIMER_SET(cycles, set) \ - __timer_set(cycles, set) - -#if NUM_CORES > 1 -#define __TIMER_START(core) \ - __timer_start(core) -#else -#define __TIMER_START() \ - __timer_start() -#endif - -#define __TIMER_STOP(...) \ - __timer_stop() - #endif /* TIMER_TARGET_H */ diff --git a/firmware/target/arm/tms320dm320/timer-dm320.c b/firmware/target/arm/tms320dm320/timer-dm320.c index 9357ffa9de..ef1fac04eb 100644 --- a/firmware/target/arm/tms320dm320/timer-dm320.c +++ b/firmware/target/arm/tms320dm320/timer-dm320.c @@ -34,7 +34,7 @@ void TIMER0(void) pfn_timer(); } -bool __timer_set(long cycles, bool start) +bool timer_set(long cycles, bool start) { int oldlevel; unsigned int divider=cycles, prescaler=0; @@ -82,7 +82,7 @@ static void stop_timer(void) IO_CLK_MOD2 &= ~CLK_MOD2_TMR0; //disable TIMER0 clock } -bool __timer_start(void) +bool timer_start(void) { int oldstatus = disable_interrupt_save(IRQ_FIQ_STATUS); @@ -100,7 +100,7 @@ bool __timer_start(void) return true; } -void __timer_stop(void) +void timer_stop(void) { int oldstatus = disable_interrupt_save(IRQ_FIQ_STATUS); stop_timer(); diff --git a/firmware/target/arm/tms320dm320/timer-target.h b/firmware/target/arm/tms320dm320/timer-target.h index 9f3ffdf712..c1cf9796de 100644 --- a/firmware/target/arm/tms320dm320/timer-target.h +++ b/firmware/target/arm/tms320dm320/timer-target.h @@ -24,17 +24,4 @@ /* timer is based on PCLK and minimum division is 2 */ #define TIMER_FREQ (27000000) -bool __timer_set(long cycles, bool set); -bool __timer_start(void); -void __timer_stop(void); - -#define __TIMER_SET(cycles, set) \ - __timer_set(cycles, set) - -#define __TIMER_START() \ - __timer_start() - -#define __TIMER_STOP(...) \ - __timer_stop() - #endif /* TIMER_TARGET_H */ -- cgit v1.2.3