[yellowstone] Add yellowstone server for endpoint registration.
This commit is contained in:
parent
8dcb1ddabd
commit
a46694d0f7
13 changed files with 248 additions and 31 deletions
|
|
@ -2,7 +2,9 @@
|
|||
#include <mammoth/debug.h>
|
||||
#include <mammoth/endpoint_server.h>
|
||||
#include <mammoth/init.h>
|
||||
#include <mammoth/port.h>
|
||||
#include <stdint.h>
|
||||
#include <yellowstone.h>
|
||||
|
||||
#include "ahci/ahci_driver.h"
|
||||
#include "denali_server.h"
|
||||
|
|
@ -12,7 +14,24 @@ uint64_t main(uint64_t init_port_cap) {
|
|||
AhciDriver driver;
|
||||
RET_ERR(driver.Init());
|
||||
|
||||
EndpointServer endpoint = EndpointServer::Adopt(gInitEndpointCap);
|
||||
EndpointClient yellowstone = EndpointClient::AdoptEndpoint(gInitEndpointCap);
|
||||
YellowstoneGetReq req{
|
||||
.type = kYellowstoneGetRegistration,
|
||||
};
|
||||
auto resp_cap_or =
|
||||
yellowstone
|
||||
.CallEndpoint<YellowstoneGetReq, YellowstoneGetRegistrationResp>(req);
|
||||
if (!resp_cap_or.ok()) {
|
||||
dbgln("Bad call");
|
||||
check(resp_cap_or.error());
|
||||
}
|
||||
auto resp_cap = resp_cap_or.value();
|
||||
Port notify(resp_cap.second());
|
||||
|
||||
ASSIGN_OR_RETURN(EndpointServer endpoint, EndpointServer::Create());
|
||||
ASSIGN_OR_RETURN(EndpointClient client, endpoint.CreateClient());
|
||||
notify.WriteMessage("denali", client.GetCap());
|
||||
|
||||
DenaliServer server(endpoint, driver);
|
||||
RET_ERR(server.RunServer());
|
||||
// FIXME: Add thread join.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue