diff options
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-08-17 10:45:47 +0100 |
---|---|---|
committer | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-08-22 10:26:05 +0100 |
commit | 27989a8e34a44ff8e6a2e5b011123a09fd8a82c7 (patch) | |
tree | ac823ae747872ad9e3868f94cc0e6f6602dfeb42 /include/lib/libc/time.h | |
parent | 2c5aca6eaab998271ab17792486cf67dd2e67711 (diff) | |
download | platform_external_arm-trusted-firmware-27989a8e34a44ff8e6a2e5b011123a09fd8a82c7.tar.gz platform_external_arm-trusted-firmware-27989a8e34a44ff8e6a2e5b011123a09fd8a82c7.tar.bz2 platform_external_arm-trusted-firmware-27989a8e34a44ff8e6a2e5b011123a09fd8a82c7.zip |
libc: Introduce files from SCC
Taken from http://git.simple-cc.org/scc/ from the following commit:
67508ad14af314cea2229783d3c084f28c41daf0
Permission has been granted from the author to use them under the
license BSD-3-Clause instead of ISC.
Change-Id: I65c0ce3ab60c49d34a57533af12a74bd7bde88e5
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'include/lib/libc/time.h')
-rw-r--r-- | include/lib/libc/time.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/include/lib/libc/time.h b/include/lib/libc/time.h new file mode 100644 index 000000000..846ec21e0 --- /dev/null +++ b/include/lib/libc/time.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2012-2017 Roberto E. Vargas Caballero + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef _TIME_H +#define _TIME_H + +#include <arch/time.h> + +#ifndef NULL +#define NULL ((void *) 0) +#endif + +#define CLOCKS_PER_SEC 1000000 + +typedef long int clock_t; + +struct tm { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; +}; + +extern clock_t clock(void); +extern double difftime(time_t time1, time_t time0); +extern time_t mktime(struct tm *timeptr); +extern time_t time(time_t *timer); +extern char *asctime(const struct tm *timeptr); +extern char *ctime(const time_t *timer); +extern struct tm *gmtime(const time_t *timer); +extern struct tm *localtime(const time_t *timer); +extern size_t strftime(char * restrict s, size_t maxsize, + const char * restrict format, + const struct tm * restrict timeptr); + +#endif |