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 );
CMOS Real-Time Clock (RTC)
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int tm_min
Minutes [0,59].
#define RTC_STATUS_B_BINARY
RTC binary mode bit.
#define RTC_STATUS_A
RTC status register A.
uint64_t address
Base address.
#define RTC_STATUS_B_24_HOUR
RTC 24 hour format bit.
int tm_mday
Day of month [1,31].
#define RTC_MDAY
RTC day of month.
#define RTC_HOUR
RTC hours.
int tm_year
Years since 1900.
static int rtc_is_busy(void)
Check if RTC update is in progress.
static time_t rtc_read_time(void)
Read RTC time.
#define RTC_STATUS_B
RTC status register B.
static unsigned int rtc_readb_bcd(int address)
Read RTC BCD register.
#define RTC_STATUS_A_UPDATE_IN_PROGRESS
RTC update in progress bit.
time_t time_now(void)
Get current time in seconds (ignoring system clock offset)
#define CMOS_DATA
CMOS/RTC data register.
int tm_mon
Month of year [0,11].
static unsigned int rtc_readb(int address)
Read RTC register.
#define RTC_YEAR
RTC year.
time_t mktime(struct tm *tm)
Calculate seconds since the Epoch.
PROVIDE_TIME(rtc, time_now, rtc_now)
uint8_t inb(volatile uint8_t *io_addr)
Read byte from I/O-mapped device.
#define RTC_SEC
RTC seconds.
#define outb(data, io_addr)
int tm_sec
Seconds [0,60].
#define CMOS_ADDRESS
CMOS/RTC address (and NMI) register.
int64_t time_t
Seconds since the Epoch.
static time_t rtc_now(void)
Get current time in seconds.
#define RTC_MON
RTC month.
#define RTC_MIN
RTC minutes.