ZXFoundation™ 26h2
Loading...
Searching...
No Matches
io.cxxm
Go to the documentation of this file.
1/// SPDX-License-Identifier: Apache-2.0
2/// @file arch/s390x/io/ccw_io.cxxm
3/// @brief CCW I/O engine — synchronous I/O, SENSE ID, and device probing.
4
5export module arch.s390x.io.ccw.core;
6import arch.s390x.io.types;
7import zxfoundation.base.types;
8import lib.error;
9import lib.stl;
10
11export {
12
13namespace arch::s390x::io::ccw {
14
15 /// @brief Execute a CCW chain synchronously (polling mode).
16 /// @param sch_index Index into the subchannel table.
17 /// @param channel_program_addr 31-bit physical address of the first CCW.
18 /// @param key Storage key for the ORB (default 0 = nucleus).
19 /// @param timeout_us Timeout in microseconds (default 5 s).
20 /// @return The IRB captured by the interrupt handler on success,
21 /// kernel_error on timeout or I/O failure.
22 [[nodiscard]] auto sync(
23 u32 sch_index,
24 u32 channel_program_addr,
25 u8 key = 0,
26 u64 timeout_us = 5'000'000
27 ) noexcept -> ::std::expected<irb, ::lib::kernel_error>;
28
29 /// @brief Issue SENSE ID on a subchannel to identify the attached device.
30 /// @param sch_index Index into the subchannel table.
31 /// @return senseid_data on success, kernel_error on failure.
32 [[nodiscard]] auto sense_id(u32 sch_index) noexcept
33 -> ::std::expected<senseid_data, ::lib::kernel_error>;
34
35 /// @brief Run SENSE ID on all probed subchannels to populate device type info.
36 auto probe_devices() noexcept -> void;
37
38} // namespace arch::s390x::io::ccw
39
40} // end export