diff options
author | Gabe Black <gabeblack@google.com> | 2013-02-22 16:38:53 -0800 |
---|---|---|
committer | Ronald G. Minnich <rminnich@gmail.com> | 2013-03-14 04:53:33 +0100 |
commit | 5c0b7abe786d7b4370ed1dd7ef323a3091d9620c (patch) | |
tree | cbd054ae9d0b25a024bead99d1c61bf287563b0e /payloads/libpayload/include/libpayload.h | |
parent | 6a0b3611c5b057907aabe2a1c05302440da9bc19 (diff) | |
download | coreboot-5c0b7abe786d7b4370ed1dd7ef323a3091d9620c.tar.xz |
libpayload: Generalize and redistribute timekeeping code
The timekeeping code in libpayload was dependent on rdtsc, and when it was
split up by arch, that code was duplicated even though it was mostly the same.
This change factors out actually reading the count from the timer and the
speed of the timer and puts the definitions of ndelay, udelay, mdelay and
delay into generic code. Then, in x86, the timer_hz and timer_get_raw_value
functions which used to be in depthcharge were moved over to libpayload's
arch/x86/timer.c. In ARM where there isn't a single, canonical timer, those
functions are omitted with the intention that they'll be implemented by a
specific timer driver chosen elsewhere.
Change-Id: I9c919bed712ace941f417c1d58679d667b2d8269
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://review.coreboot.org/2717
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'payloads/libpayload/include/libpayload.h')
-rw-r--r-- | payloads/libpayload/include/libpayload.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h index eaa0d0deeb..f23fb8763b 100644 --- a/payloads/libpayload/include/libpayload.h +++ b/payloads/libpayload/include/libpayload.h @@ -407,8 +407,12 @@ int get_multiboot_info(struct sysinfo_t *info); int lib_get_sysinfo(void); -/* Timer functions - defined by each architecture. */ +/* Timer functions. */ +/* Defined by each architecture. */ unsigned int get_cpu_speed(void); +uint64_t timer_hz(void); +uint64_t timer_raw_value(void); +/* Generic. */ void ndelay(unsigned int n); void udelay(unsigned int n); void mdelay(unsigned int n); |