diff options
| author | fishsoupisgood <github@madingley.org> | 2019-04-29 01:17:54 +0100 | 
|---|---|---|
| committer | fishsoupisgood <github@madingley.org> | 2019-05-27 03:43:43 +0100 | 
| commit | 3f2546b2ef55b661fd8dd69682b38992225e86f6 (patch) | |
| tree | 65ca85f13617aee1dce474596800950f266a456c /roms/u-boot/include/rtc.h | |
| download | qemu-master.tar.gz qemu-master.tar.bz2 qemu-master.zip  | |
Diffstat (limited to 'roms/u-boot/include/rtc.h')
| -rw-r--r-- | roms/u-boot/include/rtc.h | 53 | 
1 files changed, 53 insertions, 0 deletions
diff --git a/roms/u-boot/include/rtc.h b/roms/u-boot/include/rtc.h new file mode 100644 index 00000000..c0349668 --- /dev/null +++ b/roms/u-boot/include/rtc.h @@ -0,0 +1,53 @@ +/* + * (C) Copyright 2001 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + +/* + * Generic RTC interface. + */ +#ifndef _RTC_H_ +#define _RTC_H_ + +/* bcd<->bin functions are needed by almost all the RTC drivers, let's include + * it there instead of in evey single driver */ + +#include <bcd.h> + +/* + * The struct used to pass data from the generic interface code to + * the hardware dependend low-level code ande vice versa. Identical + * to struct rtc_time used by the Linux kernel. + * + * Note that there are small but significant differences to the + * common "struct time": + * + *		struct time:		struct rtc_time: + * tm_mon	0 ... 11		1 ... 12 + * tm_year	years since 1900	years since 0 + */ + +struct rtc_time { +	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; +}; + +int rtc_get (struct rtc_time *); +int rtc_set (struct rtc_time *); +void rtc_reset (void); + +void GregorianDay (struct rtc_time *); +void to_tm (int, struct rtc_time *); +unsigned long mktime (unsigned int, unsigned int, unsigned int, +		      unsigned int, unsigned int, unsigned int); + +#endif	/* _RTC_H_ */  | 
