1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:37:46 +00:00

Kernel: Rename ScopedSpinlock => SpinlockLocker

This matches MutexLocker, and doesn't sound like it's a lock itself.
This commit is contained in:
Andreas Kling 2021-08-22 01:49:22 +02:00
parent 55adace359
commit c922a7da09
78 changed files with 365 additions and 366 deletions

View file

@ -124,7 +124,7 @@ bool AHCIPort::is_interrupts_enabled() const
void AHCIPort::recover_from_fatal_error()
{
MutexLocker locker(m_lock);
ScopedSpinlock lock(m_hard_lock);
SpinlockLocker lock(m_hard_lock);
dmesgln("{}: AHCI Port {} fatal error, shutting down!", m_parent_handler->hba_controller()->pci_address(), representative_port_index());
dmesgln("{}: AHCI Port {} fatal error, SError {}", m_parent_handler->hba_controller()->pci_address(), representative_port_index(), (u32)m_port_registers.serr);
stop_command_list_processing();
@ -208,7 +208,7 @@ void AHCIPort::eject()
bool AHCIPort::reset()
{
MutexLocker locker(m_lock);
ScopedSpinlock lock(m_hard_lock);
SpinlockLocker lock(m_hard_lock);
dbgln_if(AHCI_DEBUG, "AHCI Port {}: Resetting", representative_port_index());
@ -233,12 +233,12 @@ bool AHCIPort::reset()
bool AHCIPort::initialize_without_reset()
{
MutexLocker locker(m_lock);
ScopedSpinlock lock(m_hard_lock);
SpinlockLocker lock(m_hard_lock);
dmesgln("AHCI Port {}: {}", representative_port_index(), try_disambiguate_sata_status());
return initialize(lock);
}
bool AHCIPort::initialize(ScopedSpinlock<Spinlock<u8>>& main_lock)
bool AHCIPort::initialize(SpinlockLocker<Spinlock<u8>>& main_lock)
{
VERIFY(m_lock.is_locked());
dbgln_if(AHCI_DEBUG, "AHCI Port {}: Initialization. Signature = {:#08x}", representative_port_index(), static_cast<u32>(m_port_registers.sig));
@ -504,7 +504,7 @@ bool AHCIPort::access_device(AsyncBlockDeviceRequest::RequestType direction, u64
VERIFY(is_operable());
VERIFY(m_lock.is_locked());
VERIFY(m_current_scatter_list);
ScopedSpinlock lock(m_hard_lock);
SpinlockLocker lock(m_hard_lock);
dbgln_if(AHCI_DEBUG, "AHCI Port {}: Do a {}, lba {}, block count {}", representative_port_index(), direction == AsyncBlockDeviceRequest::RequestType::Write ? "write" : "read", lba, block_count);
if (!spin_until_ready())
@ -591,7 +591,7 @@ bool AHCIPort::access_device(AsyncBlockDeviceRequest::RequestType direction, u64
return true;
}
bool AHCIPort::identify_device(ScopedSpinlock<Spinlock<u8>>& main_lock)
bool AHCIPort::identify_device(SpinlockLocker<Spinlock<u8>>& main_lock)
{
VERIFY(m_lock.is_locked());
VERIFY(is_operable());
@ -654,7 +654,7 @@ bool AHCIPort::identify_device(ScopedSpinlock<Spinlock<u8>>& main_lock)
bool AHCIPort::shutdown()
{
MutexLocker locker(m_lock);
ScopedSpinlock lock(m_hard_lock);
SpinlockLocker lock(m_hard_lock);
rebase();
set_interface_state(AHCI::DeviceDetectionInitialization::DisableInterface);
return true;
@ -740,7 +740,7 @@ void AHCIPort::stop_fis_receiving() const
m_port_registers.cmd = m_port_registers.cmd & 0xFFFFFFEF;
}
bool AHCIPort::initiate_sata_reset(ScopedSpinlock<Spinlock<u8>>& main_lock)
bool AHCIPort::initiate_sata_reset(SpinlockLocker<Spinlock<u8>>& main_lock)
{
VERIFY(m_lock.is_locked());
VERIFY(m_hard_lock.is_locked());

View file

@ -51,7 +51,7 @@ public:
private:
bool is_phy_enabled() const { return (m_port_registers.ssts & 0xf) == 3; }
bool initialize(ScopedSpinlock<Spinlock<u8>>&);
bool initialize(SpinlockLocker<Spinlock<u8>>&);
UNMAP_AFTER_INIT AHCIPort(const AHCIPortHandler&, volatile AHCI::PortRegisters&, u32 port_index);
@ -62,7 +62,7 @@ private:
const char* try_disambiguate_sata_status();
void try_disambiguate_sata_error();
bool initiate_sata_reset(ScopedSpinlock<Spinlock<u8>>&);
bool initiate_sata_reset(SpinlockLocker<Spinlock<u8>>&);
void rebase();
void recover_from_fatal_error();
bool shutdown();
@ -79,7 +79,7 @@ private:
bool spin_until_ready() const;
bool identify_device(ScopedSpinlock<Spinlock<u8>>&);
bool identify_device(SpinlockLocker<Spinlock<u8>>&);
ALWAYS_INLINE void start_command_list_processing() const;
ALWAYS_INLINE void mark_command_header_ready_to_process(u8 command_header_index) const;

View file

@ -80,7 +80,7 @@ bool BMIDEChannel::handle_irq(const RegisterState&)
// clear bus master interrupt status
m_io_group.bus_master_base().value().offset(2).out<u8>(m_io_group.bus_master_base().value().offset(2).in<u8>() | 4);
ScopedSpinlock lock(m_request_lock);
SpinlockLocker lock(m_request_lock);
dbgln_if(PATA_DEBUG, "BMIDEChannel: interrupt: DRQ={}, BSY={}, DRDY={}",
(status & ATA_SR_DRQ) != 0,
(status & ATA_SR_BSY) != 0,
@ -116,7 +116,7 @@ void BMIDEChannel::complete_current_request(AsyncDeviceRequest::RequestResult re
// before Processor::deferred_call_queue returns!
g_io_work->queue([this, result]() {
dbgln_if(PATA_DEBUG, "BMIDEChannel::complete_current_request result: {}", (int)result);
ScopedSpinlock lock(m_request_lock);
SpinlockLocker lock(m_request_lock);
VERIFY(m_current_request);
auto current_request = m_current_request;
m_current_request.clear();
@ -146,7 +146,7 @@ void BMIDEChannel::ata_write_sectors(bool slave_request, u16 capabilities)
VERIFY(!m_current_request.is_null());
VERIFY(m_current_request->block_count() <= 256);
ScopedSpinlock m_lock(m_request_lock);
SpinlockLocker m_lock(m_request_lock);
dbgln_if(PATA_DEBUG, "BMIDEChannel::ata_write_sectors ({} x {})", m_current_request->block_index(), m_current_request->block_count());
prdt().offset = m_dma_buffer_page->paddr().get();
@ -194,7 +194,7 @@ void BMIDEChannel::ata_read_sectors(bool slave_request, u16 capabilities)
VERIFY(!m_current_request.is_null());
VERIFY(m_current_request->block_count() <= 256);
ScopedSpinlock m_lock(m_request_lock);
SpinlockLocker m_lock(m_request_lock);
dbgln_if(PATA_DEBUG, "BMIDEChannel::ata_read_sectors ({} x {})", m_current_request->block_index(), m_current_request->block_count());
// Note: This is a fix for a quirk for an IDE controller on ICH7 machine.

View file

@ -197,7 +197,7 @@ bool IDEChannel::handle_irq(const RegisterState&)
m_entropy_source.add_random_event(status);
ScopedSpinlock lock(m_request_lock);
SpinlockLocker lock(m_request_lock);
dbgln_if(PATA_DEBUG, "IDEChannel: interrupt: DRQ={}, BSY={}, DRDY={}",
(status & ATA_SR_DRQ) != 0,
(status & ATA_SR_BSY) != 0,
@ -223,7 +223,7 @@ bool IDEChannel::handle_irq(const RegisterState&)
// trigger page faults
g_io_work->queue([this]() {
MutexLocker locker(m_lock);
ScopedSpinlock lock(m_request_lock);
SpinlockLocker lock(m_request_lock);
if (m_current_request->request_type() == AsyncBlockDeviceRequest::Read) {
dbgln_if(PATA_DEBUG, "IDEChannel: Read block {}/{}", m_current_request_block_index, m_current_request->block_count());
@ -498,7 +498,7 @@ void IDEChannel::ata_read_sectors(bool slave_request, u16 capabilities)
VERIFY(!m_current_request.is_null());
VERIFY(m_current_request->block_count() <= 256);
ScopedSpinlock m_lock(m_request_lock);
SpinlockLocker m_lock(m_request_lock);
dbgln_if(PATA_DEBUG, "IDEChannel::ata_read_sectors");
dbgln_if(PATA_DEBUG, "IDEChannel: Reading {} sector(s) @ LBA {}", m_current_request->block_count(), m_current_request->block_index());
ata_access(Direction::Read, slave_request, m_current_request->block_index(), m_current_request->block_count(), capabilities);
@ -536,7 +536,7 @@ void IDEChannel::ata_write_sectors(bool slave_request, u16 capabilities)
VERIFY(!m_current_request.is_null());
VERIFY(m_current_request->block_count() <= 256);
ScopedSpinlock m_lock(m_request_lock);
SpinlockLocker m_lock(m_request_lock);
dbgln_if(PATA_DEBUG, "IDEChannel: Writing {} sector(s) @ LBA {}", m_current_request->block_count(), m_current_request->block_index());
ata_access(Direction::Write, slave_request, m_current_request->block_index(), m_current_request->block_count(), capabilities);
ata_do_write_sector();