[srv.init] Serve a service locator protocol from init

The init process now serves as a service locator for its children,
passing all children a mailbox handle on which it is serving the service
locator protocol.
This commit is contained in:
Justin C. Miller
2022-02-28 20:23:18 -08:00
parent ef307e8ec6
commit 17dcb961ec
10 changed files with 165 additions and 4 deletions

View File

@@ -2,8 +2,10 @@
j6 = module("j6",
kind = "lib",
deps = [ "util" ],
sources = [
"init.cpp",
"protocol_ids.cpp",
"syscalls.s.cog",
"sysconf.cpp.cog",
],
@@ -12,6 +14,8 @@ j6 = module("j6",
"j6/errors.h",
"j6/flags.h",
"j6/init.h",
"j6/protocols.h",
"j6/protocols/service_locator.h",
"j6/syscalls.h.cog",
"j6/sysconf.h.cog",
"j6/types.h",

View File

@@ -0,0 +1,12 @@
#pragma once
/// \file j6/protocols.h
/// Common definition for j6 user-mode IPC protocols
enum j6_proto_base_tag
{
j6_proto_base_status,
j6_proto_base_get_proto_id,
j6_proto_base_proto_id,
j6_proto_base_first_proto_id /// The first protocol-specific ID
};

View File

@@ -0,0 +1,14 @@
#pragma once
/// \file j6/protocols/service_locator.h
/// Definitions for the service locator protocol
#include <j6/protocols.h>
extern const uint64_t j6_proto_sl_id;
enum j6_proto_sl_tag
{
j6_proto_sl_register = j6_proto_base_first_proto_id,
j6_proto_sl_find,
j6_proto_sl_result,
};

View File

@@ -0,0 +1,4 @@
#include <util/hash.h>
extern "C"
const uint64_t j6_proto_sl_id = "jsix.protocol.service_locator"_id;