67 return ( bcd - ( 6 * ( bcd >> 4 ) ) );
76 unsigned int status_b;
79 unsigned int ( * read_component ) (
int address );
99 is_pm = ( hour >= 80 );
100 hour = ( ( ( ( hour & 0x7f ) % 80 ) % 12 ) +
101 ( is_pm ? 12 : 0 ) );
113 ( is_binary ?
"binary" :
"BCD" ), ( is_24hour ? 24 : 12 ) );
137 }
while ( time != last_time );
uint64_t address
Base address.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define outb(data, io_addr)
#define PROVIDE_TIME(_subsys, _api_func, _func)
Provide a time API implementation.
time_t time_now(void)
Get current time in seconds (ignoring system clock offset)
int64_t time_t
Seconds since the Epoch.
CMOS Real-Time Clock (RTC)
#define RTC_STATUS_B_BINARY
RTC binary mode bit.
#define RTC_YEAR
RTC year.
#define RTC_SEC
RTC seconds.
#define RTC_MIN
RTC minutes.
#define RTC_MON
RTC month.
#define CMOS_DATA
CMOS/RTC data register.
#define RTC_HOUR
RTC hours.
#define RTC_STATUS_B
RTC status register B.
#define RTC_STATUS_B_24_HOUR
RTC 24 hour format bit.
#define CMOS_ADDRESS
CMOS/RTC address (and NMI) register.
#define RTC_MDAY
RTC day of month.
#define RTC_STATUS_A
RTC status register A.
#define RTC_STATUS_A_UPDATE_IN_PROGRESS
RTC update in progress bit.
static unsigned int rtc_readb(int address)
Read RTC register.
static time_t rtc_now(void)
Get current time in seconds.
static int rtc_is_busy(void)
Check if RTC update is in progress.
static unsigned int rtc_readb_bcd(int address)
Read RTC BCD register.
static time_t rtc_read_time(void)
Read RTC time.
int tm_mon
Month of year [0,11].
int tm_year
Years since 1900.
int tm_sec
Seconds [0,60].
int tm_mday
Day of month [1,31].
int tm_min
Minutes [0,59].
time_t mktime(struct tm *tm)
Calculate seconds since the Epoch.