From 8fb55f56b6fcf2f7627330785ed540c5ea0834fc Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Sat, 24 Feb 2024 15:12:21 -0800 Subject: [PATCH] [Yellowstone] Start teton after voyageurs is available. --- sys/yellowstone/yellowstone.cpp | 4 ++++ sys/yellowstone/yellowstone_server.cpp | 4 ++++ sys/yellowstone/yellowstone_server.h | 2 ++ 3 files changed, 10 insertions(+) diff --git a/sys/yellowstone/yellowstone.cpp b/sys/yellowstone/yellowstone.cpp index 5efc089..2c85a99 100644 --- a/sys/yellowstone/yellowstone.cpp +++ b/sys/yellowstone/yellowstone.cpp @@ -49,6 +49,10 @@ uint64_t main(uint64_t port_cap) { for (glcr::StringView& file : files) { if (!file.empty()) { + // TODO: Implement startup dependencies. + if (file == "teton") { + server->WaitVoyageursRegistered(); + } mmth::File binary = mmth::File::Open(glcr::StrFormat("/bin/{}", file)); ASSIGN_OR_RETURN(client_cap, server->CreateClientCap()); diff --git a/sys/yellowstone/yellowstone_server.cpp b/sys/yellowstone/yellowstone_server.cpp index 999adfb..1c6af61 100644 --- a/sys/yellowstone/yellowstone_server.cpp +++ b/sys/yellowstone/yellowstone_server.cpp @@ -113,6 +113,8 @@ glcr::Status YellowstoneServer::HandleRegisterEndpoint( // transmit to other processes. mmth::SetVfsCap(req.endpoint_capability()); has_victoriafalls_semaphore_.Signal(); + } else if (req.endpoint_name() == "voyageurs") { + has_voyageurs_.Signal(); } else { dbgln("[WARN] Got endpoint cap type: {}", req.endpoint_name().cstr()); } @@ -138,4 +140,6 @@ void YellowstoneServer::WaitVictoriaFallsRegistered() { has_victoriafalls_semaphore_.Wait(); } +void YellowstoneServer::WaitVoyageursRegistered() { has_voyageurs_.Wait(); } + } // namespace yellowstone diff --git a/sys/yellowstone/yellowstone_server.h b/sys/yellowstone/yellowstone_server.h index c9bf99b..ac67fa7 100644 --- a/sys/yellowstone/yellowstone_server.h +++ b/sys/yellowstone/yellowstone_server.h @@ -25,6 +25,7 @@ class YellowstoneServer : public YellowstoneServerBase { void WaitDenaliRegistered(); void WaitVictoriaFallsRegistered(); + void WaitVoyageursRegistered(); private: glcr::HashMap endpoint_map_; @@ -37,6 +38,7 @@ class YellowstoneServer : public YellowstoneServerBase { mmth::Semaphore has_denali_semaphore_; mmth::Semaphore has_victoriafalls_semaphore_; + mmth::Semaphore has_voyageurs_; YellowstoneServer(z_cap_t endpoint_cap); };