[Mammoth] Add an OwnedMemoryRegion for ContiguousPhysical.

This commit is contained in:
Drew Galbraith 2023-11-19 20:42:38 -08:00
parent deb2e708cd
commit d41a565721
5 changed files with 26 additions and 22 deletions

View file

@ -13,8 +13,8 @@ AhciDevice::AhciDevice(AhciPort* port) : port_struct_(port) {
// 0x0-0x400 -> Command List
// 0x400-0x500 -> Received FIS
// 0x500-0x2500 -> Command Tables (0x100 each) (Max PRDT Length is 8 for now)
command_structures_ = MappedMemoryRegion::ContiguousPhysical(0x2500);
uint64_t paddr = command_structures_.paddr();
uint64_t paddr;
command_structures_ = OwnedMemoryRegion::ContiguousPhysical(0x2500, &paddr);
command_list_ = reinterpret_cast<CommandList*>(command_structures_.vaddr());
port_struct_->command_list_base = paddr;

View file

@ -26,7 +26,7 @@ class AhciDevice {
private:
AhciPort* port_struct_ = nullptr;
MappedMemoryRegion command_structures_;
OwnedMemoryRegion command_structures_;
CommandList* command_list_ = nullptr;
ReceivedFis* received_fis_ = nullptr;