1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:17:45 +00:00

Kernel: Use the new API to query and map BAR spaces in most places

This might be a bit overkill in some instances, but it's nice to be
consistent
This commit is contained in:
Hendiadyoin1 2024-01-11 23:58:36 +01:00 committed by Andrew Kaster
parent c65455e122
commit 2dc20f9e39
7 changed files with 28 additions and 26 deletions

View file

@ -11,6 +11,7 @@
#include <Kernel/Arch/Delay.h>
#include <Kernel/Boot/CommandLine.h>
#include <Kernel/Bus/PCI/API.h>
#include <Kernel/Bus/PCI/BarMapping.h>
#include <Kernel/Devices/Storage/ATA/AHCI/Controller.h>
#include <Kernel/Devices/Storage/ATA/AHCI/InterruptHandler.h>
#include <Kernel/Library/LockRefPtr.h>
@ -154,7 +155,7 @@ UNMAP_AFTER_INIT AHCI::HBADefinedCapabilities AHCIController::capabilities() con
UNMAP_AFTER_INIT ErrorOr<Memory::TypedMapping<AHCI::HBA volatile>> AHCIController::map_default_hba_region(PCI::DeviceIdentifier const& pci_device_identifier)
{
return Memory::map_typed_writable<AHCI::HBA volatile>(PhysicalAddress(PCI::get_BAR5(pci_device_identifier)));
return PCI::map_bar<AHCI::HBA volatile>(pci_device_identifier, PCI::HeaderType0BaseRegister::BAR5);
}
AHCIController::~AHCIController() = default;