mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:57:44 +00:00
Kernel: Rename SpinLock => Spinlock
This commit is contained in:
parent
7d5d26b048
commit
55adace359
110 changed files with 491 additions and 491 deletions
|
@ -224,7 +224,7 @@ void GenericFramebufferConsole::show_cursor()
|
|||
|
||||
void GenericFramebufferConsole::clear(size_t x, size_t y, size_t length)
|
||||
{
|
||||
ScopedSpinLock lock(m_lock);
|
||||
ScopedSpinlock lock(m_lock);
|
||||
if (x == 0 && length == max_column()) {
|
||||
// if we need to clear the entire row, just clean it with quick memset :)
|
||||
auto* offset_in_framebuffer = (u32*)&framebuffer_data()[x * sizeof(u32) * 8 + y * 8 * sizeof(u32) * width()];
|
||||
|
@ -264,19 +264,19 @@ void GenericFramebufferConsole::clear_glyph(size_t x, size_t y)
|
|||
|
||||
void GenericFramebufferConsole::enable()
|
||||
{
|
||||
ScopedSpinLock lock(m_lock);
|
||||
ScopedSpinlock lock(m_lock);
|
||||
memset(framebuffer_data(), 0, height() * width() * sizeof(u32));
|
||||
m_enabled.store(true);
|
||||
}
|
||||
void GenericFramebufferConsole::disable()
|
||||
{
|
||||
ScopedSpinLock lock(m_lock);
|
||||
ScopedSpinlock lock(m_lock);
|
||||
m_enabled.store(false);
|
||||
}
|
||||
|
||||
void GenericFramebufferConsole::write(size_t x, size_t y, char ch, Color background, Color foreground, bool critical)
|
||||
{
|
||||
ScopedSpinLock lock(m_lock);
|
||||
ScopedSpinlock lock(m_lock);
|
||||
if (!m_enabled.load())
|
||||
return;
|
||||
|
||||
|
|
|
@ -47,6 +47,6 @@ protected:
|
|||
virtual u8* framebuffer_data() = 0;
|
||||
void clear_glyph(size_t x, size_t y);
|
||||
size_t m_pitch;
|
||||
mutable SpinLock<u8> m_lock;
|
||||
mutable Spinlock<u8> m_lock;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -87,8 +87,8 @@ enum VGAColor : u8 {
|
|||
|
||||
void TextModeConsole::set_cursor(size_t x, size_t y)
|
||||
{
|
||||
ScopedSpinLock main_lock(GraphicsManagement::the().main_vga_lock());
|
||||
ScopedSpinLock lock(m_vga_lock);
|
||||
ScopedSpinlock main_lock(GraphicsManagement::the().main_vga_lock());
|
||||
ScopedSpinlock lock(m_vga_lock);
|
||||
m_cursor_x = x;
|
||||
m_cursor_y = y;
|
||||
u16 value = m_current_vga_start_address + (y * width() + x);
|
||||
|
@ -99,22 +99,22 @@ void TextModeConsole::set_cursor(size_t x, size_t y)
|
|||
}
|
||||
void TextModeConsole::hide_cursor()
|
||||
{
|
||||
ScopedSpinLock main_lock(GraphicsManagement::the().main_vga_lock());
|
||||
ScopedSpinLock lock(m_vga_lock);
|
||||
ScopedSpinlock main_lock(GraphicsManagement::the().main_vga_lock());
|
||||
ScopedSpinlock lock(m_vga_lock);
|
||||
IO::out8(0x3D4, 0xA);
|
||||
IO::out8(0x3D5, 0x20);
|
||||
}
|
||||
void TextModeConsole::show_cursor()
|
||||
{
|
||||
ScopedSpinLock main_lock(GraphicsManagement::the().main_vga_lock());
|
||||
ScopedSpinLock lock(m_vga_lock);
|
||||
ScopedSpinlock main_lock(GraphicsManagement::the().main_vga_lock());
|
||||
ScopedSpinlock lock(m_vga_lock);
|
||||
IO::out8(0x3D4, 0xA);
|
||||
IO::out8(0x3D5, 0x20);
|
||||
}
|
||||
|
||||
void TextModeConsole::clear(size_t x, size_t y, size_t length)
|
||||
{
|
||||
ScopedSpinLock lock(m_vga_lock);
|
||||
ScopedSpinlock lock(m_vga_lock);
|
||||
auto* buf = (u16*)(m_current_vga_window + (x * 2) + (y * width() * 2));
|
||||
for (size_t index = 0; index < length; index++) {
|
||||
buf[index] = 0x0720;
|
||||
|
@ -127,12 +127,12 @@ void TextModeConsole::write(size_t x, size_t y, char ch, bool critical)
|
|||
|
||||
void TextModeConsole::write(size_t x, size_t y, char ch, Color background, Color foreground, bool critical)
|
||||
{
|
||||
ScopedSpinLock lock(m_vga_lock);
|
||||
ScopedSpinlock lock(m_vga_lock);
|
||||
// If we are in critical printing mode, we need to handle new lines here
|
||||
// because there's no other responsible object to do that in the print call path
|
||||
if (critical && (ch == '\r' || ch == '\n')) {
|
||||
// Disable hardware VGA cursor
|
||||
ScopedSpinLock main_lock(GraphicsManagement::the().main_vga_lock());
|
||||
ScopedSpinlock main_lock(GraphicsManagement::the().main_vga_lock());
|
||||
IO::out8(0x3D4, 0xA);
|
||||
IO::out8(0x3D5, 0x20);
|
||||
|
||||
|
@ -162,7 +162,7 @@ void TextModeConsole::clear_vga_row(u16 row)
|
|||
|
||||
void TextModeConsole::set_vga_start_row(u16 row)
|
||||
{
|
||||
ScopedSpinLock lock(m_vga_lock);
|
||||
ScopedSpinlock lock(m_vga_lock);
|
||||
m_vga_start_row = row;
|
||||
m_current_vga_start_address = row * width();
|
||||
m_current_vga_window = m_current_vga_window + row * width() * bytes_per_base_glyph();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <AK/RefCounted.h>
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/Graphics/Console/VGAConsole.h>
|
||||
#include <Kernel/Locking/SpinLock.h>
|
||||
#include <Kernel/Locking/Spinlock.h>
|
||||
|
||||
namespace Kernel::Graphics {
|
||||
class TextModeConsole final : public VGAConsole {
|
||||
|
@ -39,7 +39,7 @@ private:
|
|||
|
||||
explicit TextModeConsole(const VGACompatibleAdapter&);
|
||||
|
||||
mutable SpinLock<u8> m_vga_lock;
|
||||
mutable Spinlock<u8> m_vga_lock;
|
||||
u16 m_vga_start_row { 0 };
|
||||
u16 m_current_vga_start_address { 0 };
|
||||
u8* m_current_vga_window { nullptr };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue