ZXFoundation™ 26h2
Loading...
Searching...
No Matches
core.cxx File Reference

DGP synchronization-contract typestate and validation implementation. More...

import lib.error;
import arch.s390x.cpu.irq;
import std;
import arch.s390x.cpu.lowcore;
import zxfoundation.base.types;
Include dependency graph for core.cxx:

Functions

auto zxfoundation::dgp::sync_contract::advance_teardown_phase (teardown_phase &current, teardown_phase expected, teardown_phase requested) noexcept -> std::expected< void, lib::kernel_error >
 Advance a domain-owned teardown phase by exactly one stage.
auto zxfoundation::dgp::sync_contract::contract_snapshot (lock_context context, teardown_phase phase, u32 domain_id) noexcept -> contract_state
 Capture the current CPU synchronization state for a DGP call-site check.
auto zxfoundation::dgp::sync_contract::validate_authority_lookup (const contract_state &state) noexcept -> std::expected< void, lib::kernel_error >
 Validate that a DGP authority lookup may run in the supplied context.
auto zxfoundation::dgp::sync_contract::validate_irq_state (const contract_state &state, irq_contract contract) noexcept -> std::expected< void, lib::kernel_error >
 Validate an IRQ-state precondition.
auto zxfoundation::dgp::sync_contract::validate_teardown_phase (teardown_phase current, teardown_phase requested) noexcept -> std::expected< void, lib::kernel_error >
 Validate one exact teardown-phase transition.

Detailed Description

DGP synchronization-contract typestate and validation implementation.

SPDX-License-Identifier: Apache-2.0

Function Documentation

◆ advance_teardown_phase()

auto zxfoundation::dgp::sync_contract::advance_teardown_phase ( teardown_phase & current,
teardown_phase expected,
teardown_phase requested )->std::expected< void, lib::kernel_error >
nodiscardexportnoexcept

Advance a domain-owned teardown phase by exactly one stage.

Parameters
[in,out]currentStored phase owned by the domain being destroyed.
[in]expectedPhase the domain must currently hold.
[in]requestedImmediate phase to record.
Returns
Success when the stored phase was advanced.
Parameters
[in,out]currentStored phase owned by the domain being destroyed.
[in]expectedPhase the domain must currently hold.
[in]requestedImmediate phase to record.
Returns
Success when the stored phase was advanced.
Note
Callers must serialize access to current with the domain lifecycle lock.

◆ contract_snapshot()

auto zxfoundation::dgp::sync_contract::contract_snapshot ( lock_context context,
teardown_phase phase,
u32 domain_id )->contract_state
nodiscardexportnoexcept

Capture the current CPU synchronization state for a DGP call-site check.

Parameters
[in]contextSynchronization context expected by the caller.
[in]phaseDomain teardown phase associated with the operation.
[in]domain_idDomain whose authority or lifecycle state is being checked.
Returns
Snapshot containing CPU ID, qspinlock depth, interrupt mask state, and RCU read-side state.

◆ validate_authority_lookup()

auto zxfoundation::dgp::sync_contract::validate_authority_lookup ( const contract_state & state) ->std::expected< void, lib::kernel_error >
nodiscardexportnoexcept

Validate that a DGP authority lookup may run in the supplied context.

Parameters
[in]stateCurrent synchronization state.
Returns
Success when the context is safe for non-blocking authority validation.

◆ validate_irq_state()

auto zxfoundation::dgp::sync_contract::validate_irq_state ( const contract_state & state,
irq_contract contract )->std::expected< void, lib::kernel_error >
nodiscardexportnoexcept

Validate an IRQ-state precondition.

Parameters
[in]stateCurrent synchronization state.
[in]contractRequired interrupt-state contract.
Returns
Success when the current state satisfies the required interrupt condition.

◆ validate_teardown_phase()

auto zxfoundation::dgp::sync_contract::validate_teardown_phase ( teardown_phase current,
teardown_phase requested )->std::expected< void, lib::kernel_error >
nodiscardexportnoexcept

Validate one exact teardown-phase transition.

Parameters
[in]currentCurrent teardown phase.
[in]requestedRequested teardown phase.
Returns
Success when requested is the immediate successor of current.