1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:17:45 +00:00

Kernel: Make PhysicalRegion.cpp compile on aarch64

This commit is contained in:
James Mintram 2022-04-02 23:47:47 +01:00 committed by Brian Gianforcaro
parent 0d7eee625f
commit 783a44b18e
3 changed files with 9 additions and 1 deletions

View file

@ -63,6 +63,8 @@ public:
return 0;
}
ALWAYS_INLINE static u64 read_cpu_counter() { return 0; }
ALWAYS_INLINE static void enter_critical() { }
ALWAYS_INLINE static void leave_critical() { }
ALWAYS_INLINE static u32 in_critical()

View file

@ -158,6 +158,11 @@ public:
return *g_total_processors.ptr();
}
ALWAYS_INLINE static u64 read_cpu_counter()
{
return read_tsc();
}
ALWAYS_INLINE static void pause()
{
asm volatile("pause");

View file

@ -10,6 +10,7 @@
#include <AK/Assertions.h>
#include <AK/ByteBuffer.h>
#include <AK/Types.h>
#include <Kernel/Arch/Processor.h>
#include <Kernel/Locking/Mutex.h>
#include <Kernel/StdLib.h>
#include <LibCrypto/Cipher/AES.h>
@ -163,7 +164,7 @@ public:
auto& kernel_rng = KernelRng::the();
SpinlockLocker lock(kernel_rng.get_lock());
// We don't lock this because on the off chance a pool is corrupted, entropy isn't lost.
Event<T> event = { read_tsc(), m_source, event_data };
Event<T> event = { Processor::read_cpu_counter(), m_source, event_data };
kernel_rng.add_random_event(event, m_pool);
m_pool++;
kernel_rng.wake_if_ready();