diff options
author | Thomas Heijligen <src@posteo.de> | 2022-11-29 19:53:31 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-08-24 13:35:02 +0000 |
commit | 303a895d776acc2bf978a7dc6021eaeece897aae (patch) | |
tree | 259ad8929f0c339dc59758effdc695e968aabc2e /payloads/libpayload/include/libpayload.h | |
parent | 711f84d177db1f05054e5524f2492e9881a4eab6 (diff) |
libpayload: Outsource delay function into own header
For libflashrom we need the delay functions but when including the whole
libpayload.h it has conflicting symbols.
Change-Id: I6e4a669b8ba25836fb870d74c200985c1bfdb387
Signed-off-by: Thomas Heijligen <src@posteo.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70139
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'payloads/libpayload/include/libpayload.h')
-rw-r--r-- | payloads/libpayload/include/libpayload.h | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h index 15871181c1..19ba671a5a 100644 --- a/payloads/libpayload/include/libpayload.h +++ b/payloads/libpayload/include/libpayload.h @@ -68,6 +68,7 @@ #include <sysinfo.h> #include <pci.h> #include <archive.h> +#include <delay.h> #define BIT(x) (1ul << (x)) @@ -510,54 +511,12 @@ void lib_sysinfo_get_memranges(struct memrange **ranges, /* Timer functions. */ /* Defined by each architecture. */ -unsigned int get_cpu_speed(void); uint64_t timer_hz(void); uint64_t timer_raw_value(void); uint64_t timer_us(uint64_t base); -void arch_ndelay(uint64_t n); /* Generic. */ /** - * Delay for a specified number of nanoseconds. - * - * @param ns Number of nanoseconds to delay for. - */ -static inline void ndelay(unsigned int ns) -{ - arch_ndelay((uint64_t)ns); -} - -/** - * Delay for a specified number of microseconds. - * - * @param us Number of microseconds to delay for. - */ -static inline void udelay(unsigned int us) -{ - arch_ndelay((uint64_t)us * NSECS_PER_USEC); -} - -/** - * Delay for a specified number of milliseconds. - * - * @param ms Number of milliseconds to delay for. - */ -static inline void mdelay(unsigned int ms) -{ - arch_ndelay((uint64_t)ms * NSECS_PER_MSEC); -} - -/** - * Delay for a specified number of seconds. - * - * @param s Number of seconds to delay for. - */ -static inline void delay(unsigned int s) -{ - arch_ndelay((uint64_t)s * NSECS_PER_SEC); -} - -/** * @defgroup readline Readline functions * This interface provides a simple implementation of the standard readline() * and getline() functions. They read a line of input from the console. |