1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:47:35 +00:00

Kernel: Rename SpinLock => Spinlock

This commit is contained in:
Andreas Kling 2021-08-22 01:37:17 +02:00
parent 7d5d26b048
commit 55adace359
110 changed files with 491 additions and 491 deletions

View file

@ -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);
ScopedSpinlock 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);
ScopedSpinlock lock(m_console_mode_switch_lock);
VERIFY(m_framebuffer_console);
VERIFY(m_framebuffer_device);
m_console_enabled = false;

View file

@ -60,7 +60,7 @@ private:
Memory::TypedMapping<BochsDisplayMMIORegisters volatile> m_registers;
RefPtr<FramebufferDevice> m_framebuffer_device;
RefPtr<Graphics::GenericFramebufferConsole> m_framebuffer_console;
SpinLock<u8> m_console_mode_switch_lock;
Spinlock<u8> m_console_mode_switch_lock;
bool m_console_enabled { false };
bool m_io_required { false };
};

View file

@ -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;

View file

@ -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;
};
}

View file

@ -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();

View file

@ -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 };

View file

@ -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);
ScopedSpinlock 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);
ScopedSpinlock 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);
ScopedSpinlock lock(m_activation_lock);
if (!m_userspace_framebuffer_region || !m_real_framebuffer_vmobject)
return;
// restore the image we had in the void area

View file

@ -11,7 +11,7 @@
#include <AK/Types.h>
#include <Kernel/Devices/BlockDevice.h>
#include <Kernel/Graphics/GraphicsDevice.h>
#include <Kernel/Locking/SpinLock.h>
#include <Kernel/Locking/Spinlock.h>
#include <Kernel/Memory/AnonymousVMObject.h>
#include <Kernel/PhysicalAddress.h>
@ -53,7 +53,7 @@ private:
size_t m_framebuffer_width { 0 };
size_t m_framebuffer_height { 0 };
SpinLock<u8> m_activation_lock;
Spinlock<u8> m_activation_lock;
RefPtr<Memory::AnonymousVMObject> m_real_framebuffer_vmobject;
RefPtr<Memory::AnonymousVMObject> m_swapped_framebuffer_vmobject;

View file

@ -40,7 +40,7 @@ public:
bool framebuffer_devices_allowed() const { return m_framebuffer_devices_allowed; }
bool framebuffer_devices_exist() const;
SpinLock<u8>& main_vga_lock() { return m_main_vga_lock; }
Spinlock<u8>& main_vga_lock() { return m_main_vga_lock; }
RefPtr<Graphics::Console> console() const { return m_console; }
void deactivate_graphical_mode();
@ -56,7 +56,7 @@ private:
unsigned m_current_minor_number { 0 };
const bool m_framebuffer_devices_allowed;
SpinLock<u8> m_main_vga_lock;
Spinlock<u8> m_main_vga_lock;
};
}

View file

@ -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);
ScopedSpinlock 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);
ScopedSpinlock 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);
ScopedSpinlock 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);
ScopedSpinlock 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);
ScopedSpinlock control_lock(m_control_lock);
ScopedSpinlock modeset_lock(m_modeset_lock);
if (!is_resolution_valid(width, height)) {
return false;
}

View file

@ -161,9 +161,9 @@ private:
Optional<PLLSettings> create_pll_settings(u64 target_frequency, u64 reference_clock, const PLLMaxSettings&);
SpinLock<u8> m_control_lock;
SpinLock<u8> m_modeset_lock;
mutable SpinLock<u8> m_registers_lock;
Spinlock<u8> m_control_lock;
Spinlock<u8> m_modeset_lock;
mutable Spinlock<u8> m_registers_lock;
Graphics::VideoInfoBlock m_crt_edid;
const PhysicalAddress m_registers;

View file

@ -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());
ScopedSpinlock 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());
ScopedSpinlock 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);