summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2014-09-24 09:56:18 -0500
committerPatrick Georgi <pgeorgi@google.com>2015-03-26 08:53:53 +0100
commita7a3917d4839dbb4e2bbc9d452a75fd974e1ac35 (patch)
tree2bf961e9a20708e3df98f6bd9b1181f79081550f /src/include
parenta32a9d1c48c6863bc219d95497323155e8874c2b (diff)
downloadcoreboot-a7a3917d4839dbb4e2bbc9d452a75fd974e1ac35.tar.xz
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 <pgeorgi@chromium.org> Original-Commit-Id: 26a13d4c615473407f401af4330199bbfe0dd2b1 Original-Change-Id: I487ea81ffb586110e9a1c3c2629d4af749482177 Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/219714 Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: http://review.coreboot.org/8896 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/timer.h57
1 files changed, 2 insertions, 55 deletions
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 {