ZXFoundation™ 26h2
Loading...
Searching...
No Matches
core.cxxm
1/// SPDX-License-Identifier: Apache 2.0
2/// @file diag.cxxm
3/// @brief idiomatic C++23 DIAG 8 hypervisor console driver.
4
5export module drivers.console.diag.core;
6import zxfoundation.sys.printk.types;
7import std;
8
9export {
10
11namespace drivers::console::diag {
12
13 /// @brief Flush ASCII content to the DIAG 8 console.
14 /// @param[in] s The ASCII string view to transmit.
15 auto write(std::string_view s) noexcept -> void;
16
17 /// @brief Initializer for the DIAG console backend.
18 auto init() noexcept -> void {}
19
20 /// @brief Global printk backend for the DIAG 8 console.
21 constexpr zxfoundation::sys::printk::printk_backend
22 diag_hv_con_printk_backend {
23 .name = "diag_hv_con",
24 .emit = write,
25 .init = init,
26 .active = false
27 };
28
29 /// @brief Retrieve the DIAG 8 console backend reference.
30 consteval auto get_backend() noexcept -> const zxfoundation::sys::printk::printk_backend& {
31 return diag_hv_con_printk_backend;
32 }
33
34} // namespace drivers::console::diag
35
36} // end export