[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

@ -8,6 +8,7 @@
#include <stdlib.h>
#include "hw/gpt.h"
#include "hw/pcie.h"
#include "include/yellowstone.h"
namespace {
@ -55,9 +56,11 @@ glcr::ErrorCode YellowstoneServer::HandleRequest(RequestContext& request,
dbgln("Yellowstone::GetAHCI");
YellowstoneGetAhciResp resp{
.type = kYellowstoneGetAhci,
.ahci_phys_offset = pci_reader_.GetAhciPhysical(),
.ahci_length = kPcieConfigurationSize,
};
RET_ERR(response.WriteStruct<YellowstoneGetAhciResp>(resp));
z_cap_t vmmo_cap = pci_reader_.GetAhciVmmo();
RET_ERR(
response.WriteStructWithCap<YellowstoneGetAhciResp>(resp, vmmo_cap));
break;
}
case kYellowstoneGetRegistration: {