From 32fae56cdd5507107140bcd867204899c03403f2 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 15 Nov 2017 21:09:50 +0000 Subject: [PATCH] rtc: Headers for RTC in kernel and user --- Kernel/include/rtc.h | 17 +++++++++++++++++ Library/include/sys/rtc.h | 20 ++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 Kernel/include/rtc.h create mode 100644 Library/include/sys/rtc.h diff --git a/Kernel/include/rtc.h b/Kernel/include/rtc.h new file mode 100644 index 00000000..ca16a897 --- /dev/null +++ b/Kernel/include/rtc.h @@ -0,0 +1,17 @@ + +struct cmos_rtc +{ + uint8_t type; + union { + uint8_t bytes[8]; + time_t clock; + } data; +}; + +#define CMOS_RTC_BCD 0 +/* BCD encodded YYYY MM DD HH MM SS */ +#define CMOS_RTC_DEC 1 +/* Byte encoded the same. Year is 2 bytes little endian */ +#define CMOS_RTC_TIME 2 +/* Unix time format */ + diff --git a/Library/include/sys/rtc.h b/Library/include/sys/rtc.h new file mode 100644 index 00000000..3f65e7bf --- /dev/null +++ b/Library/include/sys/rtc.h @@ -0,0 +1,20 @@ +#ifndef _SYS_RTC_H +#define _SYS_RTC_H + +struct cmos_rtc +{ + uint8_t type; + union { + uint8_t bytes[8]; + time_t clock; + } data; +}; + +#define CMOS_RTC_BCD 0 +/* BCD encodded YYYY MM DD HH MM SS */ +#define CMOS_RTC_DEC 1 +/* Byte encoded the same. Year is 2 bytes little endian */ +#define CMOS_RTC_TIME 2 +/* Unix time format */ + +#endif -- 2.34.1