Kernel: Move RTC to Timer directory

PIT ms counter seems to be off by multiple seconds/minute. I will
be probably changing to HPET for system time
This commit is contained in:
Bananymous
2023-08-04 11:12:16 +03:00
parent 659adb89a6
commit 7eb2c140fe
12 changed files with 77 additions and 54 deletions

View File

@@ -1,10 +0,0 @@
#pragma once
#include <BAN/Time.h>
namespace RTC
{
BAN::Time get_current_time();
}

View File

@@ -0,0 +1,19 @@
#pragma once
#include <BAN/Time.h>
namespace Kernel
{
class RTC
{
public:
BAN::Time get_current_time();
private:
bool is_update_in_progress();
uint8_t read_register8(uint8_t reg);
void get_time(BAN::Time& out);
};
}

View File

@@ -2,6 +2,7 @@
#include <BAN/UniqPtr.h>
#include <BAN/Vector.h>
#include <kernel/Timer/RTC.h>
namespace Kernel
{
@@ -24,12 +25,16 @@ namespace Kernel
uint64_t ms_since_boot() const;
void sleep(uint64_t) const;
uint64_t get_unix_timestamp();
private:
TimerHandler() = default;
void initialize_timers();
private:
uint64_t m_boot_time { 0 };
BAN::UniqPtr<RTC> m_rtc;
BAN::Vector<BAN::UniqPtr<Timer>> m_timers;
};