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

Kernel: Stop using NonnullLockRefPtrVector

This commit is contained in:
Andreas Kling 2023-03-06 17:56:28 +01:00
parent 21db2b7b90
commit 7369d0ab5f
41 changed files with 90 additions and 109 deletions

View file

@ -205,7 +205,7 @@ LockRefPtr<StorageDevice> AHCIController::device_by_port(u32 port_index) const
LockRefPtr<StorageDevice> AHCIController::device(u32 index) const
{
NonnullLockRefPtrVector<StorageDevice> connected_devices;
Vector<NonnullLockRefPtr<StorageDevice>> connected_devices;
u32 pi = hba().control_regs.pi;
u32 bit = bit_scan_forward(pi);
while (bit) {

View file

@ -149,7 +149,7 @@ protected:
RefPtr<Memory::PhysicalPage> m_dma_buffer_page;
const u8 m_port_index;
NonnullLockRefPtrVector<ATADevice> m_ata_devices;
Vector<NonnullLockRefPtr<ATADevice>> m_ata_devices;
NonnullOwnPtr<KBuffer> m_ata_identify_data_buffer;
NonnullLockRefPtr<ATAController> m_parent_ata_controller;
};

View file

@ -46,13 +46,13 @@ void IDEController::start_request(ATADevice const& device, AsyncBlockDeviceReque
VERIFY(address.subport < 2);
switch (address.port) {
case 0: {
auto result = m_channels[0].start_request(device, request);
auto result = m_channels[0]->start_request(device, request);
// FIXME: Propagate errors properly
VERIFY(!result.is_error());
return;
}
case 1: {
auto result = m_channels[1].start_request(device, request);
auto result = m_channels[1]->start_request(device, request);
// FIXME: Propagate errors properly
VERIFY(!result.is_error());
return;
@ -73,20 +73,20 @@ LockRefPtr<StorageDevice> IDEController::device_by_channel_and_position(u32 inde
{
switch (index) {
case 0:
return m_channels[0].connected_device(0);
return m_channels[0]->connected_device(0);
case 1:
return m_channels[0].connected_device(1);
return m_channels[0]->connected_device(1);
case 2:
return m_channels[1].connected_device(0);
return m_channels[1]->connected_device(0);
case 3:
return m_channels[1].connected_device(1);
return m_channels[1]->connected_device(1);
}
VERIFY_NOT_REACHED();
}
LockRefPtr<StorageDevice> IDEController::device(u32 index) const
{
NonnullLockRefPtrVector<StorageDevice> connected_devices;
Vector<NonnullLockRefPtr<StorageDevice>> connected_devices;
for (size_t index = 0; index < 4; index++) {
auto checked_device = device_by_channel_and_position(index);
if (checked_device.is_null())

View file

@ -32,6 +32,6 @@ protected:
IDEController();
LockRefPtr<StorageDevice> device_by_channel_and_position(u32 index) const;
NonnullLockRefPtrVector<IDEChannel> m_channels;
Vector<NonnullLockRefPtr<IDEChannel>> m_channels;
};
}