[zion] Add a method for duplicating and scoping down VMMOs.

Use the AHCI section of the PCI config as an example POC of this.

We can now pass a memory capability instead of just the physical
address.
This commit is contained in:
Drew Galbraith 2023-08-01 17:46:26 -07:00
parent 8f84f8c3ca
commit 48c6e5b3a4
12 changed files with 62 additions and 18 deletions

View file

@ -27,8 +27,11 @@ PciReader::PciReader() {
header_ = PciHeader(vaddr, 0, 0, 0);
}
uint64_t PciReader::GetAhciPhysical() {
return phys_mem_offset_ + achi_device_offset_;
z_cap_t PciReader::GetAhciVmmo() {
uint64_t new_cap;
check(ZMemoryObjectDuplicate(gBootPciVmmoCap, achi_device_offset_,
kPcieConfigurationSize, &new_cap));
return new_cap;
}
void PciReader::FunctionDump(uint64_t base, uint64_t bus, uint64_t dev,