diff options
author | 2015-08-28 09:58:54 +0800 | |
---|---|---|
committer | 2015-09-01 12:44:00 +0800 | |
commit | e44e3482bdb4d0ebde2d8b41830ac2cdb07948fb (patch) | |
tree | 66b09f592c55df2878107a468a91d21506104d3f /qemu/roms/ipxe/src/include/time.h | |
parent | 9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 (diff) |
Add qemu 2.4.0
Change-Id: Ic99cbad4b61f8b127b7dc74d04576c0bcbaaf4f5
Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Diffstat (limited to 'qemu/roms/ipxe/src/include/time.h')
-rw-r--r-- | qemu/roms/ipxe/src/include/time.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/qemu/roms/ipxe/src/include/time.h b/qemu/roms/ipxe/src/include/time.h new file mode 100644 index 000000000..452a544bb --- /dev/null +++ b/qemu/roms/ipxe/src/include/time.h @@ -0,0 +1,53 @@ +#ifndef _TIME_H +#define _TIME_H + +/** @file + * + * Date and time + */ + +FILE_LICENCE ( GPL2_OR_LATER ); + +#include <sys/time.h> +#include <ipxe/time.h> + +/** Broken-down time */ +struct tm { + /** Seconds [0,60] */ + int tm_sec; + /** Minutes [0,59] */ + int tm_min; + /** Hour [0,23] */ + int tm_hour; + /** Day of month [1,31] */ + int tm_mday; + /** Month of year [0,11] */ + int tm_mon; + /** Years since 1900 */ + int tm_year; + /** Day of week [0,6] (Sunday=0) */ + int tm_wday; + /** Day of year [0,365] */ + int tm_yday; + /** Daylight savings flag */ + int tm_isdst; +}; + +/** + * Get current time in seconds since the Epoch + * + * @v t Time to fill in, or NULL + * @ret time Current time + */ +static inline time_t time ( time_t *t ) { + time_t now; + + now = time_now(); + if ( t ) + *t = now; + return now; +} + +extern time_t mktime ( struct tm *tm ); + +#endif /* _TIME_H */ |