mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
Remove int_prio argument from timer_register, and move the only use for it into alpine_cdc plugin, since this plugin is only built on SH7034
Also remove it from TIMER_START() git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21558 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b955dff268
commit
89ccd5c145
25 changed files with 42 additions and 68 deletions
|
|
@ -332,7 +332,7 @@ static void backlight_dim(int value)
|
|||
if (bl_timer_active)
|
||||
return ;
|
||||
|
||||
if (timer_register(0, backlight_release_timer, 2, 0, backlight_isr
|
||||
if (timer_register(0, backlight_release_timer, 2, backlight_isr
|
||||
IF_COP(, CPU)))
|
||||
{
|
||||
#ifdef _BACKLIGHT_FADE_BOOST
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
#define TIMER_FREQ CPU_FREQ
|
||||
#endif
|
||||
bool timer_register(int reg_prio, void (*unregister_callback)(void),
|
||||
long cycles, int int_prio, void (*timer_callback)(void)
|
||||
long cycles, void (*timer_callback)(void)
|
||||
IF_COP(,int core));
|
||||
bool timer_set_period(long cycles);
|
||||
#ifdef CPU_COLDFIRE
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ void profile_thread_started(int current_thread) {
|
|||
if (profiling < PROF_ERROR) {
|
||||
/* After we de-mask, if profiling is active, reactivate the timer */
|
||||
timer_register(0, profile_timer_unregister,
|
||||
TIMER_FREQ/10000, 0, profile_timer_tick IF_COP(, 0 ) );
|
||||
TIMER_FREQ/10000, profile_timer_tick IF_COP(, 0 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -169,7 +169,7 @@ void profstart(int current_thread) {
|
|||
pfds[0].self_pc = 0;
|
||||
memset(indices,0,INDEX_SIZE * sizeof(unsigned short));
|
||||
timer_register(
|
||||
0, profile_timer_unregister, TIMER_FREQ/10000, 0, profile_timer_tick IF_COP(, 0 ) );
|
||||
0, profile_timer_unregister, TIMER_FREQ/10000, profile_timer_tick IF_COP(, 0 ) );
|
||||
profiling = PROF_ON;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ void __timer_stop(void);
|
|||
#define __TIMER_SET(cycles, set) \
|
||||
__timer_set(cycles, set)
|
||||
|
||||
#define __TIMER_START(int_prio) \
|
||||
#define __TIMER_START() \
|
||||
__timer_start()
|
||||
|
||||
#define __TIMER_STOP(...) \
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ void __timer_stop(void);
|
|||
#define __TIMER_SET(cycles, set) \
|
||||
__timer_set(cycles, set)
|
||||
|
||||
#define __TIMER_START(int_prio) \
|
||||
#define __TIMER_START() \
|
||||
__timer_start()
|
||||
|
||||
#define __TIMER_STOP(...) \
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ void _timer_stop(void);
|
|||
#define __TIMER_SET(cycles, set) \
|
||||
_timer_set(cycles, set)
|
||||
|
||||
#define __TIMER_START(int_prio) \
|
||||
#define __TIMER_START() \
|
||||
_timer_start()
|
||||
|
||||
#define __TIMER_STOP(...) \
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ void __timer_stop(void);
|
|||
#define __TIMER_SET(cycles, set) \
|
||||
__timer_set(cycles, set)
|
||||
|
||||
#define __TIMER_START(int_prio) \
|
||||
#define __TIMER_START() \
|
||||
__timer_start()
|
||||
|
||||
#define __TIMER_STOP(...) \
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ void __timer_stop(void);
|
|||
#define __TIMER_SET(cycles, set) \
|
||||
__timer_set(cycles, set)
|
||||
|
||||
#define __TIMER_START(int_prio) \
|
||||
#define __TIMER_START() \
|
||||
__timer_start()
|
||||
|
||||
#define __TIMER_STOP(...) \
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ void __timer_stop(void);
|
|||
#define __TIMER_SET(cycles, set) \
|
||||
__timer_set(cycles, set)
|
||||
|
||||
#define __TIMER_START(int_prio) \
|
||||
#define __TIMER_START() \
|
||||
__timer_start()
|
||||
|
||||
#define __TIMER_STOP(...) \
|
||||
|
|
|
|||
|
|
@ -39,10 +39,10 @@ void __timer_stop(void);
|
|||
__timer_set(cycles, set)
|
||||
|
||||
#if NUM_CORES > 1
|
||||
#define __TIMER_START(int_prio, core) \
|
||||
#define __TIMER_START(core) \
|
||||
__timer_start(core)
|
||||
#else
|
||||
#define __TIMER_START(int_prio) \
|
||||
#define __TIMER_START() \
|
||||
__timer_start()
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ void __timer_stop(void);
|
|||
#define __TIMER_SET(cycles, set) \
|
||||
__timer_set(cycles, set)
|
||||
|
||||
#define __TIMER_START(int_prio) \
|
||||
#define __TIMER_START() \
|
||||
__timer_start()
|
||||
|
||||
#define __TIMER_STOP(...) \
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ void __timer_stop(void);
|
|||
#define __TIMER_SET(cycles, set) \
|
||||
__timer_set(cycles, set)
|
||||
|
||||
#define __TIMER_START(int_prio) \
|
||||
#define __TIMER_START() \
|
||||
__timer_start()
|
||||
|
||||
#define __TIMER_STOP(...) \
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ void __timer_stop(void);
|
|||
#define __TIMER_SET(cycles, set) \
|
||||
__timer_set(cycles, set)
|
||||
|
||||
#define __TIMER_START(int_prio) \
|
||||
#define __TIMER_START() \
|
||||
__timer_start()
|
||||
|
||||
#define __TIMER_STOP(...) \
|
||||
|
|
|
|||
|
|
@ -71,9 +71,9 @@ bool __timer_set(long cycles, bool start)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool __timer_start(int int_prio)
|
||||
bool __timer_start(void)
|
||||
{
|
||||
IPRD = (IPRD & 0xFF0F) | int_prio << 4; /* interrupt priority */
|
||||
IPRD = (IPRD & 0xFF0F) | 1 << 4; /* interrupt priority */
|
||||
or_b(0x10, &TSTR); /* start timer 4 */
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include "config.h"
|
||||
|
||||
bool __timer_set(long cycles, bool start);
|
||||
bool __timer_start(int int_prio);
|
||||
bool __timer_start(void);
|
||||
void __timer_stop(void);
|
||||
|
||||
#define TIMER_FREQ CPU_FREQ
|
||||
|
|
@ -32,8 +32,8 @@ void __timer_stop(void);
|
|||
#define __TIMER_SET(cycles, set) \
|
||||
__timer_set(cycles, set)
|
||||
|
||||
#define __TIMER_START(int_prio) \
|
||||
__timer_start(int_prio)
|
||||
#define __TIMER_START() \
|
||||
__timer_start()
|
||||
|
||||
#define __TIMER_STOP(...) \
|
||||
__timer_stop()
|
||||
|
|
|
|||
|
|
@ -30,18 +30,6 @@ static int timer_prio = -1;
|
|||
void SHAREDBSS_ATTR (*pfn_timer)(void) = NULL; /* timer callback */
|
||||
void SHAREDBSS_ATTR (*pfn_unregister)(void) = NULL; /* unregister callback */
|
||||
|
||||
#ifndef __TIMER_SET
|
||||
/* Define these if not defined by target to make the #else cases compile
|
||||
* even if the target doesn't have them implemented. */
|
||||
#define __TIMER_SET(cycles, set) false
|
||||
#if NUM_CORES > 1
|
||||
#define __TIMER_START(int_prio, core) false
|
||||
#else
|
||||
#define __TIMER_START(int_prio) false
|
||||
#endif
|
||||
#define __TIMER_STOP()
|
||||
#endif
|
||||
|
||||
static bool timer_set(long cycles, bool start)
|
||||
{
|
||||
return __TIMER_SET(cycles, start);
|
||||
|
|
@ -49,17 +37,12 @@ static bool timer_set(long cycles, bool start)
|
|||
|
||||
/* Register a user timer, called every <cycles> TIMER_FREQ cycles */
|
||||
bool timer_register(int reg_prio, void (*unregister_callback)(void),
|
||||
long cycles, int int_prio, void (*timer_callback)(void)
|
||||
long cycles, void (*timer_callback)(void)
|
||||
IF_COP(, int core))
|
||||
{
|
||||
if (reg_prio <= timer_prio || cycles == 0)
|
||||
return false;
|
||||
|
||||
#if CONFIG_CPU == SH7034
|
||||
if (int_prio < 1 || int_prio > 15)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (!timer_set(cycles, true))
|
||||
return false;
|
||||
|
||||
|
|
@ -68,18 +51,10 @@ bool timer_register(int reg_prio, void (*unregister_callback)(void),
|
|||
timer_prio = reg_prio;
|
||||
|
||||
#if NUM_CORES > 1
|
||||
return __TIMER_START(int_prio, core);
|
||||
return __TIMER_START(core);
|
||||
#else
|
||||
return __TIMER_START(int_prio);
|
||||
return __TIMER_START();
|
||||
#endif
|
||||
|
||||
/* Cover for targets that don't use all these */
|
||||
(void)reg_prio;
|
||||
(void)unregister_callback;
|
||||
(void)cycles;
|
||||
/* TODO: Implement for PortalPlayer and iFP (if possible) */
|
||||
(void)int_prio;
|
||||
(void)timer_callback;
|
||||
}
|
||||
|
||||
bool timer_set_period(long cycles)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue