aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2018-05-03 18:51:25 +0530
committerStewart Smith <stewart@linux.ibm.com>2018-05-06 10:27:37 -0500
commit3c574d8e718890ef31753a68b38104e0aac5467e (patch)
tree538c3d43ac91bd6b2d36564312bc3c4567564744 /core
parentf033219b73f985506fe985e6c2d43ec954b733e6 (diff)
downloadskiboot-3c574d8e718890ef31753a68b38104e0aac5467e.zip
skiboot-3c574d8e718890ef31753a68b38104e0aac5467e.tar.gz
skiboot-3c574d8e718890ef31753a68b38104e0aac5467e.tar.bz2
timer: Move update_timer_expiry call to separate function
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'core')
-rw-r--r--core/timer.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/core/timer.c b/core/timer.c
index 8eefb74..1c53951 100644
--- a/core/timer.c
+++ b/core/timer.c
@@ -23,6 +23,14 @@ static LIST_HEAD(timer_poll_list);
static bool timer_in_poll;
static uint64_t timer_poll_gen;
+static inline void update_timer_expiry(uint64_t target)
+{
+ if (proc_gen < proc_gen_p9)
+ p8_sbe_update_timer_expiry(target);
+ else
+ p9_sbe_update_timer_expiry(target);
+}
+
void init_timer(struct timer *t, timer_func_t expiry, void *data)
{
t->link.next = t->link.prev = NULL;
@@ -111,10 +119,7 @@ static void __schedule_timer_at(struct timer *t, uint64_t when)
/* Pick up the next timer and upddate the SBE HW timer */
lt = list_top(&timer_list, struct timer, link);
if (lt) {
- if (proc_gen < proc_gen_p9)
- p8_sbe_update_timer_expiry(lt->target);
- else
- p9_sbe_update_timer_expiry(lt->target);
+ update_timer_expiry(lt->target);
}
}
@@ -172,11 +177,7 @@ static void __check_poll_timers(uint64_t now)
* arbitrarily 1us.
*/
if (t->running) {
- if (proc_gen < proc_gen_p9)
- p8_sbe_update_timer_expiry(now + usecs_to_tb(1));
- else
- p9_sbe_update_timer_expiry(now + usecs_to_tb(1));
-
+ update_timer_expiry(now + usecs_to_tb(1));
break;
}