ZXFoundation™ 26h2
Loading...
Searching...
No Matches
dispatch.cxxm File Reference

Gate subsystem dispatch table. More...

Include dependency graph for dispatch.cxxm:

Data Structures

struct  zxfoundation::dgp::gate::dispatch::registration_op
 Bulk-register all handlers for a namespace. More...

Functions

auto zxfoundation::dgp::gate::dispatch::dispatch (u32 packed_nr, u64 a0, u64 a1, u64 a2, u64 a3, u64 a4) noexcept -> u64
 Dispatch a nucleus call through the table.
auto zxfoundation::dgp::gate::dispatch::is_registered (u32 packed_nr) noexcept -> bool
 Return true if the given slot has a registered handler.
auto zxfoundation::dgp::gate::dispatch::register_handler (u32 packed_nr, dispatch_handler handler, const entry_meta &meta) noexcept -> std::expected< void, lib::kernel_error >
 Register a handler at a given packed call slot.
auto zxfoundation::dgp::gate::dispatch::register_namespace_handlers (call_namespace ns, const registration_op ops[], u32 count) noexcept -> std::expected< void, lib::kernel_error >
 Bulk-register all handlers for a namespace.

Detailed Description

Gate subsystem dispatch table.

SPDX-License-Identifier: Apache-2.0

Function Documentation

◆ dispatch()

auto zxfoundation::dgp::gate::dispatch::dispatch ( u32 packed_nr,
u64 a0,
u64 a1,
u64 a2,
u64 a3,
u64 a4 )->u64
nodiscardexportnoexcept

Dispatch a nucleus call through the table.

Parameters
packed_nrTable index.
a0-a4Arguments.
Returns
Handler return value, or ~0ULL on error.

◆ register_handler()

auto zxfoundation::dgp::gate::dispatch::register_handler ( u32 packed_nr,
dispatch_handler handler,
const entry_meta & meta )->std::expected< void, lib::kernel_error >
nodiscardexportnoexcept

Register a handler at a given packed call slot.

Parameters
packed_nrTable index: (namespace << 5) | operation.
handlerThe handler function.
metaAuthorization metadata.
Returns
Success, or kernel_error if slot occupied or out of range.

◆ register_namespace_handlers()

auto zxfoundation::dgp::gate::dispatch::register_namespace_handlers ( call_namespace ns,
const registration_op ops[],
u32 count )->std::expected< void, lib::kernel_error >
nodiscardexportnoexcept

Bulk-register all handlers for a namespace.

Parameters
nsThe namespace whose handlers to register.
opsArray of (operation_id, handler, meta) tuples.
countNumber of entries in ops.
Returns
Success, or the first registration error encountered.