summaryrefslogtreecommitdiffstats
path: root/src/target
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-01-29 09:41:45 +0100
committerHarald Welte <laforge@gnumonks.org>2012-01-29 09:41:45 +0100
commit0eecdf24f3da797e3c6342e60b28f7dfcd467976 (patch)
tree704e339eb29673a49d282bcce7c2f5053e9e330d /src/target
parent40fc52108899de210ed233d4014037c952453ecd (diff)
timers: comply with timer rename in libosmocore
libosmocore has prefixed the timer functions with omso_* already in May 2011 (0b21c1c8850d7f33f55d9399d14055a7cdda3614), and we follow suit here for API consistency reasons.
Diffstat (limited to 'src/target')
-rw-r--r--src/target/firmware/apps/compal_dsp_dump/main.c2
-rw-r--r--src/target/firmware/apps/hello_world/main.c2
-rw-r--r--src/target/firmware/apps/layer1/main.c2
-rw-r--r--src/target/firmware/comm/timer.c22
-rw-r--r--src/target/firmware/include/comm/timer.h21
5 files changed, 24 insertions, 25 deletions
diff --git a/src/target/firmware/apps/compal_dsp_dump/main.c b/src/target/firmware/apps/compal_dsp_dump/main.c
index c823d0ae..8debae73 100644
--- a/src/target/firmware/apps/compal_dsp_dump/main.c
+++ b/src/target/firmware/apps/compal_dsp_dump/main.c
@@ -56,7 +56,7 @@ int main(void)
dsp_dump();
while (1) {
- update_timers();
+ osmo_timers_update();
}
}
diff --git a/src/target/firmware/apps/hello_world/main.c b/src/target/firmware/apps/hello_world/main.c
index 5e3ed85e..56fae2fe 100644
--- a/src/target/firmware/apps/hello_world/main.c
+++ b/src/target/firmware/apps/hello_world/main.c
@@ -106,7 +106,7 @@ int main(void)
/* beyond this point we only react to interrupts */
puts("entering interrupt loop\n");
while (1) {
- update_timers();
+ osmo_timers_update();
}
twl3025_power_off();
diff --git a/src/target/firmware/apps/layer1/main.c b/src/target/firmware/apps/layer1/main.c
index 0abfc063..c2e882e8 100644
--- a/src/target/firmware/apps/layer1/main.c
+++ b/src/target/firmware/apps/layer1/main.c
@@ -93,7 +93,7 @@ int main(void)
while (1) {
l1a_compl_execute();
- update_timers();
+ osmo_timers_update();
sim_handler();
l1a_l23_handler();
}
diff --git a/src/target/firmware/comm/timer.c b/src/target/firmware/comm/timer.c
index 6a649ae9..b2026b94 100644
--- a/src/target/firmware/comm/timer.c
+++ b/src/target/firmware/comm/timer.c
@@ -41,14 +41,14 @@ unsigned long volatile jiffies;
((long)(b) - (long)(a) < 0))
#define time_before(a,b) time_after(b,a)
-void add_timer(struct osmo_timer_list *timer)
+void osmo_timer_add(struct osmo_timer_list *timer)
{
struct osmo_timer_list *list_timer;
/* TODO: Optimize and remember the closest item... */
timer->active = 1;
- /* this might be called from within update_timers */
+ /* this might be called from within osmo_timers_update */
llist_for_each_entry(list_timer, &timer_list, entry)
if (timer == list_timer)
return;
@@ -57,13 +57,13 @@ void add_timer(struct osmo_timer_list *timer)
llist_add(&timer->entry, &timer_list);
}
-void schedule_timer(struct osmo_timer_list *timer, int milliseconds)
+void osmo_timer_schedule(struct osmo_timer_list *timer, int milliseconds)
{
timer->expires = jiffies + ((milliseconds * TIMER_HZ) / 1000);
- add_timer(timer);
+ osmo_timer_add(timer);
}
-void del_timer(struct osmo_timer_list *timer)
+void osmo_timer_del(struct osmo_timer_list *timer)
{
if (timer->in_list) {
timer->active = 0;
@@ -72,7 +72,7 @@ void del_timer(struct osmo_timer_list *timer)
}
}
-int timer_pending(struct osmo_timer_list *timer)
+int osmo_timer_pending(struct osmo_timer_list *timer)
{
return timer->active;
}
@@ -131,7 +131,7 @@ void prepare_timers()
/*
* fire all timers... and remove them
*/
-int update_timers(void)
+int osmo_timers_update(void)
{
struct osmo_timer_list *timer, *tmp;
int work = 0;
@@ -139,7 +139,7 @@ int update_timers(void)
/*
* The callbacks might mess with our list and in this case
* even llist_for_each_entry_safe is not safe to use. To allow
- * del_timer, add_timer, schedule_timer to be called from within
+ * osmo_timer_del, osmo_timer_add, osmo_timer_schedule to be called from within
* the callback we jump through some loops.
*
* First we set the handled flag of each active timer to zero,
@@ -149,7 +149,7 @@ int update_timers(void)
* is dispatched we will remove the non-active from the list.
*
* TODO: If this is a performance issue we can poison a global
- * variable in add_timer and del_timer and only then restart.
+ * variable in osmo_timer_add and osmo_timer_del and only then restart.
*/
llist_for_each_entry(timer, &timer_list, entry) {
timer->handled = 0;
@@ -169,14 +169,14 @@ restart:
llist_for_each_entry_safe(timer, tmp, &timer_list, entry) {
timer->handled = 0;
if (!timer->active) {
- del_timer(timer);
+ osmo_timer_del(timer);
}
}
return work;
}
-int timer_check(void)
+int osmo_timers_check(void)
{
struct osmo_timer_list *timer;
int i = 0;
diff --git a/src/target/firmware/include/comm/timer.h b/src/target/firmware/include/comm/timer.h
index db7d1a55..877d47b5 100644
--- a/src/target/firmware/include/comm/timer.h
+++ b/src/target/firmware/include/comm/timer.h
@@ -28,16 +28,16 @@
/**
* Timer management:
* - Create a struct osmo_timer_list
- * - Fill out timeout and use add_timer or
- * use schedule_timer to schedule a timer in
+ * - Fill out timeout and use osmo_timer_add or
+ * use osmo_timer_schedule to schedule a timer in
* x seconds and microseconds from now...
- * - Use del_timer to remove the timer
+ * - Use osmo_timer_del to remove the timer
*
* Internally:
* - We hook into select.c to give a timeval of the
* nearest timer. On already passed timers we give
* it a 0 to immediately fire after the select
- * - update_timers will call the callbacks and remove
+ * - osmo_timers_update will call the callbacks and remove
* the timers.
*
*/
@@ -58,18 +58,17 @@ extern unsigned long volatile jiffies;
/**
* timer management
*/
-void add_timer(struct osmo_timer_list *timer);
-void schedule_timer(struct osmo_timer_list *timer, int miliseconds);
-void del_timer(struct osmo_timer_list *timer);
-int timer_pending(struct osmo_timer_list *timer);
+void osmo_timer_add(struct osmo_timer_list *timer);
+void osmo_timer_schedule(struct osmo_timer_list *timer, int miliseconds);
+void osmo_timer_del(struct osmo_timer_list *timer);
+int osmo_timer_pending(struct osmo_timer_list *timer);
/**
* internal timer list management
*/
-void prepare_timers(void);
-int update_timers(void);
-int timer_check(void);
+int osmo_timers_update(void);
+int osmo_timers_check(void);
void timer_init(void);