Domain subsystem implementation — domain, strand, and lifecycle management entry points. More...
import std;import lib.error;import lib.container_of;import arch.s390x.cpu.lowcore;import zxfoundation.sched.core;import zxfoundation.sys.ipc.core;import lib.cstring;import zxfoundation.sync.lockable;import zxfoundation.memory.vm;import zxfoundation.memory.pmm.types;import zxfoundation.memory.pmm;import zxfoundation.sync.qspinlock.core;import lib.format;import zxfoundation.memory.hhdm;import zxfoundation.base.transaction;import zxfoundation.scoms.metadata.core;import arch.s390x.cpu.aste;import zxfoundation.sys.service.core;import zxfoundation.scoms.kobject.ref;import arch.s390x.cpu.ctlreg;import zxfoundation.dgp.portal.core;import zxfoundation.scoms.table;import zxfoundation.scoms.kobject.types;import zxfoundation.base.types;import arch.s390x.mmu.core;import zxfoundation.dgp.isolation.types;import zxfoundation.scoms.kobject.base;import zxfoundation.dgp.authorize;import arch.s390x.mmu.types;import zxfoundation.dgp.domain.types;import zxfoundation.memory.kmalloc;import zxfoundation.sys.printk.core;import lib.list;import zxfoundation.dgp.sync_contract;import zxfoundation.sys.syschk.core;import zxfoundation.base.typestate;import zxfoundation.dgp.isolation;import zxfoundation.memory.objects;import arch.s390x.mmu.consts;import zxfoundation.sched.policy;import zxfoundation.dgp.cap.types;import zxfoundation.dgp.cap.core;import zxfoundation.dgp.signal;import zxfoundation.dgp.gate.core;import zxfoundation.dgp.policy.core;Data Structures | |
| class | zxfoundation::dgp::domain::detail::domain_create_txn |
| Transactional domain creation. More... | |
| struct | zxfoundation::dgp::domain::detail::nucleus_domain_handle |
| Nucleus domain. More... | |
Functions | |
| auto | zxfoundation::dgp::domain::detail::advance_domain_teardown_phase (domain &d, dgp::sync_contract::teardown_phase expected, dgp::sync_contract::teardown_phase requested) noexcept -> std::expected< void, lib::kernel_error > |
| auto | zxfoundation::dgp::domain::detail::claim_domain_destroy (domain &d) noexcept -> std::expected< void, lib::kernel_error > |
| auto | zxfoundation::dgp::domain::current_domain_or_nucleus () noexcept -> domain * |
| Return the currently-running domain. | |
| auto | zxfoundation::dgp::domain::domain_activate (domain_id id) noexcept -> std::expected< void, lib::kernel_error > |
| Activate a domain: transition from embryo → active. | |
| auto | zxfoundation::dgp::domain::domain_count () noexcept -> u32 |
| Return the current number of live domains. | |
| auto | zxfoundation::dgp::domain::domain_create (const char *name) noexcept -> std::expected< domain *, lib::kernel_error > |
| Create a new domain. | |
| auto | zxfoundation::dgp::domain::domain_destroy (domain_id id) noexcept -> std::expected< void, lib::kernel_error > |
| Destroy a domain and release all its resources. | |
| auto | zxfoundation::dgp::domain::domain_find (domain_id id) noexcept -> domain * |
| Look up a domain by ID. | |
| auto | zxfoundation::dgp::domain::domain_init () noexcept -> void |
| Initialize the domain subsystem. | |
| auto | zxfoundation::dgp::domain::domain_init_nucleus () noexcept -> std::expected< void, lib::kernel_error > |
| Initialize the nucleus domain at slot 0. | |
| auto | zxfoundation::dgp::domain::domain_nucleus () noexcept -> domain * |
| Get the nucleus domain — the kernel's own domain identity. | |
| auto | zxfoundation::dgp::domain::idle_strand_create (u16 cpu) noexcept -> std::expected< strand *, lib::kernel_error > |
| Allocate a per-CPU idle strand from the SCOMS strand table. | |
| auto | zxfoundation::dgp::domain::detail::idle_strand_create_impl (u16 cpu) noexcept -> std::expected< strand *, lib::kernel_error > |
| Allocate and initialize a per-CPU idle strand from the SCOMS strand table. | |
| auto | zxfoundation::dgp::domain::idle_strand_destroy (strand &s) noexcept -> std::expected< void, lib::kernel_error > |
| Destroy a per-CPU idle strand and release its SCOMS slot. | |
| auto | zxfoundation::dgp::domain::detail::idle_strand_destroy_impl (strand &s) noexcept -> std::expected< void, lib::kernel_error > |
| Destroy a per-CPU idle strand, releasing its stack and SCOMS slot. | |
| auto | zxfoundation::dgp::domain::detail::lifecycle_error () noexcept -> lib::kernel_error |
| auto | zxfoundation::dgp::domain::register_domain_cap_lookup () noexcept -> void |
| auto | zxfoundation::dgp::domain::detail::secondary_strand_count (const domain &owner) noexcept -> u32 |
| auto | zxfoundation::dgp::domain::strand_create (domain *owner, u16 cpu) noexcept -> std::expected< strand *, lib::kernel_error > |
| Create a secondary strand within a domain. | |
| auto | zxfoundation::dgp::domain::detail::strand_create_impl (domain *owner, u16 cpu) noexcept -> std::expected< strand *, lib::kernel_error > |
| Allocate and initialize a secondary strand for a domain. | |
| auto | zxfoundation::dgp::domain::strand_destroy (strand &s) noexcept -> std::expected< void, lib::kernel_error > |
| Destroy a secondary strand that has already left all run queues. | |
| auto | zxfoundation::dgp::domain::detail::strand_destroy_impl (strand &s) noexcept -> std::expected< void, lib::kernel_error > |
| auto | zxfoundation::dgp::domain::strand_init () noexcept -> void |
| Initialize the strand SCOMS table. | |
Variables | |
| no_export constexpr u32 | zxfoundation::dgp::domain::detail::DOMAIN_KERNEL_STACK_ORDER = 2 |
| Buddy order for kernel stack allocation: 2^2 = 4 pages. | |
| declscope(C) scoms no_export constexpr u32 | zxfoundation::dgp::domain::detail::DOMAIN_KERNEL_STACK_SIZE = 4 * 4096 |
| The global domain table — SCOMS scoms_table. | |
| no_export nucleus_domain_handle | zxfoundation::dgp::domain::detail::g_nucleus {} |
| no_export scoms::scoms_table< strand, MAX_SECONDARY_STRAND_IDS > | zxfoundation::dgp::domain::detail::g_strand_table {} |
| Secondary strand SCOMS table. | |
| no_export constexpr u32 | zxfoundation::dgp::domain::detail::MAX_SECONDARY_STRAND_IDS = MAX_DOMAINS * MAX_STRANDS_PER_DOMAIN |
Domain subsystem implementation — domain, strand, and lifecycle management entry points.
SPDX-License-Identifier: Apache-2.0
|
nodiscardnoexcept |
Activate a domain: transition from embryo → active.
| [in] | id | Domain ID to activate. |
|
nodiscardnoexcept |
Create a new domain.
| [in] | name | Human-readable name (pointer must remain valid for the domain's lifetime). |
|
nodiscardnoexcept |
Destroy a domain and release all its resources.
| [in] | id | Domain ID to destroy. |
Look up a domain by ID.
| [in] | id | Domain ID. |
|
nodiscardnoexcept |
Get the nucleus domain — the kernel's own domain identity.
|
nodiscardnoexcept |
Allocate a per-CPU idle strand from the SCOMS strand table.
| cpu | CPU this idle strand is pinned to. |
|
nodiscardnoexcept |
Allocate and initialize a per-CPU idle strand from the SCOMS strand table.
| cpu | CPU this idle strand is pinned to. |
|
nodiscardnoexcept |
Destroy a per-CPU idle strand and release its SCOMS slot.
| s | Idle strand to destroy. |
|
nodiscardnoexcept |
Destroy a per-CPU idle strand, releasing its stack and SCOMS slot.
| s | Idle strand to destroy (must not be on_rq or running). |
|
nodiscardnoexcept |
Create a secondary strand within a domain.
| owner | Domain that will own the strand. |
| cpu | CPU affinity (0 for any, or specific CPU). |
|
nodiscardnoexcept |
Allocate and initialize a secondary strand for a domain.
| owner | The domain that will own this strand. |
| cpu | CPU affinity (0 for any). |
|
nodiscardnoexcept |
Destroy a secondary strand that has already left all run queues.
| [in,out] | s | Strand whose stack and SCOMS identity should be released. |
|
constexpr |
The global domain table — SCOMS scoms_table.
Kernel stack size per domain: 4 pages = 16 KiB.