diff options
author | Brian Gianforcaro <bgianf@serenityos.org> | 2021-09-05 10:02:03 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-05 20:46:02 +0200 |
commit | bb58a4d94394ae19e0b850b15cfb105c91a1ee7b (patch) | |
tree | 95e33e16bd0685ff3a7e5f3c287be64cea0f7532 /Kernel/Storage | |
parent | 5905d2e9e9380f6c4d0fc370ba8271371e87e1d3 (diff) | |
download | serenity-bb58a4d94394ae19e0b850b15cfb105c91a1ee7b.zip |
Kernel: Make all Spinlocks use u8 for storage, remove template
The default template argument is only used in one place, and it
looks like it was probably just an oversight. The rest of the Kernel
code all uses u8 as the type. So lets make that the default and remove
the unused template argument, as there doesn't seem to be a reason to
allow the size to be customizable.
Diffstat (limited to 'Kernel/Storage')
-rw-r--r-- | Kernel/Storage/AHCIPort.cpp | 6 | ||||
-rw-r--r-- | Kernel/Storage/AHCIPort.h | 8 | ||||
-rw-r--r-- | Kernel/Storage/IDEChannel.h | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/Kernel/Storage/AHCIPort.cpp b/Kernel/Storage/AHCIPort.cpp index 6e176fee0e..0d54f409be 100644 --- a/Kernel/Storage/AHCIPort.cpp +++ b/Kernel/Storage/AHCIPort.cpp @@ -238,7 +238,7 @@ bool AHCIPort::initialize_without_reset() return initialize(lock); } -bool AHCIPort::initialize(SpinlockLocker<Spinlock<u8>>& main_lock) +bool AHCIPort::initialize(SpinlockLocker<Spinlock>& 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)); @@ -591,7 +591,7 @@ bool AHCIPort::access_device(AsyncBlockDeviceRequest::RequestType direction, u64 return true; } -bool AHCIPort::identify_device(SpinlockLocker<Spinlock<u8>>& main_lock) +bool AHCIPort::identify_device(SpinlockLocker<Spinlock>& main_lock) { VERIFY(m_lock.is_locked()); VERIFY(is_operable()); @@ -740,7 +740,7 @@ void AHCIPort::stop_fis_receiving() const m_port_registers.cmd = m_port_registers.cmd & 0xFFFFFFEF; } -bool AHCIPort::initiate_sata_reset(SpinlockLocker<Spinlock<u8>>& main_lock) +bool AHCIPort::initiate_sata_reset(SpinlockLocker<Spinlock>& main_lock) { VERIFY(m_lock.is_locked()); VERIFY(m_hard_lock.is_locked()); diff --git a/Kernel/Storage/AHCIPort.h b/Kernel/Storage/AHCIPort.h index 4da795dce6..a0f9146773 100644 --- a/Kernel/Storage/AHCIPort.h +++ b/Kernel/Storage/AHCIPort.h @@ -51,7 +51,7 @@ public: private: bool is_phy_enabled() const { return (m_port_registers.ssts & 0xf) == 3; } - bool initialize(SpinlockLocker<Spinlock<u8>>&); + bool initialize(SpinlockLocker<Spinlock>&); 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(SpinlockLocker<Spinlock<u8>>&); + bool initiate_sata_reset(SpinlockLocker<Spinlock>&); void rebase(); void recover_from_fatal_error(); bool shutdown(); @@ -79,7 +79,7 @@ private: bool spin_until_ready() const; - bool identify_device(SpinlockLocker<Spinlock<u8>>&); + bool identify_device(SpinlockLocker<Spinlock>&); ALWAYS_INLINE void start_command_list_processing() const; ALWAYS_INLINE void mark_command_header_ready_to_process(u8 command_header_index) const; @@ -101,7 +101,7 @@ private: EntropySource m_entropy_source; RefPtr<AsyncBlockDeviceRequest> m_current_request; - Spinlock<u8> m_hard_lock; + Spinlock m_hard_lock; Mutex m_lock { "AHCIPort" }; mutable bool m_wait_for_completion { false }; diff --git a/Kernel/Storage/IDEChannel.h b/Kernel/Storage/IDEChannel.h index 976dc5abbf..83fe5d3aa3 100644 --- a/Kernel/Storage/IDEChannel.h +++ b/Kernel/Storage/IDEChannel.h @@ -157,7 +157,7 @@ protected: RefPtr<AsyncBlockDeviceRequest> m_current_request; u64 m_current_request_block_index { 0 }; bool m_current_request_flushing_cache { false }; - Spinlock<u8> m_request_lock; + Spinlock m_request_lock; Mutex m_lock { "IDEChannel" }; IOAddressGroup m_io_group; |