Add a yellowstone stub and partially migrate denali

This commit is contained in:
Drew Galbraith 2023-07-05 14:51:24 -07:00
parent 318356e54c
commit 72483a3437
6 changed files with 57 additions and 29 deletions

View file

@ -5,6 +5,7 @@
#include <mammoth/port_client.h>
#include <stdint.h>
#include <yellowstone.h>
#include <yellowstone_stub.h>
#include "ahci/ahci_driver.h"
#include "denali_server.h"
@ -13,18 +14,10 @@ uint64_t main(uint64_t init_port_cap) {
check(ParseInitPort(init_port_cap));
glcr::UniquePtr<EndpointClient> yellowstone =
EndpointClient::AdoptEndpoint(gInitEndpointCap);
YellowstoneGetReq ahci_req{
.type = kYellowstoneGetAhci,
};
auto resp_or =
yellowstone->CallEndpoint<YellowstoneGetReq, YellowstoneGetAhciResp>(
ahci_req);
if (!resp_or.ok()) {
check(resp_or.error());
}
uint64_t ahci_addr = resp_or.value().ahci_phys_offset;
ASSIGN_OR_RETURN(auto driver, AhciDriver::Init(ahci_addr));
YellowstoneStub stub(gInitEndpointCap);
ASSIGN_OR_RETURN(MappedMemoryRegion ahci_region, stub.GetAhciConfig());
ASSIGN_OR_RETURN(auto driver, AhciDriver::Init(ahci_region));
YellowstoneGetReq req{
.type = kYellowstoneGetRegistration,