3#define CURRENT_YEAR 2024
55 last_second = time->
second;
56 last_minute = time->
minute;
57 last_hour = time->
hour;
59 last_month = time->
month;
60 last_year = time->
year;
70 }
while ((last_second != time->
second) || (last_minute != time->
minute) || (last_hour != time->
hour) || (last_day != time->
day) || (last_month != time->
month) ||
71 (last_year != time->
year));
73#define bcd_to_binary(val) (((val) & 0x0F) + ((val) / 16) * 10)
76 if (!(registerB & 0x04))
81 time->
hour = ((time->
hour & 0x0F) + (((time->
hour & 0x70) / 16) * 10)) | (time->
hour & 0x80);
87 if (!(registerB & 0x02) && (time->
hour & 0x80))
90 time->
hour = ((time->
hour & 0x7F) + 12) % 24;
void clocksource_register(clocksource_t *clocksource)
void clocksource_tick(clocksource_t *clocksource)
should_inline void port_outb(u16 port, u8 value)
should_inline u8 port_inb(u16 port)
static clocksource_t rtc_clocksource
void rtc_read_time(timeval_t *time)
static const u8 RTC_STATUS_REG_B
u8 rtc_is_update_in_progress()
bool rtc_irq_handler(u32 irq, void *data)
static const u8 CMOS_PORT_ADDRESS
u8 rtc_read_reg(x86_port_t reg)
#define bcd_to_binary(val)
static const u8 CMOS_PORT_DATA