Expand description
CMOS Real-Time Clock (RTC) reader for x86_64.
Reads date/time from the MC146818-compatible CMOS RTC via I/O ports 0x70 (index) and 0x71 (data). Converts BCD-encoded values to binary and provides a Unix-epoch-relative timestamp for the panel clock.
Structs§
Constants§
- RTC_
AIE_ OFF - Ioctl command: disable alarm interrupt.
- RTC_
AIE_ ON - Ioctl command: enable alarm interrupt.
- RTC_
ALM_ SET - Ioctl command: set alarm time.
Functions§
- current_
epoch_ secs - Get current wall-clock seconds since Unix epoch.
- disable_
alarm - Disable the CMOS alarm interrupt.
- get_
time_ correction - Get the current NTP correction in milliseconds.
- get_
timezone_ offset - Get the current timezone offset in seconds.
- init
- Read the CMOS RTC and initialize the boot epoch.
- read_
rtc - Read the RTC registers, handling BCD conversion and update-in-progress.
- rtc_
interrupt_ handler - RTC interrupt handler (IRQ 8, vector 40 on PIC / remapped on APIC).
- rtc_
ioctl - Perform an RTC ioctl operation.
- rtc_
read - Read the current RTC time (/dev/rtc read interface).
- set_
alarm - Set the CMOS alarm to fire at the given hour:minute:second.
- set_
alarm_ callback - Register a callback function pointer to invoke when the alarm fires.
- set_
time_ correction - Apply a time correction from an NTP client.
- set_
timezone_ offset - Set the timezone offset from UTC in seconds.