Kernel: Make PIT counter atomic with spinlock

This commit is contained in:
2024-07-21 18:56:41 +03:00
parent e00efca170
commit 8fe798de6d
2 changed files with 17 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
#pragma once
#include <kernel/Interruptable.h>
#include <kernel/Lock/SpinLock.h>
#include <kernel/Timer/Timer.h>
namespace Kernel
@@ -19,9 +20,11 @@ namespace Kernel
private:
void initialize();
uint64_t read_counter() const;
private:
volatile uint64_t m_system_time { 0 };
mutable SpinLock m_lock;
uint64_t m_system_time { 0 };
};
}