20 #ifndef KERNEL_MACHINE_X86_COMMON_RTC_H 21 #define KERNEL_MACHINE_X86_COMMON_RTC_H 23 #include "pedigree/kernel/Spinlock.h" 24 #include "pedigree/kernel/compiler.h" 25 #include "pedigree/kernel/machine/IrqHandler.h" 26 #include "pedigree/kernel/machine/Timer.h" 27 #include "pedigree/kernel/machine/types.h" 28 #include "pedigree/kernel/processor/IoPort.h" 29 #include "pedigree/kernel/processor/state_forward.h" 30 #include "pedigree/kernel/processor/types.h" 31 #include "pedigree/kernel/utilities/List.h" 32 #include "pedigree/kernel/utilities/new" 36 #define MAX_TIMER_HANDLERS 32 45 inline static Rtc &instance()
56 addAlarm(
class Event *pEvent,
size_t alarmSecs,
size_t alarmUsecs = 0);
99 virtual bool irq(irq_id_t number, InterruptState &state);
115 uint8_t
read(uint8_t index);
119 void write(uint8_t index, uint8_t value);
176 : m_pEvent(pEvent), m_Time(time), m_pThread(pThread)
179 class Event *m_pEvent;
virtual void addAlarm(class Event *pEvent, size_t alarmSecs, size_t alarmUsecs=0)
void write(uint8_t index, uint8_t value)
Rtc & operator=(const Rtc &)
uint64_t m_TscTicksPerNanosecond
void waitForUpdateCompletion(uint8_t index)
virtual uint8_t getHour()
#define INITIALISATION_ONLY
virtual uint8_t getDayOfWeek()
virtual uint64_t getTickCount()
virtual void synchronise(bool tohw=false)
void enableRtcUpdates(bool enable)
bool initialise1() INITIALISATION_ONLY
void setIndex(uint8_t index)
static periodicIrqInfo_t periodicIrqInfo[12]
virtual uint64_t getNanosecond()
virtual uint8_t getMinute()
virtual uint8_t getDayOfMonth()
size_t m_PeriodicIrqInfoIndex
virtual bool irq(irq_id_t number, InterruptState &state)
virtual uint8_t getSecond()
virtual uint8_t getMonth()
TimerHandler * m_Handlers[MAX_TIMER_HANDLERS]
Rtc() INITIALISATION_ONLY
bool initialise2() INITIALISATION_ONLY
virtual void removeAlarm(class Event *pEvent)
uint8_t read(uint8_t index)
virtual uint64_t getTickCountNano()