diff options
author | Timon Kruiper <timonkruiper@gmail.com> | 2022-05-17 10:04:37 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-06-02 13:14:12 +0100 |
commit | a0b0c4e7237dbb90e72247d7f1c9566ad3dd248c (patch) | |
tree | 610ed542ace11e669bca8e8f26890b5ec0d265f6 /Kernel | |
parent | 3cf8d3361e347da561f7a67dffa988969cc08914 (diff) | |
download | serenity-a0b0c4e7237dbb90e72247d7f1c9566ad3dd248c.zip |
Kernel: Make RPi Timer::set_clock_rate static
This allows it to be called in UART without calling the Timer
constructor. This in turn allows the UART to be used before interrupts
are enabled.
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Arch/aarch64/RPi/Timer.h | 2 | ||||
-rw-r--r-- | Kernel/Arch/aarch64/RPi/UART.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Arch/aarch64/RPi/Timer.h b/Kernel/Arch/aarch64/RPi/Timer.h index c00ecc01bb..7bbaca322a 100644 --- a/Kernel/Arch/aarch64/RPi/Timer.h +++ b/Kernel/Arch/aarch64/RPi/Timer.h @@ -35,7 +35,7 @@ public: M2MC = 13, PIXEL_BVB = 14, }; - u32 set_clock_rate(ClockID, u32 rate_hz, bool skip_setting_turbo = true); + static u32 set_clock_rate(ClockID, u32 rate_hz, bool skip_setting_turbo = true); private: Timer(); diff --git a/Kernel/Arch/aarch64/RPi/UART.cpp b/Kernel/Arch/aarch64/RPi/UART.cpp index 506c96ef0b..59257afd7c 100644 --- a/Kernel/Arch/aarch64/RPi/UART.cpp +++ b/Kernel/Arch/aarch64/RPi/UART.cpp @@ -101,7 +101,7 @@ UART::UART() // Set UART clock so that the baud rate divisor ends up as 1.0. // FIXME: Not sure if this is a good UART clock rate. - u32 rate_in_hz = Timer::the().set_clock_rate(Timer::ClockID::UART, 16 * baud_rate); + u32 rate_in_hz = Timer::set_clock_rate(Timer::ClockID::UART, 16 * baud_rate); // The BCM's PL011 UART is alternate function 0 on pins 14 and 15. auto& gpio = GPIO::the(); |