20#include "pedigree/kernel/LockGuard.h"
21#include "pedigree/kernel/Spinlock.h"
22#include "pedigree/kernel/machine/Machine.h"
23#include "pedigree/kernel/machine/Timer.h"
24#include "pedigree/kernel/process/InfoBlock.h"
25#include "pedigree/kernel/processor/Processor.h"
26#include "pedigree/kernel/time/Time.h"
28#if X64 && MACH_PC && !HOSTED
29#include "machine/mach_pc/Rtc.h"
35bool realtimeSet =
false;
41 return getTimeNanoseconds(sync) / Multiplier::Second;
54 return elapsed >= Infinity - realtimeBase ? Infinity - 1 : realtimeBase + elapsed;
63 if (!timer || value == Infinity) {
77 InfoBlockManager::instance().refreshTime();
83 if (!timer || value == Infinity) {
92 InfoBlockManager::instance().refreshTime();
112CpuTimeSample sampleCpuTime() {
113#if X64 && MACH_PC && !HOSTED
116 return Rtc::instance().Rtc::sampleCpuTime();
virtual Timer * getTimer()=0
virtual uint64_t getTickCountNanoFast()
virtual uint64_t getTickCountNano()
virtual Time::CpuTimeSample sampleCpuTime()
virtual uint64_t getNanosecond()=0
virtual void synchronise(bool tohw=false)
Synchronises the timer with the hardware. Useful for updating the fields returned by get*,...
virtual Time::Timestamp getUnixTimestamp()