6#include <sys/kassert.h>
12#define RTC_SECONDS 0x00
13#define RTC_MINUTES 0x02
15#define RTC_WEEKDAY 0x06
28 kprintf(
"RTC: Measuring CPU clock...\n");
48 kprintf(
"RTC: %lld Ticks Per Second: %lld\n", second, stopTSC - startTSC);
80 if ((flags & 0x04) == 0) {
81#define BCD_TO_BIN(_B) ((_B & 0x0F) + ((_B >> 4) * 10))
90 if (((flags & 0x02) == 0) && isPM) {
91 tm.hour = (
tm.hour + 12) % 24;
static INLINE uint8_t inb(uint16_t port)
static INLINE void outb(uint16_t port, uint8_t data)
int kprintf(const char *fmt,...)
void KTime_SetTime(UnixEpoch epoch, uint64_t tsc, uint64_t tps)
UnixEpoch KTime_ToEpoch(const KTime *tm)
static uint8_t RTC_ReadReg(uint8_t reg)