From a7a3917d4839dbb4e2bbc9d452a75fd974e1ac35 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 24 Sep 2014 09:56:18 -0500 Subject: timer: remove rela_time type Current usage doesn't require rela_time. Remove it. BUG=None BRANCH=None TEST=Built and booted. Change-Id: I25dcc1912f5db903a0523428ed1c0307db088eaa Signed-off-by: Patrick Georgi Original-Commit-Id: 26a13d4c615473407f401af4330199bbfe0dd2b1 Original-Change-Id: I487ea81ffb586110e9a1c3c2629d4af749482177 Original-Signed-off-by: Aaron Durbin Original-Reviewed-on: https://chromium-review.googlesource.com/219714 Original-Reviewed-by: Furquan Shaikh Reviewed-on: http://review.coreboot.org/8896 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/include/timer.h | 57 ++--------------------------------------------------- 1 file changed, 2 insertions(+), 55 deletions(-) (limited to 'src/include') diff --git a/src/include/timer.h b/src/include/timer.h index b034da2306..243edb933c 100644 --- a/src/include/timer.h +++ b/src/include/timer.h @@ -34,10 +34,6 @@ struct mono_time { long microseconds; }; -struct rela_time { - long microseconds; -}; - /* A timeout_callback structure is used for the book keeping for scheduling * work in the future. When a callback is called the structure can be * re-used for scheduling as it is not being tracked by the core timer @@ -91,12 +87,6 @@ static inline void mono_time_add_msecs(struct mono_time *mt, long ms) mono_time_add_usecs(mt, ms * USECS_PER_MSEC); } -static inline void mono_time_add_rela_time(struct mono_time *mt, - const struct rela_time *t) -{ - mono_time_add_usecs(mt, t->microseconds); -} - /* Compare two absolute times: Return -1, 0, or 1 if t1 is <, =, or > t2, * respectively. */ static inline int mono_time_cmp(const struct mono_time *t1, @@ -111,33 +101,6 @@ static inline int mono_time_cmp(const struct mono_time *t1, return 1; } -static inline int rela_time_cmp(const struct rela_time *t1, - const struct rela_time *t2) -{ - if (t1->microseconds == t2->microseconds) - return 0; - - if (t1->microseconds < t2->microseconds) - return -1; - - return 1; -} - -/* Initialize a rela_time structure. */ -static inline struct rela_time rela_time_init_usecs(long us) -{ - struct rela_time t; - t.microseconds = us; - return t; -} - -/* Return time difference between t1 and t2. i.e. t2 - t1. */ -static struct rela_time mono_time_diff(const struct mono_time *t1, - const struct mono_time *t2) -{ - return rela_time_init_usecs(t2->microseconds - t1->microseconds); -} - /* Return true if t1 after t2 */ static inline int mono_time_after(const struct mono_time *t1, const struct mono_time *t2) @@ -152,27 +115,11 @@ static inline int mono_time_before(const struct mono_time *t1, return mono_time_cmp(t1, t2) < 0; } -/* Return the difference between now and t. */ -static inline struct rela_time current_time_from(const struct mono_time *t) -{ - struct mono_time now; - - timer_monotonic_get(&now); - return mono_time_diff(t, &now); - -} - -static inline long rela_time_in_microseconds(const struct rela_time *rt) -{ - return rt->microseconds; -} - +/* Return time difference between t1 and t2. i.e. t2 - t1. */ static inline long mono_time_diff_microseconds(const struct mono_time *t1, const struct mono_time *t2) { - struct rela_time rt; - rt = mono_time_diff(t1, t2); - return rela_time_in_microseconds(&rt); + return t2->microseconds - t1->microseconds; } struct stopwatch { -- cgit v1.2.3