5export module arch.s390x.cpu.aste;
6export import arch.s390x.cpu.aste.consts;
8import zxfoundation.base.types;
12namespace arch::s390x::cpu::aste {
15 struct [[gnu::packed]]
alignas(64) aste {
19 [[nodiscard]]
auto is_invalid()
const noexcept ->
bool;
22 auto set_invalid(
bool inv)
noexcept ->
void;
25 [[nodiscard]]
auto asce()
const noexcept -> u64;
28 auto set_asce(u64 val)
noexcept ->
void;
31 [[nodiscard]]
auto ald()
const noexcept -> u64;
34 auto set_ald(u64 val)
noexcept ->
void;
37 [[nodiscard]]
auto authorization_index()
const noexcept -> u16;
40 auto set_authorization_index(u16 ax)
noexcept ->
void;
43 [[nodiscard]]
auto ltd_raw()
const noexcept -> u32;
46 auto set_ltd_raw(u32 ltd)
noexcept ->
void;
50 [[nodiscard]]
auto ltd_valid()
const noexcept ->
bool;
52 auto set_ltd_valid(
bool v)
noexcept ->
void;
56 [[nodiscard]]
auto ltd_origin()
const noexcept -> u64;
60 auto set_ltd_origin(u64 addr)
noexcept ->
void;
64 [[nodiscard]]
auto ltd_length()
const noexcept -> u8;
67 auto set_ltd_length(u8 ltl)
noexcept ->
void;
70 auto clear()
noexcept ->
void;
73 static_assert(
sizeof(aste) == 64,
"ASTE must be exactly 64 bytes (PoP §3.8.4)");
74 static_assert(
alignof(aste) == 64,
"ASTE must be 64-byte aligned");
77 struct [[gnu::packed]] ale {
81 [[nodiscard]]
auto is_invalid()
const noexcept ->
bool;
84 auto set_invalid(
bool inv)
noexcept ->
void;
87 [[nodiscard]]
auto aste_origin()
const noexcept -> u64;
90 auto set_aste_origin(u64 addr)
noexcept ->
void;
93 [[nodiscard]]
auto sequence()
const noexcept -> u8;
96 auto set_sequence(u8 val)
noexcept ->
void;
99 auto set_fetch_only(
bool fetch_only)
noexcept ->
void;
102 auto set_aste_sequence(u32 val)
noexcept ->
void;
105 auto clear()
noexcept ->
void;
108 static_assert(
sizeof(ale) == 16,
"ALE must be exactly 16 bytes (PoP §3.8.3)");
111 auto aste_subsystem_init()
noexcept ->
void;
115 [[nodiscard]]
auto art_context_init(art_context& context)
noexcept
116 -> ::std::expected<
void, ::lib::kernel_error>;
120 auto art_context_destroy(art_context& context)
noexcept ->
void;
123 auto art_context_load(
const art_context& context)
noexcept ->
void;
129 [[nodiscard]]
auto aste_alloc(
132 )
noexcept -> ::std::expected<u32, ::lib::kernel_error>;
138 [[nodiscard]]
auto aste_free(
140 )
noexcept -> ::std::expected<
void, ::lib::kernel_error>;
145 [[nodiscard]]
auto ale_create(
146 art_context& context,
148 )
noexcept -> ::std::expected<u32, ::lib::kernel_error>;
154 [[nodiscard]]
auto ale_destroy(
155 art_context& context,
157 )
noexcept -> ::std::expected<
void, ::lib::kernel_error>;
163 [[nodiscard]]
auto aste_find(u32 index)
noexcept -> aste*;