3#define CURRENT_YEAR 2024
56 last_second = time->
second;
57 last_minute = time->
minute;
58 last_hour = time->
hour;
60 last_month = time->
month;
61 last_year = time->
year;
71 }
while ((last_second != time->
second) || (last_minute != time->
minute) || (last_hour != time->
hour) || (last_day != time->
day) || (last_month != time->
month) ||
72 (last_year != time->
year));
74#define bcd_to_binary(val) (((val) & 0x0F) + ((val) / 16) * 10)
77 if (!(registerB & 0x04))
82 time->
hour = ((time->
hour & 0x0F) + (((time->
hour & 0x70) / 16) * 10)) | (time->
hour & 0x80);
88 if (!(registerB & 0x02) && (time->
hour & 0x80))
91 time->
hour = ((time->
hour & 0x7F) + 12) % 24;
void clocksource_register(clocksource_t *clocksource)
void clocksource_tick(clocksource_t *clocksource)
#define LIST_NODE_INIT(container)
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