mirror of
https://github.com/RGBCube/serenity
synced 2025-05-29 17:35:06 +00:00
Kernel/aarch64: Initialize TimeManagement in init.cpp
Also remove the check for aarch64 in AK/Format.cpp, so now the format functions will prepend the time since boot!
This commit is contained in:
parent
01a14ac7af
commit
c7aa05cdcc
2 changed files with 8 additions and 8 deletions
|
@ -933,10 +933,8 @@ void vdmesgln(StringView fmtstr, TypeErasedFormatParams& params)
|
||||||
# ifdef AK_OS_SERENITY
|
# ifdef AK_OS_SERENITY
|
||||||
struct timespec ts = {};
|
struct timespec ts = {};
|
||||||
|
|
||||||
# if !ARCH(AARCH64)
|
|
||||||
if (TimeManagement::is_initialized())
|
if (TimeManagement::is_initialized())
|
||||||
ts = TimeManagement::the().monotonic_time(TimePrecision::Coarse).to_timespec();
|
ts = TimeManagement::the().monotonic_time(TimePrecision::Coarse).to_timespec();
|
||||||
# endif
|
|
||||||
|
|
||||||
if (Kernel::Processor::is_initialized() && Kernel::Thread::current()) {
|
if (Kernel::Processor::is_initialized() && Kernel::Thread::current()) {
|
||||||
auto& thread = *Kernel::Thread::current();
|
auto& thread = *Kernel::Thread::current();
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
#include <Kernel/Arch/aarch64/CPU.h>
|
#include <Kernel/Arch/aarch64/CPU.h>
|
||||||
#include <Kernel/Arch/aarch64/RPi/Framebuffer.h>
|
#include <Kernel/Arch/aarch64/RPi/Framebuffer.h>
|
||||||
#include <Kernel/Arch/aarch64/RPi/Mailbox.h>
|
#include <Kernel/Arch/aarch64/RPi/Mailbox.h>
|
||||||
#include <Kernel/Arch/aarch64/RPi/Timer.h>
|
|
||||||
#include <Kernel/Arch/aarch64/RPi/UART.h>
|
#include <Kernel/Arch/aarch64/RPi/UART.h>
|
||||||
#include <Kernel/Arch/aarch64/Registers.h>
|
#include <Kernel/Arch/aarch64/Registers.h>
|
||||||
#include <Kernel/Arch/aarch64/TrapFrame.h>
|
#include <Kernel/Arch/aarch64/TrapFrame.h>
|
||||||
|
@ -144,20 +143,23 @@ extern "C" [[noreturn]] void init()
|
||||||
InterruptManagement::initialize();
|
InterruptManagement::initialize();
|
||||||
Processor::enable_interrupts();
|
Processor::enable_interrupts();
|
||||||
|
|
||||||
|
TimeManagement::initialize(0);
|
||||||
|
|
||||||
auto firmware_version = query_firmware_version();
|
auto firmware_version = query_firmware_version();
|
||||||
dmesgln("Firmware version: {}", firmware_version);
|
dmesgln("Firmware version: {}", firmware_version);
|
||||||
|
|
||||||
auto& timer = RPi::Timer::the();
|
|
||||||
timer.set_interrupt_interval_usec(1'000'000);
|
|
||||||
timer.enable_interrupt_mode();
|
|
||||||
|
|
||||||
dmesgln("Enter loop");
|
dmesgln("Enter loop");
|
||||||
|
|
||||||
// This will not disable interrupts, so the timer will still fire and show that
|
// This will not disable interrupts, so the timer will still fire and show that
|
||||||
// interrupts are working!
|
// interrupts are working!
|
||||||
for (;;)
|
for (u32 i = 0;; i++) {
|
||||||
asm volatile("wfi");
|
asm volatile("wfi");
|
||||||
|
|
||||||
|
// NOTE: This shows that dmesgln now outputs the time since boot!
|
||||||
|
if (i % 250 == 0)
|
||||||
|
dmesgln("Timer fired!");
|
||||||
|
}
|
||||||
|
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue