Stef van Os (stef.van.os@prodrive-technologies.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14437
-gerrit
commit c86439f7fa29a962123757ad850c160971176a31 Author: Stef van Os stef.van.os@prodrive-technologies.com Date: Wed Apr 20 15:22:00 2016 +0200
libpayload: time: split time.h from libpayload.h
Move time functions and prototypes from libpayload.h to time.h. In a similar manner to other c libary headers, this change makes porting existing applications to libpayload easier.
Change-Id: I71e27c6dddde6e77e0e9b4d7be7cd5298e03a648 Signed-off-by: Stef van Os stef.van.os@prodrive-technologies.com --- payloads/libpayload/include/libpayload.h | 15 +--------- payloads/libpayload/include/time.h | 50 ++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 14 deletions(-)
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h index 1b66bf8..b51abdf 100644 --- a/payloads/libpayload/include/libpayload.h +++ b/payloads/libpayload/include/libpayload.h @@ -56,6 +56,7 @@ #include <stdarg.h> #include <stdlib.h> #include <string.h> +#include <time.h> #include <arch/types.h> #include <arch/io.h> #include <arch/virtual.h> @@ -354,20 +355,6 @@ u8 *sha1(const u8 *data, size_t len, u8 *buf); /** @} */
/** - * @defgroup time Time functions - * @{ - */ - -/** System time structure */ -struct timeval { - time_t tv_sec; /**< Seconds */ - suseconds_t tv_usec; /**< Microseconds */ -}; - -int gettimeofday(struct timeval *tv, void *tz); -/** @} */ - -/** * @defgroup info System information functions * This module contains functions that return information about the system * @{ diff --git a/payloads/libpayload/include/time.h b/payloads/libpayload/include/time.h new file mode 100644 index 0000000..25f476c --- /dev/null +++ b/payloads/libpayload/include/time.h @@ -0,0 +1,50 @@ +/* + * This file is part of the libpayload project. + * + * Copyright (C) 2008 Advanced Micro Devices, Inc. + * Copyright (C) 2016 Prodrive Technologies + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _TIME_H +#define _TIME_H + +#include <stddef.h> + +/** + * @defgroup time Time functions + * @{ + */ + +/** System time structure */ +struct timeval { + time_t tv_sec; /**< Seconds */ + suseconds_t tv_usec; /**< Microseconds */ +}; + +int gettimeofday(struct timeval *tv, void *tz); +/** @} */ + +#endif