summaryrefslogtreecommitdiff
path: root/Kernel/Bus
diff options
context:
space:
mode:
authorPankaj Raghav <pankydev8@gmail.com>2022-01-06 22:01:05 +0530
committerAndreas Kling <kling@serenityos.org>2022-01-09 00:45:38 +0100
commit0a1b34c753e83632688e925a7971ab5d08ffa605 (patch)
tree69377177de15bf03f19b56c87de61ad1fc2634a3 /Kernel/Bus
parent59da9bd0bdf249108cb9628cb417a117c14f7e71 (diff)
downloadserenity-0a1b34c753e83632688e925a7971ab5d08ffa605.zip
Kernel: Use DMA helper everywhere
Port UCHI, AC97, SB16, BMIDEChannel and AHCIPort to use the helper to allocate DMA buffers.
Diffstat (limited to 'Kernel/Bus')
-rw-r--r--Kernel/Bus/USB/UHCI/UHCIController.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/Kernel/Bus/USB/UHCI/UHCIController.cpp b/Kernel/Bus/USB/UHCI/UHCIController.cpp
index e14e552882..06ec1ac5a6 100644
--- a/Kernel/Bus/USB/UHCI/UHCIController.cpp
+++ b/Kernel/Bus/USB/UHCI/UHCIController.cpp
@@ -107,9 +107,7 @@ ErrorOr<void> UHCIController::reset()
}
// Let's allocate the physical page for the Frame List (which is 4KiB aligned)
- auto vmobject = TRY(Memory::AnonymousVMObject::try_create_physically_contiguous_with_size(PAGE_SIZE));
-
- m_framelist = TRY(MM.allocate_kernel_region_with_vmobject(move(vmobject), PAGE_SIZE, "UHCI Framelist", Memory::Region::Access::Write));
+ m_framelist = TRY(MM.allocate_dma_buffer_page("UHCI Framelist", Memory::Region::Access::Write));
dbgln("UHCI: Allocated framelist at physical address {}", m_framelist->physical_page(0)->paddr());
dbgln("UHCI: Framelist is at virtual address {}", m_framelist->vaddr());
write_sofmod(64); // 1mS frame time
@@ -141,11 +139,9 @@ UNMAP_AFTER_INIT ErrorOr<void> UHCIController::create_structures()
m_dummy_qh = allocate_queue_head();
// Now the Transfer Descriptor pool
- auto td_pool_vmobject = TRY(Memory::AnonymousVMObject::try_create_physically_contiguous_with_size(PAGE_SIZE));
-
m_transfer_descriptor_pool = TRY(UHCIDescriptorPool<TransferDescriptor>::try_create("Transfer Descriptor Pool"sv));
- m_isochronous_transfer_pool = TRY(MM.allocate_kernel_region_with_vmobject(move(td_pool_vmobject), PAGE_SIZE, "UHCI Isochronous Descriptor Pool", Memory::Region::Access::ReadWrite));
+ m_isochronous_transfer_pool = TRY(MM.allocate_dma_buffer_page("UHCI Isochronous Descriptor Pool", Memory::Region::Access::ReadWrite));
// Set up the Isochronous Transfer Descriptor list
m_iso_td_list.resize(UHCI_NUMBER_OF_ISOCHRONOUS_TDS);