[Yellowstone] Move to yunq definition for yellowstone server.

This commit is contained in:
Drew Galbraith 2023-10-24 18:24:26 -07:00
parent 9c9fd167cd
commit 2b27af5814
22 changed files with 696 additions and 118 deletions

View file

@ -6,7 +6,7 @@
namespace {
class NaiveAllocator {
public:
constexpr static uint64_t kSize = 0x4000;
constexpr static uint64_t kSize = 0x10000;
NaiveAllocator() {}
bool is_init() { return next_addr_ != 0; }
void Init() {
@ -23,6 +23,7 @@ class NaiveAllocator {
uint64_t addr = next_addr_;
next_addr_ += size;
if (next_addr_ >= max_addr_) {
ZProcessExit(0xBEEF);
return 0;
}
return reinterpret_cast<void*>(addr);

View file

@ -5,5 +5,5 @@
#include "mammoth/endpoint_client.h"
glcr::ErrorCode SpawnProcessFromElfRegion(
uint64_t program, glcr::UniquePtr<EndpointClient> client);
glcr::ErrorCode SpawnProcessFromElfRegion(uint64_t program,
z_cap_t yellowstone_client);

View file

@ -96,8 +96,8 @@ uint64_t LoadElfProgram(uint64_t base, uint64_t as_cap) {
} // namespace
glcr::ErrorCode SpawnProcessFromElfRegion(
uint64_t program, glcr::UniquePtr<EndpointClient> client) {
glcr::ErrorCode SpawnProcessFromElfRegion(uint64_t program,
z_cap_t yellowstone_client) {
uint64_t proc_cap;
uint64_t as_cap;
uint64_t foreign_port_id;
@ -125,7 +125,7 @@ glcr::ErrorCode SpawnProcessFromElfRegion(
RET_ERR(pclient.WriteMessage<uint64_t>(Z_INIT_SELF_PROC, proc_cap));
RET_ERR(pclient.WriteMessage<uint64_t>(Z_INIT_SELF_VMAS, as_cap));
RET_ERR(pclient.WriteMessage<uint64_t>(Z_INIT_ENDPOINT, client->GetCap()));
RET_ERR(pclient.WriteMessage<uint64_t>(Z_INIT_ENDPOINT, yellowstone_client));
#if MAM_PROC_DEBUG
dbgln("Thread start");