ZXFoundation™ 26h2
Loading...
Searching...
No Matches
core.cxxm
1/// SPDX-License-Identifier: Apache-2.0
2/// @file ipc.cxxm
3/// @brief Bounded endpoint/message object management and grant transfer.
4
5export module zxfoundation.sys.ipc.core;
6import zxfoundation.base.types;
7import zxfoundation.memory.objects;
8import zxfoundation.dgp.domain.types;
9import zxfoundation.dgp.cap.types;
10import zxfoundation.dgp.domain.types;
11import zxfoundation.dgp.portal.types;
12import lib.error;
13import std;
14
15export {
16
17namespace zxfoundation::sys::ipc {
18
19 auto ipc_init() noexcept -> void;
20
21 [[nodiscard]] auto endpoint_create(
22 dgp::domain::domain& owner, u32 peer_domain
23 ) noexcept -> std::expected<u32, lib::kernel_error>;
24
25 [[nodiscard]] auto endpoint_destroy(
26 dgp::domain::domain& caller, u32 endpoint_id
27 ) noexcept -> std::expected<void, lib::kernel_error>;
28
29 [[nodiscard]] auto endpoint_owned_by(
30 u32 endpoint_id, u32 domain_id
31 ) noexcept -> bool;
32
33 auto destroy_for_domain(u32 domain_id) noexcept -> void;
34
35 [[nodiscard]] auto message_send(
36 dgp::domain::domain& caller, u32 endpoint_id,
37 const u8* payload, u32 length,
38 const dgp::cap::cap_token* capabilities, u32 capability_count,
39 const memory::objects::memory_object_ref* grants, u32 grant_count
40 ) noexcept -> std::expected<void, lib::kernel_error>;
41
42 [[nodiscard]] auto message_receive(
43 dgp::domain::domain& caller, u32 endpoint_id,
44 u8* payload, u32 payload_capacity, u32& out_length,
45 dgp::cap::cap_token* capabilities, u32& capability_count,
46 memory::objects::memory_object_ref* grants, u32& grant_count
47 ) noexcept -> std::expected<void, lib::kernel_error>;
48
49 [[nodiscard]] auto shm_export(
50 dgp::domain::domain& caller, u64 va, u64 length,
51 u32 target_domain
52 ) noexcept -> std::expected<dgp::cap::cap_token, lib::kernel_error>;
53
54 [[nodiscard]] auto shm_import(
55 dgp::domain::domain& caller, dgp::cap::cap_token grant_token,
56 u64 va, u64 length
57 ) noexcept -> std::expected<dgp::portal::portal_binding, lib::kernel_error>;
58
59} // namespace zxfoundation::sys::ipc
60
61} // end export