mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:17:35 +00:00
Kernel: Rename ScopedSpinlock => SpinlockLocker
This matches MutexLocker, and doesn't sound like it's a lock itself.
This commit is contained in:
parent
55adace359
commit
c922a7da09
78 changed files with 365 additions and 366 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);
|
||||
SpinlockLocker 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);
|
||||
SpinlockLocker lock(m_lock);
|
||||
memset(framebuffer_data(), 0, height() * width() * sizeof(u32));
|
||||
m_enabled.store(true);
|
||||
}
|
||||
void GenericFramebufferConsole::disable()
|
||||
{
|
||||
ScopedSpinlock lock(m_lock);
|
||||
SpinlockLocker 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);
|
||||
SpinlockLocker lock(m_lock);
|
||||
if (!m_enabled.load())
|
||||
return;
|
||||
|
||||
|
|
|
@ -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);
|
||||
SpinlockLocker main_lock(GraphicsManagement::the().main_vga_lock());
|
||||
SpinlockLocker 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);
|
||||
SpinlockLocker main_lock(GraphicsManagement::the().main_vga_lock());
|
||||
SpinlockLocker 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);
|
||||
SpinlockLocker main_lock(GraphicsManagement::the().main_vga_lock());
|
||||
SpinlockLocker 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);
|
||||
SpinlockLocker 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);
|
||||
SpinlockLocker 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());
|
||||
SpinlockLocker 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);
|
||||
SpinlockLocker 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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue