Files
ladybird/Kernel/Prekernel/Arch/aarch64/Timer.h
Nico Weber bc213ad7a2 Kernel: Add a Timer class for aarch64
For now, this can only query microseconds since boot.

Use this to print a timestamp every second. This busy-loops
until a second has passed. This might be a good first use of
interrupts soon.

qemu used to not implement this timer at some point, but
it seems to work fine even in qemu now (qemu v 5.2.0).
2021-10-02 21:23:28 +01:00

28 lines
347 B
C++

/*
* Copyright (c) 2021, Nico Weber <thakis@chromium.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Types.h>
namespace Prekernel {
struct TimerRegisters;
class Timer {
public:
static Timer& the();
u64 microseconds_since_boot();
private:
Timer();
TimerRegisters volatile* m_registers;
};
}