mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:28:11 +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
|
@ -208,7 +208,7 @@ bool BochsGraphicsAdapter::set_y_offset(size_t output_port_index, size_t y_offse
|
|||
|
||||
void BochsGraphicsAdapter::enable_consoles()
|
||||
{
|
||||
ScopedSpinlock lock(m_console_mode_switch_lock);
|
||||
SpinlockLocker lock(m_console_mode_switch_lock);
|
||||
VERIFY(m_framebuffer_console);
|
||||
m_console_enabled = true;
|
||||
m_registers->bochs_regs.y_offset = 0;
|
||||
|
@ -218,7 +218,7 @@ void BochsGraphicsAdapter::enable_consoles()
|
|||
}
|
||||
void BochsGraphicsAdapter::disable_consoles()
|
||||
{
|
||||
ScopedSpinlock lock(m_console_mode_switch_lock);
|
||||
SpinlockLocker lock(m_console_mode_switch_lock);
|
||||
VERIFY(m_framebuffer_console);
|
||||
VERIFY(m_framebuffer_device);
|
||||
m_console_enabled = false;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -27,7 +27,7 @@ NonnullRefPtr<FramebufferDevice> FramebufferDevice::create(const GraphicsDevice&
|
|||
|
||||
KResultOr<Memory::Region*> FramebufferDevice::mmap(Process& process, FileDescription&, Memory::VirtualRange const& range, u64 offset, int prot, bool shared)
|
||||
{
|
||||
ScopedSpinlock lock(m_activation_lock);
|
||||
SpinlockLocker lock(m_activation_lock);
|
||||
REQUIRE_PROMISE(video);
|
||||
if (!shared)
|
||||
return ENODEV;
|
||||
|
@ -80,7 +80,7 @@ KResultOr<Memory::Region*> FramebufferDevice::mmap(Process& process, FileDescrip
|
|||
|
||||
void FramebufferDevice::deactivate_writes()
|
||||
{
|
||||
ScopedSpinlock lock(m_activation_lock);
|
||||
SpinlockLocker lock(m_activation_lock);
|
||||
if (!m_userspace_framebuffer_region)
|
||||
return;
|
||||
memcpy(m_swapped_framebuffer_region->vaddr().as_ptr(), m_real_framebuffer_region->vaddr().as_ptr(), Memory::page_round_up(framebuffer_size_in_bytes()));
|
||||
|
@ -91,7 +91,7 @@ void FramebufferDevice::deactivate_writes()
|
|||
}
|
||||
void FramebufferDevice::activate_writes()
|
||||
{
|
||||
ScopedSpinlock lock(m_activation_lock);
|
||||
SpinlockLocker lock(m_activation_lock);
|
||||
if (!m_userspace_framebuffer_region || !m_real_framebuffer_vmobject)
|
||||
return;
|
||||
// restore the image we had in the void area
|
||||
|
|
|
@ -192,7 +192,7 @@ IntelNativeGraphicsAdapter::IntelNativeGraphicsAdapter(PCI::Address address)
|
|||
m_registers_region = MM.allocate_kernel_region(PhysicalAddress(PCI::get_BAR0(address)).page_base(), bar0_space_size, "Intel Native Graphics Registers", Memory::Region::Access::ReadWrite);
|
||||
PCI::enable_bus_mastering(address);
|
||||
{
|
||||
ScopedSpinlock control_lock(m_control_lock);
|
||||
SpinlockLocker control_lock(m_control_lock);
|
||||
set_gmbus_default_rate();
|
||||
set_gmbus_pin_pair(GMBusPinPair::DedicatedAnalog);
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ void IntelNativeGraphicsAdapter::write_to_register(IntelGraphics::RegisterIndex
|
|||
{
|
||||
VERIFY(m_control_lock.is_locked());
|
||||
VERIFY(m_registers_region);
|
||||
ScopedSpinlock lock(m_registers_lock);
|
||||
SpinlockLocker lock(m_registers_lock);
|
||||
dbgln_if(INTEL_GRAPHICS_DEBUG, "Intel Graphics {}: Write to {} value of {:x}", pci_address(), convert_register_index_to_string(index), value);
|
||||
auto* reg = (volatile u32*)m_registers_region->vaddr().offset(index).as_ptr();
|
||||
*reg = value;
|
||||
|
@ -286,7 +286,7 @@ u32 IntelNativeGraphicsAdapter::read_from_register(IntelGraphics::RegisterIndex
|
|||
{
|
||||
VERIFY(m_control_lock.is_locked());
|
||||
VERIFY(m_registers_region);
|
||||
ScopedSpinlock lock(m_registers_lock);
|
||||
SpinlockLocker lock(m_registers_lock);
|
||||
auto* reg = (volatile u32*)m_registers_region->vaddr().offset(index).as_ptr();
|
||||
u32 value = *reg;
|
||||
dbgln_if(INTEL_GRAPHICS_DEBUG, "Intel Graphics {}: Read from {} value of {:x}", pci_address(), convert_register_index_to_string(index), value);
|
||||
|
@ -373,7 +373,7 @@ void IntelNativeGraphicsAdapter::gmbus_read(unsigned address, u8* buf, size_t le
|
|||
|
||||
void IntelNativeGraphicsAdapter::gmbus_read_edid()
|
||||
{
|
||||
ScopedSpinlock control_lock(m_control_lock);
|
||||
SpinlockLocker control_lock(m_control_lock);
|
||||
gmbus_write(DDC2_I2C_ADDRESS, 0);
|
||||
gmbus_read(DDC2_I2C_ADDRESS, (u8*)&m_crt_edid, sizeof(Graphics::VideoInfoBlock));
|
||||
}
|
||||
|
@ -409,8 +409,8 @@ void IntelNativeGraphicsAdapter::enable_output(PhysicalAddress fb_address, size_
|
|||
|
||||
bool IntelNativeGraphicsAdapter::set_crt_resolution(size_t width, size_t height)
|
||||
{
|
||||
ScopedSpinlock control_lock(m_control_lock);
|
||||
ScopedSpinlock modeset_lock(m_modeset_lock);
|
||||
SpinlockLocker control_lock(m_control_lock);
|
||||
SpinlockLocker modeset_lock(m_modeset_lock);
|
||||
if (!is_resolution_valid(width, height)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ void GPU::handle_queue_update(u16 queue_index)
|
|||
VERIFY(queue_index == CONTROLQ);
|
||||
|
||||
auto& queue = get_queue(CONTROLQ);
|
||||
ScopedSpinlock queue_lock(queue.lock());
|
||||
SpinlockLocker queue_lock(queue.lock());
|
||||
queue.discard_used_buffers();
|
||||
m_outstanding_request.wake_all();
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ void GPU::synchronous_virtio_gpu_command(PhysicalAddress buffer_start, size_t re
|
|||
VERIFY(m_outstanding_request.is_empty());
|
||||
auto& queue = get_queue(CONTROLQ);
|
||||
{
|
||||
ScopedSpinlock lock(queue.lock());
|
||||
SpinlockLocker lock(queue.lock());
|
||||
VirtIOQueueChain chain { queue };
|
||||
chain.add_buffer_to_chain(buffer_start, request_size, BufferType::DeviceReadable);
|
||||
chain.add_buffer_to_chain(buffer_start.offset(request_size), response_size, BufferType::DeviceWritable);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue