[Yellowstone] Move yellowstone yunq to namespace "yellowstone"

This commit is contained in:
Drew Galbraith 2023-11-30 08:50:43 -08:00
parent f1e09b2ae6
commit 6212aef336
40 changed files with 141 additions and 16 deletions

View file

@ -1,3 +1,5 @@
package yellowstone;
interface Yellowstone {
method RegisterEndpoint(RegisterEndpointRequest) -> ();
method GetEndpoint(GetEndpointRequest) -> (Endpoint);

View file

@ -7,6 +7,9 @@
#include <zcall.h>
namespace yellowstone {
YellowstoneClient::~YellowstoneClient() {
if (endpoint_ != 0) {
@ -208,3 +211,7 @@ glcr::ErrorCode YellowstoneClient::GetDenali(DenaliInfo& response) {
}
} // namepace yellowstone

View file

@ -8,6 +8,9 @@
#include "yellowstone.yunq.h"
namespace yellowstone {
class YellowstoneClient {
public:
YellowstoneClient(z_cap_t Yellowstone_cap) : endpoint_(Yellowstone_cap) {}
@ -45,3 +48,6 @@ class YellowstoneClient {
uint64_t kCapBufferSize = 0x10;
glcr::CapBuffer cap_buffer_{kCapBufferSize};
};
} // namepace yellowstone

View file

@ -1,6 +1,9 @@
// Generated file -- DO NOT MODIFY.
#include "yellowstone.yunq.h"
namespace yellowstone {
namespace {
const uint64_t header_size = 24; // 4x uint32, 1x uint64
@ -426,4 +429,7 @@ uint64_t DenaliInfo::SerializeToBytes(glcr::ByteBuffer& bytes, uint64_t offset,
WriteHeader(bytes, offset, core_size, next_extension);
return next_extension;
}
}
} // namepace yellowstone

View file

@ -6,6 +6,10 @@
#include <glacier/container/vector.h>
#include <glacier/string/string.h>
#include <ztypes.h>
namespace yellowstone {
class RegisterEndpointRequest {
public:
RegisterEndpointRequest() {}
@ -170,4 +174,7 @@ class DenaliInfo {
// Parses everything except for caps.
void ParseFromBytesInternal(const glcr::ByteBuffer&, uint64_t offset);
};
};
} // namepace yellowstone

View file

@ -4,6 +4,9 @@
#include <mammoth/util/debug.h>
#include <zcall.h>
namespace yellowstone {
namespace {
const uint32_t kSentinel = 0xBEEFDEAD;
@ -193,3 +196,7 @@ glcr::ErrorCode YellowstoneServerBase::HandleRequest(const glcr::ByteBuffer& req
}
return glcr::OK;
}
} // namepace yellowstone

View file

@ -9,6 +9,10 @@
#include "yellowstone.yunq.client.h"
namespace yellowstone {
class YellowstoneServerBase {
public:
@ -55,3 +59,7 @@ class YellowstoneServerBase {
glcr::CapBuffer& resp_caps);
};
} // namepace yellowstone

View file

@ -22,7 +22,7 @@ uint64_t main(uint64_t port_cap) {
check(ParseInitPort(port_cap));
dbgln("Yellowstone Initializing.");
ASSIGN_OR_RETURN(auto server, YellowstoneServer::Create());
ASSIGN_OR_RETURN(auto server, yellowstone::YellowstoneServer::Create());
Thread server_thread = server->RunServer();
ASSIGN_OR_RETURN(uint64_t client_cap, server->CreateClientCap());

View file

@ -11,6 +11,7 @@
#include "hw/gpt.h"
#include "hw/pcie.h"
namespace yellowstone {
namespace {
struct PartitionInfo {
@ -125,3 +126,5 @@ void YellowstoneServer::WaitDenaliRegistered() { has_denali_semaphore_.Wait(); }
void YellowstoneServer::WaitVictoriaFallsRegistered() {
has_victoriafalls_semaphore_.Wait();
}
} // namespace yellowstone

View file

@ -10,6 +10,8 @@
#include "hw/pcie.h"
#include "lib/yellowstone/yellowstone.yunq.server.h"
namespace yellowstone {
class YellowstoneServer : public YellowstoneServerBase {
public:
static glcr::ErrorOr<glcr::UniquePtr<YellowstoneServer>> Create();
@ -39,3 +41,5 @@ class YellowstoneServer : public YellowstoneServerBase {
YellowstoneServer(z_cap_t endpoint_cap);
};
} // namespace yellowstone